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

from voltha_protos import extensions_pb2 as voltha__protos_dot_extensions__pb2


class ExtensionStub(object):
    """Extension is a service to get and set specific attributes
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetExtValue = channel.unary_unary(
                '/extension.Extension/GetExtValue',
                request_serializer=voltha__protos_dot_extensions__pb2.SingleGetValueRequest.SerializeToString,
                response_deserializer=voltha__protos_dot_extensions__pb2.SingleGetValueResponse.FromString,
                )
        self.SetExtValue = channel.unary_unary(
                '/extension.Extension/SetExtValue',
                request_serializer=voltha__protos_dot_extensions__pb2.SingleSetValueRequest.SerializeToString,
                response_deserializer=voltha__protos_dot_extensions__pb2.SingleSetValueResponse.FromString,
                )


class ExtensionServicer(object):
    """Extension is a service to get and set specific attributes
    """

    def GetExtValue(self, request, context):
        """Get a single attribute
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetExtValue(self, request, context):
        """Set a single attribute
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ExtensionServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetExtValue': grpc.unary_unary_rpc_method_handler(
                    servicer.GetExtValue,
                    request_deserializer=voltha__protos_dot_extensions__pb2.SingleGetValueRequest.FromString,
                    response_serializer=voltha__protos_dot_extensions__pb2.SingleGetValueResponse.SerializeToString,
            ),
            'SetExtValue': grpc.unary_unary_rpc_method_handler(
                    servicer.SetExtValue,
                    request_deserializer=voltha__protos_dot_extensions__pb2.SingleSetValueRequest.FromString,
                    response_serializer=voltha__protos_dot_extensions__pb2.SingleSetValueResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'extension.Extension', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Extension(object):
    """Extension is a service to get and set specific attributes
    """

    @staticmethod
    def GetExtValue(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, '/extension.Extension/GetExtValue',
            voltha__protos_dot_extensions__pb2.SingleGetValueRequest.SerializeToString,
            voltha__protos_dot_extensions__pb2.SingleGetValueResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetExtValue(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, '/extension.Extension/SetExtValue',
            voltha__protos_dot_extensions__pb2.SingleSetValueRequest.SerializeToString,
            voltha__protos_dot_extensions__pb2.SingleSetValueResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
