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

from kuksa.val.v1 import val_pb2 as kuksa_dot_val_dot_v1_dot_val__pb2


class VALStub(object):
    """Note on authorization:
    Tokens (auth-token or auth-uuid) are sent as (GRPC / http2) metadata.

    The auth-token is a JWT compliant token as the examples found here:
    https://github.com/eclipse/kuksa.val/tree/master/kuksa_certificates/jwt

    See also https://github.com/eclipse/kuksa.val/blob/master/doc/jwt.md

    Upon reception of auth-token, server shall generate an auth-uuid in metadata
    that the client can use instead of auth-token in subsequent calls.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/kuksa.val.v1.VAL/Get',
                request_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetRequest.SerializeToString,
                response_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetResponse.FromString,
                )
        self.Set = channel.unary_unary(
                '/kuksa.val.v1.VAL/Set',
                request_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.SetRequest.SerializeToString,
                response_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.SetResponse.FromString,
                )
        self.Subscribe = channel.unary_stream(
                '/kuksa.val.v1.VAL/Subscribe',
                request_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeRequest.SerializeToString,
                response_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeResponse.FromString,
                )
        self.GetServerInfo = channel.unary_unary(
                '/kuksa.val.v1.VAL/GetServerInfo',
                request_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoRequest.SerializeToString,
                response_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoResponse.FromString,
                )


class VALServicer(object):
    """Note on authorization:
    Tokens (auth-token or auth-uuid) are sent as (GRPC / http2) metadata.

    The auth-token is a JWT compliant token as the examples found here:
    https://github.com/eclipse/kuksa.val/tree/master/kuksa_certificates/jwt

    See also https://github.com/eclipse/kuksa.val/blob/master/doc/jwt.md

    Upon reception of auth-token, server shall generate an auth-uuid in metadata
    that the client can use instead of auth-token in subsequent calls.

    """

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

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

    def Subscribe(self, request, context):
        """Subscribe to a set of entries

        Returns a stream of notifications.

        InvalidArgument is returned if the request is malformed.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetServerInfo(self, request, context):
        """Shall return information that allows the client to determine
        what server/server implementation/version it is talking to
        eg. kuksa-databroker 0.5.1
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_VALServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetRequest.FromString,
                    response_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetResponse.SerializeToString,
            ),
            'Set': grpc.unary_unary_rpc_method_handler(
                    servicer.Set,
                    request_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.SetRequest.FromString,
                    response_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.SetResponse.SerializeToString,
            ),
            'Subscribe': grpc.unary_stream_rpc_method_handler(
                    servicer.Subscribe,
                    request_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeRequest.FromString,
                    response_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeResponse.SerializeToString,
            ),
            'GetServerInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetServerInfo,
                    request_deserializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoRequest.FromString,
                    response_serializer=kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'kuksa.val.v1.VAL', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class VAL(object):
    """Note on authorization:
    Tokens (auth-token or auth-uuid) are sent as (GRPC / http2) metadata.

    The auth-token is a JWT compliant token as the examples found here:
    https://github.com/eclipse/kuksa.val/tree/master/kuksa_certificates/jwt

    See also https://github.com/eclipse/kuksa.val/blob/master/doc/jwt.md

    Upon reception of auth-token, server shall generate an auth-uuid in metadata
    that the client can use instead of auth-token in subsequent calls.

    """

    @staticmethod
    def Get(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, '/kuksa.val.v1.VAL/Get',
            kuksa_dot_val_dot_v1_dot_val__pb2.GetRequest.SerializeToString,
            kuksa_dot_val_dot_v1_dot_val__pb2.GetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Set(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, '/kuksa.val.v1.VAL/Set',
            kuksa_dot_val_dot_v1_dot_val__pb2.SetRequest.SerializeToString,
            kuksa_dot_val_dot_v1_dot_val__pb2.SetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Subscribe(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, '/kuksa.val.v1.VAL/Subscribe',
            kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeRequest.SerializeToString,
            kuksa_dot_val_dot_v1_dot_val__pb2.SubscribeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetServerInfo(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, '/kuksa.val.v1.VAL/GetServerInfo',
            kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoRequest.SerializeToString,
            kuksa_dot_val_dot_v1_dot_val__pb2.GetServerInfoResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
