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

from . import agent_server_pb2 as agent__server__pb2
from . import common_pb2 as common__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ping = channel.unary_unary(
                '/octopus_agent_proto.AgentServer/ping',
                request_serializer=agent__server__pb2.PingRequest.SerializeToString,
                response_deserializer=agent__server__pb2.PongResponse.FromString,
                )
        self.upload = channel.stream_unary(
                '/octopus_agent_proto.AgentServer/upload',
                request_serializer=common__pb2.FileChunk.SerializeToString,
                response_deserializer=common__pb2.FileUploaded.FromString,
                )
        self.download = channel.unary_stream(
                '/octopus_agent_proto.AgentServer/download',
                request_serializer=common__pb2.DownloadRequest.SerializeToString,
                response_deserializer=common__pb2.FileChunk.FromString,
                )
        self.send_task = channel.unary_stream(
                '/octopus_agent_proto.AgentServer/send_task',
                request_serializer=agent__server__pb2.SendTaskRequest.SerializeToString,
                response_deserializer=agent__server__pb2.TaskRespond.FromString,
                )
        self.add_kernel = channel.unary_unary(
                '/octopus_agent_proto.AgentServer/add_kernel',
                request_serializer=agent__server__pb2.AddKernelRequest.SerializeToString,
                response_deserializer=agent__server__pb2.AddKernelResponse.FromString,
                )
        self.assemble = channel.unary_unary(
                '/octopus_agent_proto.AgentServer/assemble',
                request_serializer=agent__server__pb2.AssembleAppRequest.SerializeToString,
                response_deserializer=agent__server__pb2.AssembleAppResponse.FromString,
                )
        self.run = channel.unary_stream(
                '/octopus_agent_proto.AgentServer/run',
                request_serializer=agent__server__pb2.RunAppRequest.SerializeToString,
                response_deserializer=agent__server__pb2.TaskRespond.FromString,
                )
        self.query_apps = channel.unary_unary(
                '/octopus_agent_proto.AgentServer/query_apps',
                request_serializer=agent__server__pb2.QueryAppsRequest.SerializeToString,
                response_deserializer=agent__server__pb2.QueryAppsResponse.FromString,
                )


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

    def ping(self, request, context):
        """check the connection is ok
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def upload(self, request_iterator, context):
        """upload the file
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def download(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def send_task(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def add_kernel(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def assemble(self, request, context):
        """assemble the application
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def run(self, request, context):
        """run assembled application
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def query_apps(self, request, context):
        """query all apps
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgentServerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ping': grpc.unary_unary_rpc_method_handler(
                    servicer.ping,
                    request_deserializer=agent__server__pb2.PingRequest.FromString,
                    response_serializer=agent__server__pb2.PongResponse.SerializeToString,
            ),
            'upload': grpc.stream_unary_rpc_method_handler(
                    servicer.upload,
                    request_deserializer=common__pb2.FileChunk.FromString,
                    response_serializer=common__pb2.FileUploaded.SerializeToString,
            ),
            'download': grpc.unary_stream_rpc_method_handler(
                    servicer.download,
                    request_deserializer=common__pb2.DownloadRequest.FromString,
                    response_serializer=common__pb2.FileChunk.SerializeToString,
            ),
            'send_task': grpc.unary_stream_rpc_method_handler(
                    servicer.send_task,
                    request_deserializer=agent__server__pb2.SendTaskRequest.FromString,
                    response_serializer=agent__server__pb2.TaskRespond.SerializeToString,
            ),
            'add_kernel': grpc.unary_unary_rpc_method_handler(
                    servicer.add_kernel,
                    request_deserializer=agent__server__pb2.AddKernelRequest.FromString,
                    response_serializer=agent__server__pb2.AddKernelResponse.SerializeToString,
            ),
            'assemble': grpc.unary_unary_rpc_method_handler(
                    servicer.assemble,
                    request_deserializer=agent__server__pb2.AssembleAppRequest.FromString,
                    response_serializer=agent__server__pb2.AssembleAppResponse.SerializeToString,
            ),
            'run': grpc.unary_stream_rpc_method_handler(
                    servicer.run,
                    request_deserializer=agent__server__pb2.RunAppRequest.FromString,
                    response_serializer=agent__server__pb2.TaskRespond.SerializeToString,
            ),
            'query_apps': grpc.unary_unary_rpc_method_handler(
                    servicer.query_apps,
                    request_deserializer=agent__server__pb2.QueryAppsRequest.FromString,
                    response_serializer=agent__server__pb2.QueryAppsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'octopus_agent_proto.AgentServer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ping(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, '/octopus_agent_proto.AgentServer/ping',
            agent__server__pb2.PingRequest.SerializeToString,
            agent__server__pb2.PongResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def upload(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_unary(request_iterator, target, '/octopus_agent_proto.AgentServer/upload',
            common__pb2.FileChunk.SerializeToString,
            common__pb2.FileUploaded.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def download(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, '/octopus_agent_proto.AgentServer/download',
            common__pb2.DownloadRequest.SerializeToString,
            common__pb2.FileChunk.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def send_task(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, '/octopus_agent_proto.AgentServer/send_task',
            agent__server__pb2.SendTaskRequest.SerializeToString,
            agent__server__pb2.TaskRespond.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def add_kernel(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, '/octopus_agent_proto.AgentServer/add_kernel',
            agent__server__pb2.AddKernelRequest.SerializeToString,
            agent__server__pb2.AddKernelResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def assemble(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, '/octopus_agent_proto.AgentServer/assemble',
            agent__server__pb2.AssembleAppRequest.SerializeToString,
            agent__server__pb2.AssembleAppResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def run(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, '/octopus_agent_proto.AgentServer/run',
            agent__server__pb2.RunAppRequest.SerializeToString,
            agent__server__pb2.TaskRespond.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def query_apps(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, '/octopus_agent_proto.AgentServer/query_apps',
            agent__server__pb2.QueryAppsRequest.SerializeToString,
            agent__server__pb2.QueryAppsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
