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

from trojan_gprc_api import api_pb2 as api__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetTraffic = channel.unary_unary(
                '/trojan.api.TrojanClientService/GetTraffic',
                request_serializer=api__pb2.GetTrafficRequest.SerializeToString,
                response_deserializer=api__pb2.GetTrafficResponse.FromString,
                )


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

    def GetTraffic(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_TrojanClientServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetTraffic': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTraffic,
                    request_deserializer=api__pb2.GetTrafficRequest.FromString,
                    response_serializer=api__pb2.GetTrafficResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'trojan.api.TrojanClientService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetTraffic(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/trojan.api.TrojanClientService/GetTraffic',
            api__pb2.GetTrafficRequest.SerializeToString,
            api__pb2.GetTrafficResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListUsers = channel.unary_stream(
                '/trojan.api.TrojanServerService/ListUsers',
                request_serializer=api__pb2.ListUsersRequest.SerializeToString,
                response_deserializer=api__pb2.ListUsersResponse.FromString,
                )
        self.GetUsers = channel.stream_stream(
                '/trojan.api.TrojanServerService/GetUsers',
                request_serializer=api__pb2.GetUsersRequest.SerializeToString,
                response_deserializer=api__pb2.GetUsersResponse.FromString,
                )
        self.SetUsers = channel.stream_stream(
                '/trojan.api.TrojanServerService/SetUsers',
                request_serializer=api__pb2.SetUsersRequest.SerializeToString,
                response_deserializer=api__pb2.SetUsersResponse.FromString,
                )


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

    def ListUsers(self, request, context):
        """list all users
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetUsers(self, request_iterator, context):
        """obtain specified user's info
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetUsers(self, request_iterator, context):
        """setup existing users' config
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TrojanServerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListUsers': grpc.unary_stream_rpc_method_handler(
                    servicer.ListUsers,
                    request_deserializer=api__pb2.ListUsersRequest.FromString,
                    response_serializer=api__pb2.ListUsersResponse.SerializeToString,
            ),
            'GetUsers': grpc.stream_stream_rpc_method_handler(
                    servicer.GetUsers,
                    request_deserializer=api__pb2.GetUsersRequest.FromString,
                    response_serializer=api__pb2.GetUsersResponse.SerializeToString,
            ),
            'SetUsers': grpc.stream_stream_rpc_method_handler(
                    servicer.SetUsers,
                    request_deserializer=api__pb2.SetUsersRequest.FromString,
                    response_serializer=api__pb2.SetUsersResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'trojan.api.TrojanServerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ListUsers(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/trojan.api.TrojanServerService/ListUsers',
            api__pb2.ListUsersRequest.SerializeToString,
            api__pb2.ListUsersResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetUsers(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/trojan.api.TrojanServerService/GetUsers',
            api__pb2.GetUsersRequest.SerializeToString,
            api__pb2.GetUsersResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetUsers(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/trojan.api.TrojanServerService/SetUsers',
            api__pb2.SetUsersRequest.SerializeToString,
            api__pb2.SetUsersResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)
