# 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
from cogment.api import trial_datastore_pb2 as cogment_dot_api_dot_trial__datastore__pb2


class TrialDatastoreSPStub(object):
    """API for trial datastore, it stores trial samples
    -- Online operations (e.g. during training)
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.RetrieveTrials = channel.unary_unary(
                '/cogmentAPI.TrialDatastoreSP/RetrieveTrials',
                request_serializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsReply.FromString,
                )
        self.RetrieveSamples = channel.unary_stream(
                '/cogmentAPI.TrialDatastoreSP/RetrieveSamples',
                request_serializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveSamplesRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveSampleReply.FromString,
                )
        self.AddTrial = channel.unary_unary(
                '/cogmentAPI.TrialDatastoreSP/AddTrial',
                request_serializer=cogment_dot_api_dot_trial__datastore__pb2.AddTrialRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_trial__datastore__pb2.AddTrialReply.FromString,
                )
        self.AddSample = channel.stream_unary(
                '/cogmentAPI.TrialDatastoreSP/AddSample',
                request_serializer=cogment_dot_api_dot_trial__datastore__pb2.AddSampleRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_trial__datastore__pb2.AddSamplesReply.FromString,
                )
        self.DeleteTrials = channel.unary_unary(
                '/cogmentAPI.TrialDatastoreSP/DeleteTrials',
                request_serializer=cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsReply.FromString,
                )
        self.Version = channel.unary_unary(
                '/cogmentAPI.TrialDatastoreSP/Version',
                request_serializer=cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
                )


class TrialDatastoreSPServicer(object):
    """API for trial datastore, it stores trial samples
    -- Online operations (e.g. during training)
    """

    def RetrieveTrials(self, request, context):
        """Retrieve the trials matching the given request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RetrieveSamples(self, request, context):
        """Retrieve samples from matching trials, trials can be ongoing
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddTrial(self, request, context):
        """-- Offline trial data managmement operations

        Add a trial to the activity logger, once a trial is added, samples can be retrieved
        Expected header metadata
        - trial-id
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddSample(self, request_iterator, context):
        """Add samples to a trial
        Expected header metadata
        - trial-id
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteTrials(self, request, context):
        """Delete the trials matching the given request, on failure no trial is deleted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Version(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TrialDatastoreSPServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'RetrieveTrials': grpc.unary_unary_rpc_method_handler(
                    servicer.RetrieveTrials,
                    request_deserializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsRequest.FromString,
                    response_serializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsReply.SerializeToString,
            ),
            'RetrieveSamples': grpc.unary_stream_rpc_method_handler(
                    servicer.RetrieveSamples,
                    request_deserializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveSamplesRequest.FromString,
                    response_serializer=cogment_dot_api_dot_trial__datastore__pb2.RetrieveSampleReply.SerializeToString,
            ),
            'AddTrial': grpc.unary_unary_rpc_method_handler(
                    servicer.AddTrial,
                    request_deserializer=cogment_dot_api_dot_trial__datastore__pb2.AddTrialRequest.FromString,
                    response_serializer=cogment_dot_api_dot_trial__datastore__pb2.AddTrialReply.SerializeToString,
            ),
            'AddSample': grpc.stream_unary_rpc_method_handler(
                    servicer.AddSample,
                    request_deserializer=cogment_dot_api_dot_trial__datastore__pb2.AddSampleRequest.FromString,
                    response_serializer=cogment_dot_api_dot_trial__datastore__pb2.AddSamplesReply.SerializeToString,
            ),
            'DeleteTrials': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteTrials,
                    request_deserializer=cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsRequest.FromString,
                    response_serializer=cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsReply.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.TrialDatastoreSP', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class TrialDatastoreSP(object):
    """API for trial datastore, it stores trial samples
    -- Online operations (e.g. during training)
    """

    @staticmethod
    def RetrieveTrials(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.TrialDatastoreSP/RetrieveTrials',
            cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsRequest.SerializeToString,
            cogment_dot_api_dot_trial__datastore__pb2.RetrieveTrialsReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RetrieveSamples(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, '/cogmentAPI.TrialDatastoreSP/RetrieveSamples',
            cogment_dot_api_dot_trial__datastore__pb2.RetrieveSamplesRequest.SerializeToString,
            cogment_dot_api_dot_trial__datastore__pb2.RetrieveSampleReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddTrial(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.TrialDatastoreSP/AddTrial',
            cogment_dot_api_dot_trial__datastore__pb2.AddTrialRequest.SerializeToString,
            cogment_dot_api_dot_trial__datastore__pb2.AddTrialReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddSample(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_unary(request_iterator, target, '/cogmentAPI.TrialDatastoreSP/AddSample',
            cogment_dot_api_dot_trial__datastore__pb2.AddSampleRequest.SerializeToString,
            cogment_dot_api_dot_trial__datastore__pb2.AddSamplesReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteTrials(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.TrialDatastoreSP/DeleteTrials',
            cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsRequest.SerializeToString,
            cogment_dot_api_dot_trial__datastore__pb2.DeleteTrialsReply.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.TrialDatastoreSP/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)
