# 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 hooks_pb2 as cogment_dot_api_dot_hooks__pb2


class TrialHooksStub(object):
    """Expected metadata for all calls except `Version`:
    - trial-id: The id of the trial
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.OnPreTrial = channel.unary_unary(
                '/cogment.TrialHooks/OnPreTrial',
                request_serializer=cogment_dot_api_dot_hooks__pb2.PreTrialContext.SerializeToString,
                response_deserializer=cogment_dot_api_dot_hooks__pb2.PreTrialContext.FromString,
                )
        self.Version = channel.unary_unary(
                '/cogment.TrialHooks/Version',
                request_serializer=cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
                )


class TrialHooksServicer(object):
    """Expected metadata for all calls except `Version`:
    - trial-id: The id of the trial
    """

    def OnPreTrial(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 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_TrialHooksServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'OnPreTrial': grpc.unary_unary_rpc_method_handler(
                    servicer.OnPreTrial,
                    request_deserializer=cogment_dot_api_dot_hooks__pb2.PreTrialContext.FromString,
                    response_serializer=cogment_dot_api_dot_hooks__pb2.PreTrialContext.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(
            'cogment.TrialHooks', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class TrialHooks(object):
    """Expected metadata for all calls except `Version`:
    - trial-id: The id of the trial
    """

    @staticmethod
    def OnPreTrial(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, '/cogment.TrialHooks/OnPreTrial',
            cogment_dot_api_dot_hooks__pb2.PreTrialContext.SerializeToString,
            cogment_dot_api_dot_hooks__pb2.PreTrialContext.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, '/cogment.TrialHooks/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)
