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

from sync.v1 import sync_service_pb2 as sync_dot_v1_dot_sync__service__pb2


class FlagSyncServiceStub(object):
    """FlagService implements a server streaming to provide realtime flag configurations
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SyncFlags = channel.unary_stream(
                '/sync.v1.FlagSyncService/SyncFlags',
                request_serializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.SerializeToString,
                response_deserializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.FromString,
                )
        self.FetchAllFlags = channel.unary_unary(
                '/sync.v1.FlagSyncService/FetchAllFlags',
                request_serializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.SerializeToString,
                response_deserializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.FromString,
                )


class FlagSyncServiceServicer(object):
    """FlagService implements a server streaming to provide realtime flag configurations
    """

    def SyncFlags(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 FetchAllFlags(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 add_FlagSyncServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SyncFlags': grpc.unary_stream_rpc_method_handler(
                    servicer.SyncFlags,
                    request_deserializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.FromString,
                    response_serializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.SerializeToString,
            ),
            'FetchAllFlags': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchAllFlags,
                    request_deserializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.FromString,
                    response_serializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'sync.v1.FlagSyncService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class FlagSyncService(object):
    """FlagService implements a server streaming to provide realtime flag configurations
    """

    @staticmethod
    def SyncFlags(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, '/sync.v1.FlagSyncService/SyncFlags',
            sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.SerializeToString,
            sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FetchAllFlags(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, '/sync.v1.FlagSyncService/FetchAllFlags',
            sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.SerializeToString,
            sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
