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

from model.ray.v1alpha import user_defined_pb2 as model_dot_ray_dot_v1alpha_dot_user__defined__pb2


class UserDefinedServiceStub(object):
    """User defined service for internal process
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.__call__ = channel.unary_unary(
                '/model.ray.v1alpha.UserDefinedService/__call__',
                request_serializer=model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallRequest.SerializeToString,
                response_deserializer=model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallResponse.FromString,
                )


class UserDefinedServiceServicer(object):
    """User defined service for internal process
    """

    def __call__(self, request, context):
        """Trigger method is the default trigger entry for ray deployment
        Ray doesn't comply with the naming convention of protobuf, so we need to
        buf:lint:ignore RPC_PASCAL_CASE
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UserDefinedServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            '__call__': grpc.unary_unary_rpc_method_handler(
                    servicer.__call__,
                    request_deserializer=model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallRequest.FromString,
                    response_serializer=model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'model.ray.v1alpha.UserDefinedService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class UserDefinedService(object):
    """User defined service for internal process
    """

    @staticmethod
    def __call__(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, '/model.ray.v1alpha.UserDefinedService/__call__',
            model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallRequest.SerializeToString,
            model_dot_ray_dot_v1alpha_dot_user__defined__pb2.CallResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
