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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from ondewo.csi import conversation_pb2 as ondewo_dot_csi_dot_conversation__pb2


class ConversationsStub(object):
    """endpoints of csi service
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateS2sPipeline = channel.unary_unary(
                '/ondewo.csi.Conversations/CreateS2sPipeline',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.GetS2sPipeline = channel.unary_unary(
                '/ondewo.csi.Conversations/GetS2sPipeline',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.FromString,
                )
        self.UpdateS2sPipeline = channel.unary_unary(
                '/ondewo.csi.Conversations/UpdateS2sPipeline',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.DeleteS2sPipeline = channel.unary_unary(
                '/ondewo.csi.Conversations/DeleteS2sPipeline',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ListS2sPipelines = channel.unary_unary(
                '/ondewo.csi.Conversations/ListS2sPipelines',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesRequest.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesResponse.FromString,
                )
        self.S2sStream = channel.stream_stream(
                '/ondewo.csi.Conversations/S2sStream',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sStreamRequest.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sStreamResponse.FromString,
                )
        self.CheckUpstreamHealth = channel.unary_unary(
                '/ondewo.csi.Conversations/CheckUpstreamHealth',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.CheckUpstreamHealthResponse.FromString,
                )
        self.GetControlStream = channel.unary_stream(
                '/ondewo.csi.Conversations/GetControlStream',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.ControlStreamRequest.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.ControlStreamResponse.FromString,
                )
        self.SetControlStatus = channel.unary_unary(
                '/ondewo.csi.Conversations/SetControlStatus',
                request_serializer=ondewo_dot_csi_dot_conversation__pb2.SetControlStatusRequest.SerializeToString,
                response_deserializer=ondewo_dot_csi_dot_conversation__pb2.SetControlStatusResponse.FromString,
                )


class ConversationsServicer(object):
    """endpoints of csi service
    """

    def CreateS2sPipeline(self, request, context):
        """Create the S2S pipeline specified in the request message. The pipeline with the specified ID must not exist.

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext -d '{
        "id": "pizza",
        "s2t_pipeline_id": "default_german",
        "nlu_project_id": "1f3425d2-41fd-4970-87e6-88e8e121bb49",
        "nlu_language_code": "de",
        "t2s_pipeline_id": "default_german"
        }' localhost:50051 ondewo.csi.Conversations.CreateS2sPipeline
        </pre>
        <samp>{}</samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetS2sPipeline(self, request, context):
        """Retrieve the S2S pipeline with the ID specified in the request message.

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext -d '{"id": "pizza"}' localhost:50051 ondewo.csi.Conversations.GetS2sPipeline
        </pre>
        <samp>{
        "id": "pizza",
        "s2t_pipeline_id": "default_german",
        "nlu_project_id": "1f3425d2-41fd-4970-87e6-88e8e121bb49",
        "nlu_language_code": "de",
        "t2s_pipeline_id": "default_german"
        }
        </samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateS2sPipeline(self, request, context):
        """Update the S2S pipeline specified in the request message. The pipeline must exist.

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext -d '{
        "id": "pizza",
        "s2t_pipeline_id": "default_german",
        "nlu_project_id": "1f3425d2-41fd-4970-87e6-88e8e121bb49",
        "nlu_language_code": "en",
        "t2s_pipeline_id": "default_german"
        }' localhost:50051 ondewo.csi.Conversations.UpdateS2sPipeline
        </pre>
        <samp>{}</samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteS2sPipeline(self, request, context):
        """Delete the S2S pipeline with the ID specified in the request message. The pipeline must exist.

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext -d '{"id": "pizza"}' localhost:50051 ondewo.csi.Conversations.DeleteS2sPipeline
        </pre>
        <samp>{}</samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListS2sPipelines(self, request, context):
        """List all S2S pipelines of the server.

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext localhost:50051 ondewo.csi.Conversations.ListS2sPipelines
        </pre>
        <samp>{
        "pipelines": [
        {
        "id": "pizza",
        "s2t_pipeline_id": "default_german",
        "nlu_project_id": "1f3425d2-41fd-4970-87e6-88e8e121bb49",
        "nlu_language_code": "de",
        "t2s_pipeline_id": "default_german"
        }
        ]
        }</samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def S2sStream(self, request_iterator, context):
        """Processes a natural language query in audio format in a streaming fashion
        and returns structured, actionable data as a result.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CheckUpstreamHealth(self, request, context):
        """Check the health of S2T, NLU and T2S servers

        <p>Examples:</p>

        <pre>
        grpcurl -plaintext localhost:50051 ondewo.csi.Conversations.CheckUpstreamHealth
        </pre>

        All upstreams healthy:
        <samp>{}</samp>

        All upstreams unhealthy:
        <samp>{
        "s2t_status": {
        "code": 14,
        "message": "failed to connect to all addresses"
        },
        "nlu_status": {
        "code": 14,
        "message": "failed to connect to all addresses"
        },
        "t2s_status": {
        "code": 14,
        "message": "failed to connect to all addresses"
        }
        }</samp>
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetControlStream(self, request, context):
        """Get the control stream to control sip, t2s, s2t etc. during a conversation
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetControlStatus(self, request, context):
        """Send a message on the control stream to control sip, t2s, s2t etc. during a conversation
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ConversationsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateS2sPipeline': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateS2sPipeline,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'GetS2sPipeline': grpc.unary_unary_rpc_method_handler(
                    servicer.GetS2sPipeline,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.SerializeToString,
            ),
            'UpdateS2sPipeline': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateS2sPipeline,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'DeleteS2sPipeline': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteS2sPipeline,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ListS2sPipelines': grpc.unary_unary_rpc_method_handler(
                    servicer.ListS2sPipelines,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesRequest.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesResponse.SerializeToString,
            ),
            'S2sStream': grpc.stream_stream_rpc_method_handler(
                    servicer.S2sStream,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.S2sStreamRequest.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.S2sStreamResponse.SerializeToString,
            ),
            'CheckUpstreamHealth': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckUpstreamHealth,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.CheckUpstreamHealthResponse.SerializeToString,
            ),
            'GetControlStream': grpc.unary_stream_rpc_method_handler(
                    servicer.GetControlStream,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.ControlStreamRequest.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.ControlStreamResponse.SerializeToString,
            ),
            'SetControlStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.SetControlStatus,
                    request_deserializer=ondewo_dot_csi_dot_conversation__pb2.SetControlStatusRequest.FromString,
                    response_serializer=ondewo_dot_csi_dot_conversation__pb2.SetControlStatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ondewo.csi.Conversations', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Conversations(object):
    """endpoints of csi service
    """

    @staticmethod
    def CreateS2sPipeline(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, '/ondewo.csi.Conversations/CreateS2sPipeline',
            ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetS2sPipeline(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, '/ondewo.csi.Conversations/GetS2sPipeline',
            ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UpdateS2sPipeline(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, '/ondewo.csi.Conversations/UpdateS2sPipeline',
            ondewo_dot_csi_dot_conversation__pb2.S2sPipeline.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteS2sPipeline(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, '/ondewo.csi.Conversations/DeleteS2sPipeline',
            ondewo_dot_csi_dot_conversation__pb2.S2sPipelineId.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListS2sPipelines(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, '/ondewo.csi.Conversations/ListS2sPipelines',
            ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesRequest.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.ListS2sPipelinesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def S2sStream(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, '/ondewo.csi.Conversations/S2sStream',
            ondewo_dot_csi_dot_conversation__pb2.S2sStreamRequest.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.S2sStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CheckUpstreamHealth(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, '/ondewo.csi.Conversations/CheckUpstreamHealth',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.CheckUpstreamHealthResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetControlStream(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_stream(request, target, '/ondewo.csi.Conversations/GetControlStream',
            ondewo_dot_csi_dot_conversation__pb2.ControlStreamRequest.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.ControlStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetControlStatus(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, '/ondewo.csi.Conversations/SetControlStatus',
            ondewo_dot_csi_dot_conversation__pb2.SetControlStatusRequest.SerializeToString,
            ondewo_dot_csi_dot_conversation__pb2.SetControlStatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
