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

from lekko_client.gen.lekko.backend.v1beta1 import distribution_service_pb2 as lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2


class DistributionServiceStub(object):
    """Initial implementation of a config distribution service. Clients should begin by
    calling the register RPC which returns a session key, which is used in all other RPCs.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetRepositoryVersion = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/GetRepositoryVersion',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionResponse.FromString,
                )
        self.GetRepositoryContents = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/GetRepositoryContents',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsResponse.FromString,
                )
        self.SendFlagEvaluationMetrics = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/SendFlagEvaluationMetrics',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsResponse.FromString,
                )
        self.RegisterClient = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/RegisterClient',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientResponse.FromString,
                )
        self.DeregisterClient = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/DeregisterClient',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientResponse.FromString,
                )
        self.GetDeveloperAccessToken = channel.unary_unary(
                '/lekko.backend.v1beta1.DistributionService/GetDeveloperAccessToken',
                request_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenRequest.SerializeToString,
                response_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenResponse.FromString,
                )


class DistributionServiceServicer(object):
    """Initial implementation of a config distribution service. Clients should begin by
    calling the register RPC which returns a session key, which is used in all other RPCs.
    """

    def GetRepositoryVersion(self, request, context):
        """Returns the latest commit sha of the repository. The client is expected to poll this
        rpc to become aware of updates.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRepositoryContents(self, request, context):
        """Returns the entire state of the repository, including all feature flags.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendFlagEvaluationMetrics(self, request, context):
        """Sends metrics to the backend related to flag evaluation. This rpc can be used
        to batch metrics to lekko servers.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterClient(self, request, context):
        """Registers a client and returns a session key.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeregisterClient(self, request, context):
        """Deregisters a client using a session key.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDeveloperAccessToken(self, request, context):
        """Returns a github access token that provides access to the contents of
        some of Lekko's private repositories
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DistributionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetRepositoryVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRepositoryVersion,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionResponse.SerializeToString,
            ),
            'GetRepositoryContents': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRepositoryContents,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsResponse.SerializeToString,
            ),
            'SendFlagEvaluationMetrics': grpc.unary_unary_rpc_method_handler(
                    servicer.SendFlagEvaluationMetrics,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsResponse.SerializeToString,
            ),
            'RegisterClient': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterClient,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientResponse.SerializeToString,
            ),
            'DeregisterClient': grpc.unary_unary_rpc_method_handler(
                    servicer.DeregisterClient,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientResponse.SerializeToString,
            ),
            'GetDeveloperAccessToken': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDeveloperAccessToken,
                    request_deserializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenRequest.FromString,
                    response_serializer=lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'lekko.backend.v1beta1.DistributionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DistributionService(object):
    """Initial implementation of a config distribution service. Clients should begin by
    calling the register RPC which returns a session key, which is used in all other RPCs.
    """

    @staticmethod
    def GetRepositoryVersion(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, '/lekko.backend.v1beta1.DistributionService/GetRepositoryVersion',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryVersionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetRepositoryContents(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, '/lekko.backend.v1beta1.DistributionService/GetRepositoryContents',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetRepositoryContentsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendFlagEvaluationMetrics(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, '/lekko.backend.v1beta1.DistributionService/SendFlagEvaluationMetrics',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.SendFlagEvaluationMetricsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RegisterClient(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, '/lekko.backend.v1beta1.DistributionService/RegisterClient',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.RegisterClientResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeregisterClient(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, '/lekko.backend.v1beta1.DistributionService/DeregisterClient',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.DeregisterClientResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDeveloperAccessToken(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, '/lekko.backend.v1beta1.DistributionService/GetDeveloperAccessToken',
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenRequest.SerializeToString,
            lekko_dot_backend_dot_v1beta1_dot_distribution__service__pb2.GetDeveloperAccessTokenResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
