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

from cogment.api import common_pb2 as cogment_dot_api_dot_common__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.RunTrial = channel.stream_stream(
                '/cogmentAPI.ServiceActorSP/RunTrial',
                request_serializer=cogment_dot_api_dot_common__pb2.ActorRunTrialInput.SerializeToString,
                response_deserializer=cogment_dot_api_dot_common__pb2.ActorRunTrialOutput.FromString,
                )
        self.Version = channel.unary_unary(
                '/cogmentAPI.ServiceActorSP/Version',
                request_serializer=cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
                )


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

    def RunTrial(self, request_iterator, context):
        """Expected metadata:
        - trial-id: The id of the trial
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Version(self, request, context):
        """Expected metadata: None
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServiceActorSPServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'RunTrial': grpc.stream_stream_rpc_method_handler(
                    servicer.RunTrial,
                    request_deserializer=cogment_dot_api_dot_common__pb2.ActorRunTrialInput.FromString,
                    response_serializer=cogment_dot_api_dot_common__pb2.ActorRunTrialOutput.SerializeToString,
            ),
            'Version': grpc.unary_unary_rpc_method_handler(
                    servicer.Version,
                    request_deserializer=cogment_dot_api_dot_common__pb2.VersionRequest.FromString,
                    response_serializer=cogment_dot_api_dot_common__pb2.VersionInfo.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cogmentAPI.ServiceActorSP', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def RunTrial(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/cogmentAPI.ServiceActorSP/RunTrial',
            cogment_dot_api_dot_common__pb2.ActorRunTrialInput.SerializeToString,
            cogment_dot_api_dot_common__pb2.ActorRunTrialOutput.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Version(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, '/cogmentAPI.ServiceActorSP/Version',
            cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
            cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
