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

from angzarr_client.proto.examples import ai_sidecar_pb2 as examples_dot_ai__sidecar__pb2


class AiSidecarStub(object):
    """=============================================================================
    AI Sidecar Service - gRPC interface for PyTorch model inference
    Called by AI player implementation within player aggregate
    =============================================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetAction = channel.unary_unary(
                '/examples.AiSidecar/GetAction',
                request_serializer=examples_dot_ai__sidecar__pb2.ActionRequest.SerializeToString,
                response_deserializer=examples_dot_ai__sidecar__pb2.ActionResponse.FromString,
                _registered_method=True)
        self.Health = channel.unary_unary(
                '/examples.AiSidecar/Health',
                request_serializer=examples_dot_ai__sidecar__pb2.HealthRequest.SerializeToString,
                response_deserializer=examples_dot_ai__sidecar__pb2.HealthResponse.FromString,
                _registered_method=True)
        self.GetActionsBatch = channel.unary_unary(
                '/examples.AiSidecar/GetActionsBatch',
                request_serializer=examples_dot_ai__sidecar__pb2.BatchActionRequest.SerializeToString,
                response_deserializer=examples_dot_ai__sidecar__pb2.BatchActionResponse.FromString,
                _registered_method=True)


class AiSidecarServicer(object):
    """=============================================================================
    AI Sidecar Service - gRPC interface for PyTorch model inference
    Called by AI player implementation within player aggregate
    =============================================================================

    """

    def GetAction(self, request, context):
        """Get recommended action from the AI model
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def GetActionsBatch(self, request, context):
        """Batch inference for training/simulation
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AiSidecarServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAction': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAction,
                    request_deserializer=examples_dot_ai__sidecar__pb2.ActionRequest.FromString,
                    response_serializer=examples_dot_ai__sidecar__pb2.ActionResponse.SerializeToString,
            ),
            'Health': grpc.unary_unary_rpc_method_handler(
                    servicer.Health,
                    request_deserializer=examples_dot_ai__sidecar__pb2.HealthRequest.FromString,
                    response_serializer=examples_dot_ai__sidecar__pb2.HealthResponse.SerializeToString,
            ),
            'GetActionsBatch': grpc.unary_unary_rpc_method_handler(
                    servicer.GetActionsBatch,
                    request_deserializer=examples_dot_ai__sidecar__pb2.BatchActionRequest.FromString,
                    response_serializer=examples_dot_ai__sidecar__pb2.BatchActionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'examples.AiSidecar', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('examples.AiSidecar', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AiSidecar(object):
    """=============================================================================
    AI Sidecar Service - gRPC interface for PyTorch model inference
    Called by AI player implementation within player aggregate
    =============================================================================

    """

    @staticmethod
    def GetAction(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,
            '/examples.AiSidecar/GetAction',
            examples_dot_ai__sidecar__pb2.ActionRequest.SerializeToString,
            examples_dot_ai__sidecar__pb2.ActionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Health(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,
            '/examples.AiSidecar/Health',
            examples_dot_ai__sidecar__pb2.HealthRequest.SerializeToString,
            examples_dot_ai__sidecar__pb2.HealthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetActionsBatch(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,
            '/examples.AiSidecar/GetActionsBatch',
            examples_dot_ai__sidecar__pb2.BatchActionRequest.SerializeToString,
            examples_dot_ai__sidecar__pb2.BatchActionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
