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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
try:
    import opentestbed_pb2 as opentestbed__pb2
except ImportError:
    from opentestbed import opentestbed_pb2 as opentestbed__pb2


class OpenapiStub(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Reserve = channel.unary_unary(
                '/opentestbed.Openapi/Reserve',
                request_serializer=opentestbed__pb2.ReserveRequest.SerializeToString,
                response_deserializer=opentestbed__pb2.ReserveResponse.FromString,
                )
        self.Release = channel.unary_unary(
                '/opentestbed.Openapi/Release',
                request_serializer=opentestbed__pb2.ReleaseRequest.SerializeToString,
                response_deserializer=opentestbed__pb2.ReleaseResponse.FromString,
                )
        self.GetVersion = channel.unary_unary(
                '/opentestbed.Openapi/GetVersion',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=opentestbed__pb2.GetVersionResponse.FromString,
                )


class OpenapiServicer(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

    def Reserve(self, request, context):
        """Reserves the testbed based on available devices from inventory.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Release(self, request, context):
        """Releases the devices based on unique id generated during reservation.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetVersion(self, request, context):
        """Description missing in models
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_OpenapiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Reserve': grpc.unary_unary_rpc_method_handler(
                    servicer.Reserve,
                    request_deserializer=opentestbed__pb2.ReserveRequest.FromString,
                    response_serializer=opentestbed__pb2.ReserveResponse.SerializeToString,
            ),
            'Release': grpc.unary_unary_rpc_method_handler(
                    servicer.Release,
                    request_deserializer=opentestbed__pb2.ReleaseRequest.FromString,
                    response_serializer=opentestbed__pb2.ReleaseResponse.SerializeToString,
            ),
            'GetVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetVersion,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=opentestbed__pb2.GetVersionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'opentestbed.Openapi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Openapi(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

    @staticmethod
    def Reserve(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, '/opentestbed.Openapi/Reserve',
            opentestbed__pb2.ReserveRequest.SerializeToString,
            opentestbed__pb2.ReserveResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Release(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, '/opentestbed.Openapi/Release',
            opentestbed__pb2.ReleaseRequest.SerializeToString,
            opentestbed__pb2.ReleaseResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetVersion(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, '/opentestbed.Openapi/GetVersion',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            opentestbed__pb2.GetVersionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
