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

from bilireq.grpc.protos.bilibili.app.distribution.v1 import distribution_pb2 as bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2


class DistributionStub(object):
    """APP配置
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetUserPreference = channel.unary_unary(
                '/bilibili.app.distribution.v1.Distribution/GetUserPreference',
                request_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReq.SerializeToString,
                response_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReply.FromString,
                )
        self.SetUserPreference = channel.unary_unary(
                '/bilibili.app.distribution.v1.Distribution/SetUserPreference',
                request_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReq.SerializeToString,
                response_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReply.FromString,
                )
        self.UserPreference = channel.unary_unary(
                '/bilibili.app.distribution.v1.Distribution/UserPreference',
                request_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReq.SerializeToString,
                response_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReply.FromString,
                )


class DistributionServicer(object):
    """APP配置
    """

    def GetUserPreference(self, request, context):
        """获取云端储存的用户偏好
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetUserPreference(self, request, context):
        """设定用户偏好
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UserPreference(self, request, context):
        """获取云控配置
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DistributionServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetUserPreference': grpc.unary_unary_rpc_method_handler(
                    servicer.GetUserPreference,
                    request_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReq.FromString,
                    response_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReply.SerializeToString,
            ),
            'SetUserPreference': grpc.unary_unary_rpc_method_handler(
                    servicer.SetUserPreference,
                    request_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReq.FromString,
                    response_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReply.SerializeToString,
            ),
            'UserPreference': grpc.unary_unary_rpc_method_handler(
                    servicer.UserPreference,
                    request_deserializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReq.FromString,
                    response_serializer=bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'bilibili.app.distribution.v1.Distribution', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Distribution(object):
    """APP配置
    """

    @staticmethod
    def GetUserPreference(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, '/bilibili.app.distribution.v1.Distribution/GetUserPreference',
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReq.SerializeToString,
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.GetUserPreferenceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetUserPreference(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, '/bilibili.app.distribution.v1.Distribution/SetUserPreference',
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReq.SerializeToString,
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.SetUserPreferenceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UserPreference(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, '/bilibili.app.distribution.v1.Distribution/UserPreference',
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReq.SerializeToString,
            bilibili_dot_app_dot_distribution_dot_v1_dot_distribution__pb2.UserPreferenceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
