# 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 google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2
from . import job_pb2 as job__pb2
from . import nbox_ws_pb2 as nbox__ws__pb2


class WSJobServiceStub(object):
    """
    WSJobService is used by nbox to interface with Web Server. WSJobService manages
    DB and NBX Platform Information. All compute resource related actions are fowarded
    to WSJobsService running on AWS.

    // Generated according to https://cloud.google.com/apis/design/standard_methods
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetJob = channel.unary_unary(
                '/jobs.ws.WSJobService/GetJob',
                request_serializer=nbox__ws__pb2.JobInfo.SerializeToString,
                response_deserializer=job__pb2.Job.FromString,
                )
        self.ListJobs = channel.unary_unary(
                '/jobs.ws.WSJobService/ListJobs',
                request_serializer=nbox__ws__pb2.ListJobsRequest.SerializeToString,
                response_deserializer=nbox__ws__pb2.ListJobsResponse.FromString,
                )
        self.UploadJobCode = channel.unary_unary(
                '/jobs.ws.WSJobService/UploadJobCode',
                request_serializer=nbox__ws__pb2.UploadCodeRequest.SerializeToString,
                response_deserializer=job__pb2.Job.FromString,
                )
        self.CreateJob = channel.unary_unary(
                '/jobs.ws.WSJobService/CreateJob',
                request_serializer=nbox__ws__pb2.CreateJobRequest.SerializeToString,
                response_deserializer=job__pb2.Job.FromString,
                )
        self.UpdateJob = channel.unary_unary(
                '/jobs.ws.WSJobService/UpdateJob',
                request_serializer=nbox__ws__pb2.UpdateJobRequest.SerializeToString,
                response_deserializer=job__pb2.Job.FromString,
                )
        self.DeleteJob = channel.unary_unary(
                '/jobs.ws.WSJobService/DeleteJob',
                request_serializer=nbox__ws__pb2.JobInfo.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.GetJobLogs = channel.unary_stream(
                '/jobs.ws.WSJobService/GetJobLogs',
                request_serializer=nbox__ws__pb2.JobLogsRequest.SerializeToString,
                response_deserializer=nbox__ws__pb2.JobLog.FromString,
                )
        self.TriggerJob = channel.unary_unary(
                '/jobs.ws.WSJobService/TriggerJob',
                request_serializer=nbox__ws__pb2.JobInfo.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
                )
        self.UpdateRun = channel.unary_unary(
                '/jobs.ws.WSJobService/UpdateRun',
                request_serializer=nbox__ws__pb2.UpdateRunRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.GetRunToken = channel.unary_unary(
                '/jobs.ws.WSJobService/GetRunToken',
                request_serializer=nbox__ws__pb2.JobInfo.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.FromString,
                )


class WSJobServiceServicer(object):
    """
    WSJobService is used by nbox to interface with Web Server. WSJobService manages
    DB and NBX Platform Information. All compute resource related actions are fowarded
    to WSJobsService running on AWS.

    // Generated according to https://cloud.google.com/apis/design/standard_methods
    """

    def GetJob(self, request, context):
        """GetJob returns the job with the given info
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListJobs(self, request, context):
        """ListJobs returns a list of jobs for the given workspace/user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UploadJobCode(self, request, context):
        """To upload Job Code to S3
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateJob(self, request, context):
        """CreateJob creates a new job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateJob(self, request, context):
        """UpdateJob updates the given job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteJob(self, request, context):
        """DeleteJob deletes the given job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetJobLogs(self, request, context):
        """GetJobLogs returns logs from given job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def TriggerJob(self, request, context):
        """TriggerJob triggers the given job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateRun(self, request, context):
        """UpdateRun update the run for given job
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRunToken(self, request, context):
        """GetRunToken returns a tokn to be used for `/UpdateRun`
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WSJobServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetJob': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJob,
                    request_deserializer=nbox__ws__pb2.JobInfo.FromString,
                    response_serializer=job__pb2.Job.SerializeToString,
            ),
            'ListJobs': grpc.unary_unary_rpc_method_handler(
                    servicer.ListJobs,
                    request_deserializer=nbox__ws__pb2.ListJobsRequest.FromString,
                    response_serializer=nbox__ws__pb2.ListJobsResponse.SerializeToString,
            ),
            'UploadJobCode': grpc.unary_unary_rpc_method_handler(
                    servicer.UploadJobCode,
                    request_deserializer=nbox__ws__pb2.UploadCodeRequest.FromString,
                    response_serializer=job__pb2.Job.SerializeToString,
            ),
            'CreateJob': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateJob,
                    request_deserializer=nbox__ws__pb2.CreateJobRequest.FromString,
                    response_serializer=job__pb2.Job.SerializeToString,
            ),
            'UpdateJob': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateJob,
                    request_deserializer=nbox__ws__pb2.UpdateJobRequest.FromString,
                    response_serializer=job__pb2.Job.SerializeToString,
            ),
            'DeleteJob': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteJob,
                    request_deserializer=nbox__ws__pb2.JobInfo.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'GetJobLogs': grpc.unary_stream_rpc_method_handler(
                    servicer.GetJobLogs,
                    request_deserializer=nbox__ws__pb2.JobLogsRequest.FromString,
                    response_serializer=nbox__ws__pb2.JobLog.SerializeToString,
            ),
            'TriggerJob': grpc.unary_unary_rpc_method_handler(
                    servicer.TriggerJob,
                    request_deserializer=nbox__ws__pb2.JobInfo.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.SerializeToString,
            ),
            'UpdateRun': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateRun,
                    request_deserializer=nbox__ws__pb2.UpdateRunRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'GetRunToken': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRunToken,
                    request_deserializer=nbox__ws__pb2.JobInfo.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'jobs.ws.WSJobService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class WSJobService(object):
    """
    WSJobService is used by nbox to interface with Web Server. WSJobService manages
    DB and NBX Platform Information. All compute resource related actions are fowarded
    to WSJobsService running on AWS.

    // Generated according to https://cloud.google.com/apis/design/standard_methods
    """

    @staticmethod
    def GetJob(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, '/jobs.ws.WSJobService/GetJob',
            nbox__ws__pb2.JobInfo.SerializeToString,
            job__pb2.Job.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListJobs(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, '/jobs.ws.WSJobService/ListJobs',
            nbox__ws__pb2.ListJobsRequest.SerializeToString,
            nbox__ws__pb2.ListJobsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UploadJobCode(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, '/jobs.ws.WSJobService/UploadJobCode',
            nbox__ws__pb2.UploadCodeRequest.SerializeToString,
            job__pb2.Job.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateJob(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, '/jobs.ws.WSJobService/CreateJob',
            nbox__ws__pb2.CreateJobRequest.SerializeToString,
            job__pb2.Job.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UpdateJob(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, '/jobs.ws.WSJobService/UpdateJob',
            nbox__ws__pb2.UpdateJobRequest.SerializeToString,
            job__pb2.Job.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteJob(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, '/jobs.ws.WSJobService/DeleteJob',
            nbox__ws__pb2.JobInfo.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetJobLogs(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, '/jobs.ws.WSJobService/GetJobLogs',
            nbox__ws__pb2.JobLogsRequest.SerializeToString,
            nbox__ws__pb2.JobLog.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def TriggerJob(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, '/jobs.ws.WSJobService/TriggerJob',
            nbox__ws__pb2.JobInfo.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UpdateRun(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, '/jobs.ws.WSJobService/UpdateRun',
            nbox__ws__pb2.UpdateRunRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetRunToken(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, '/jobs.ws.WSJobService/GetRunToken',
            nbox__ws__pb2.JobInfo.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.StringValue.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
