# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from .worker_pb2 import (
    LeaderUpdateRequest,
    WorkerServerUpdateResponse,
    NewJobRequest,
    NewJobResponse,
    PollWorkerRequest,
    PollWorkerResponse,
    JobCompleteRequest,
    JobCompleteResponse,
    WorkerHeartbeatRequest,
    WorkerHeartbeatResponse,
    LeaderRegisterWorkerRequest,
    LeaderRegisterWorkerResponse
)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetRequestsCompleted = channel.unary_unary(
                '/WorkerServer/GetRequestsCompleted',
                request_serializer=LeaderUpdateRequest.SerializeToString,
                response_deserializer=WorkerServerUpdateResponse.FromString,
                )
        self.CreateNewWorkerJob = channel.unary_unary(
                '/WorkerServer/CreateNewWorkerJob',
                request_serializer=NewJobRequest.SerializeToString,
                response_deserializer=NewJobResponse.FromString,
                )
        self.GetJobStatus = channel.unary_unary(
                '/WorkerServer/GetJobStatus',
                request_serializer=PollWorkerRequest.SerializeToString,
                response_deserializer=PollWorkerResponse.FromString,
                )
        self.GetJobResults = channel.unary_unary(
                '/WorkerServer/GetJobResults',
                request_serializer=JobCompleteRequest.SerializeToString,
                response_deserializer=JobCompleteResponse.FromString,
                )
        self.CheckWorkerHeartbeat = channel.unary_unary(
                '/WorkerServer/CheckWorkerHeartbeat',
                request_serializer=WorkerHeartbeatRequest.SerializeToString,
                response_deserializer=WorkerHeartbeatResponse.FromString,
                )
        self.LeaderRegisterWorker = channel.unary_unary(
                '/WorkerServer/LeaderRegisterWorker',
                request_serializer=LeaderRegisterWorkerRequest.SerializeToString,
                response_deserializer=LeaderRegisterWorkerResponse.FromString,
                )


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

    def GetRequestsCompleted(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 CreateNewWorkerJob(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 GetJobStatus(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 GetJobResults(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 CheckWorkerHeartbeat(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 LeaderRegisterWorker(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_WorkerServerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetRequestsCompleted': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRequestsCompleted,
                    request_deserializer=LeaderUpdateRequest.FromString,
                    response_serializer=WorkerServerUpdateResponse.SerializeToString,
            ),
            'CreateNewWorkerJob': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateNewWorkerJob,
                    request_deserializer=NewJobRequest.FromString,
                    response_serializer=NewJobResponse.SerializeToString,
            ),
            'GetJobStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobStatus,
                    request_deserializer=PollWorkerRequest.FromString,
                    response_serializer=PollWorkerResponse.SerializeToString,
            ),
            'GetJobResults': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobResults,
                    request_deserializer=JobCompleteRequest.FromString,
                    response_serializer=JobCompleteResponse.SerializeToString,
            ),
            'CheckWorkerHeartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckWorkerHeartbeat,
                    request_deserializer=WorkerHeartbeatRequest.FromString,
                    response_serializer=WorkerHeartbeatResponse.SerializeToString,
            ),
            'LeaderRegisterWorker': grpc.unary_unary_rpc_method_handler(
                    servicer.LeaderRegisterWorker,
                    request_deserializer=LeaderRegisterWorkerRequest.FromString,
                    response_serializer=LeaderRegisterWorkerResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'WorkerServer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetRequestsCompleted(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, '/WorkerServer/GetRequestsCompleted',
            LeaderUpdateRequest.SerializeToString,
            WorkerServerUpdateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateNewWorkerJob(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, '/WorkerServer/CreateNewWorkerJob',
            NewJobRequest.SerializeToString,
            NewJobResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetJobStatus(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, '/WorkerServer/GetJobStatus',
            PollWorkerRequest.SerializeToString,
            PollWorkerResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetJobResults(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, '/WorkerServer/GetJobResults',
            JobCompleteRequest.SerializeToString,
            JobCompleteResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CheckWorkerHeartbeat(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, '/WorkerServer/CheckWorkerHeartbeat',
            WorkerHeartbeatRequest.SerializeToString,
            WorkerHeartbeatResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def LeaderRegisterWorker(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, '/WorkerServer/LeaderRegisterWorker',
            LeaderRegisterWorkerRequest.SerializeToString,
            LeaderRegisterWorkerResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
