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

import oaas_registry_api.rpc.registry_pb2 as registry__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.register_service = channel.unary_unary(
            "/OaasRegistry/register_service",
            request_serializer=registry__pb2.OaasServiceDefinition.SerializeToString,
            response_deserializer=registry__pb2.OaasServiceDefinition.FromString,
        )
        self.resolve_service = channel.unary_unary(
            "/OaasRegistry/resolve_service",
            request_serializer=registry__pb2.OaasServiceDefinition.SerializeToString,
            response_deserializer=registry__pb2.OaasResolveServiceResponse.FromString,
        )
        self.unregister_service = channel.unary_unary(
            "/OaasRegistry/unregister_service",
            request_serializer=registry__pb2.OaasServiceId.SerializeToString,
            response_deserializer=registry__pb2.OaasUnregisterServiceResponse.FromString,
        )


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

    def register_service(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 resolve_service(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 unregister_service(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!")

    @staticmethod
    def add_to_server(servicer, server):
        rpc_method_handlers = {
            "register_service": grpc.unary_unary_rpc_method_handler(
                servicer.register_service,
                request_deserializer=registry__pb2.OaasServiceDefinition.FromString,
                response_serializer=registry__pb2.OaasServiceDefinition.SerializeToString,
            ),
            "resolve_service": grpc.unary_unary_rpc_method_handler(
                servicer.resolve_service,
                request_deserializer=registry__pb2.OaasServiceDefinition.FromString,
                response_serializer=registry__pb2.OaasResolveServiceResponse.SerializeToString,
            ),
            "unregister_service": grpc.unary_unary_rpc_method_handler(
                servicer.unregister_service,
                request_deserializer=registry__pb2.OaasServiceId.FromString,
                response_serializer=registry__pb2.OaasUnregisterServiceResponse.SerializeToString,
            ),
        }
        generic_handler = grpc.method_handlers_generic_handler(
            "OaasRegistry", rpc_method_handlers
        )
        server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def register_service(
        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,
            "/OaasRegistry/register_service",
            registry__pb2.OaasServiceDefinition.SerializeToString,
            registry__pb2.OaasServiceDefinition.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def resolve_service(
        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,
            "/OaasRegistry/resolve_service",
            registry__pb2.OaasServiceDefinition.SerializeToString,
            registry__pb2.OaasResolveServiceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def unregister_service(
        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,
            "/OaasRegistry/unregister_service",
            registry__pb2.OaasServiceId.SerializeToString,
            registry__pb2.OaasUnregisterServiceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
