# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import job_pb2 as job__pb2


class JobAPIStub(object):
  # missing associated documentation comment in .proto file
  pass

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

    Args:
      channel: A grpc.Channel.
    """
    self.CreateJob = channel.unary_unary(
        '/descarteslabs.workflows.JobAPI/CreateJob',
        request_serializer=job__pb2.CreateJobRequest.SerializeToString,
        response_deserializer=job__pb2.Job.FromString,
        )
    self.ListJobs = channel.unary_stream(
        '/descarteslabs.workflows.JobAPI/ListJobs',
        request_serializer=job__pb2.ListJobsRequest.SerializeToString,
        response_deserializer=job__pb2.Job.FromString,
        )
    self.GetJob = channel.unary_unary(
        '/descarteslabs.workflows.JobAPI/GetJob',
        request_serializer=job__pb2.GetJobRequest.SerializeToString,
        response_deserializer=job__pb2.Job.FromString,
        )
    self.CancelJob = channel.unary_unary(
        '/descarteslabs.workflows.JobAPI/CancelJob',
        request_serializer=job__pb2.CancelJobRequest.SerializeToString,
        response_deserializer=job__pb2.Job.FromString,
        )
    self.WatchJob = channel.unary_stream(
        '/descarteslabs.workflows.JobAPI/WatchJob',
        request_serializer=job__pb2.WatchJobRequest.SerializeToString,
        response_deserializer=job__pb2.Job.FromString,
        )


class JobAPIServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def CreateJob(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListJobs(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetJob(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CancelJob(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def WatchJob(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_JobAPIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'CreateJob': grpc.unary_unary_rpc_method_handler(
          servicer.CreateJob,
          request_deserializer=job__pb2.CreateJobRequest.FromString,
          response_serializer=job__pb2.Job.SerializeToString,
      ),
      'ListJobs': grpc.unary_stream_rpc_method_handler(
          servicer.ListJobs,
          request_deserializer=job__pb2.ListJobsRequest.FromString,
          response_serializer=job__pb2.Job.SerializeToString,
      ),
      'GetJob': grpc.unary_unary_rpc_method_handler(
          servicer.GetJob,
          request_deserializer=job__pb2.GetJobRequest.FromString,
          response_serializer=job__pb2.Job.SerializeToString,
      ),
      'CancelJob': grpc.unary_unary_rpc_method_handler(
          servicer.CancelJob,
          request_deserializer=job__pb2.CancelJobRequest.FromString,
          response_serializer=job__pb2.Job.SerializeToString,
      ),
      'WatchJob': grpc.unary_stream_rpc_method_handler(
          servicer.WatchJob,
          request_deserializer=job__pb2.WatchJobRequest.FromString,
          response_serializer=job__pb2.Job.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'descarteslabs.workflows.JobAPI', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
