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

from sky.schemas.generated import jobsv1_pb2 as sky_dot_schemas_dot_generated_dot_jobsv1__pb2

GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in sky/schemas/generated/jobsv1_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.AddJob = channel.unary_unary(
                '/jobs.v1.JobsService/AddJob',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobResponse.FromString,
                _registered_method=True)
        self.QueueJob = channel.unary_unary(
                '/jobs.v1.JobsService/QueueJob',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobResponse.FromString,
                _registered_method=True)
        self.UpdateStatus = channel.unary_unary(
                '/jobs.v1.JobsService/UpdateStatus',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusResponse.FromString,
                _registered_method=True)
        self.GetJobQueue = channel.unary_unary(
                '/jobs.v1.JobsService/GetJobQueue',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueResponse.FromString,
                _registered_method=True)
        self.CancelJobs = channel.unary_unary(
                '/jobs.v1.JobsService/CancelJobs',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsResponse.FromString,
                _registered_method=True)
        self.FailAllInProgressJobs = channel.unary_unary(
                '/jobs.v1.JobsService/FailAllInProgressJobs',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsResponse.FromString,
                _registered_method=True)
        self.TailLogs = channel.unary_stream(
                '/jobs.v1.JobsService/TailLogs',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsResponse.FromString,
                _registered_method=True)
        self.GetJobStatus = channel.unary_unary(
                '/jobs.v1.JobsService/GetJobStatus',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusResponse.FromString,
                _registered_method=True)
        self.GetJobSubmittedTimestamp = channel.unary_unary(
                '/jobs.v1.JobsService/GetJobSubmittedTimestamp',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampResponse.FromString,
                _registered_method=True)
        self.GetJobEndedTimestamp = channel.unary_unary(
                '/jobs.v1.JobsService/GetJobEndedTimestamp',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampResponse.FromString,
                _registered_method=True)
        self.GetLogDirsForJobs = channel.unary_unary(
                '/jobs.v1.JobsService/GetLogDirsForJobs',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsResponse.FromString,
                _registered_method=True)
        self.GetJobExitCodes = channel.unary_unary(
                '/jobs.v1.JobsService/GetJobExitCodes',
                request_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesRequest.SerializeToString,
                response_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesResponse.FromString,
                _registered_method=True)


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

    def AddJob(self, request, context):
        """Add a new job to the database.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def QueueJob(self, request, context):
        """Queue a job for execution.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateStatus(self, request, context):
        """Update status of all jobs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def CancelJobs(self, request, context):
        """Cancel jobs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FailAllInProgressJobs(self, request, context):
        """Fail all in-progress jobs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def GetJobStatus(self, request, context):
        """Get job status.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetJobSubmittedTimestamp(self, request, context):
        """Get job submitted timestamp.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetJobEndedTimestamp(self, request, context):
        """Get job ended timestamp.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLogDirsForJobs(self, request, context):
        """Get log directories for jobs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetJobExitCodes(self, request, context):
        """Get job exit codes.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_JobsServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AddJob': grpc.unary_unary_rpc_method_handler(
                    servicer.AddJob,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobResponse.SerializeToString,
            ),
            'QueueJob': grpc.unary_unary_rpc_method_handler(
                    servicer.QueueJob,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobResponse.SerializeToString,
            ),
            'UpdateStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateStatus,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusResponse.SerializeToString,
            ),
            'GetJobQueue': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobQueue,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueResponse.SerializeToString,
            ),
            'CancelJobs': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelJobs,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsResponse.SerializeToString,
            ),
            'FailAllInProgressJobs': grpc.unary_unary_rpc_method_handler(
                    servicer.FailAllInProgressJobs,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsResponse.SerializeToString,
            ),
            'TailLogs': grpc.unary_stream_rpc_method_handler(
                    servicer.TailLogs,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsResponse.SerializeToString,
            ),
            'GetJobStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobStatus,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusResponse.SerializeToString,
            ),
            'GetJobSubmittedTimestamp': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobSubmittedTimestamp,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampResponse.SerializeToString,
            ),
            'GetJobEndedTimestamp': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobEndedTimestamp,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampResponse.SerializeToString,
            ),
            'GetLogDirsForJobs': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLogDirsForJobs,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsResponse.SerializeToString,
            ),
            'GetJobExitCodes': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobExitCodes,
                    request_deserializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesRequest.FromString,
                    response_serializer=sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'jobs.v1.JobsService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def AddJob(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.v1.JobsService/AddJob',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.AddJobResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def QueueJob(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.v1.JobsService/QueueJob',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.QueueJobResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateStatus(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.v1.JobsService/UpdateStatus',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.UpdateStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobQueue(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.v1.JobsService/GetJobQueue',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobQueueResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CancelJobs(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.v1.JobsService/CancelJobs',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.CancelJobsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FailAllInProgressJobs(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.v1.JobsService/FailAllInProgressJobs',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.FailAllInProgressJobsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def TailLogs(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.v1.JobsService/TailLogs',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.TailLogsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/jobs.v1.JobsService/GetJobStatus',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobSubmittedTimestamp(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.v1.JobsService/GetJobSubmittedTimestamp',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobSubmittedTimestampResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobEndedTimestamp(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.v1.JobsService/GetJobEndedTimestamp',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobEndedTimestampResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLogDirsForJobs(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.v1.JobsService/GetLogDirsForJobs',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetLogDirsForJobsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobExitCodes(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.v1.JobsService/GetJobExitCodes',
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesRequest.SerializeToString,
            sky_dot_schemas_dot_generated_dot_jobsv1__pb2.GetJobExitCodesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
