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

from . import Common_pb2 as Common__pb2
from . import LogNode_pb2 as LogNode__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartLog = channel.unary_unary(
                '/LogNode.LogNode/StartLog',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.GetLogInfo = channel.unary_unary(
                '/LogNode.LogNode/GetLogInfo',
                request_serializer=Common__pb2.empty.SerializeToString,
                response_deserializer=LogNode__pb2.log_info.FromString,
                )
        self.StopLog = channel.unary_unary(
                '/LogNode.LogNode/StopLog',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )


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

    def StartLog(self, request, context):
        """
        开始一个数据记录
        绝对路径
        result: 执行结果
        - 0: 成功
        - 1: 失败，文件格式不支持
        - 2: 失败，文件已经存在
        - 3: 失败, 创建文件失败
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLogInfo(self, request, context):
        """
        结束一个数据记录
        result: 执行结果
        - 0: 成功
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopLog(self, request, context):
        """
        停止一个数据记录任务
        result: 执行结果
        - 0: 结束成功
        - 1000: reise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LogNodeServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartLog': grpc.unary_unary_rpc_method_handler(
                    servicer.StartLog,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'GetLogInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLogInfo,
                    request_deserializer=Common__pb2.empty.FromString,
                    response_serializer=LogNode__pb2.log_info.SerializeToString,
            ),
            'StopLog': grpc.unary_unary_rpc_method_handler(
                    servicer.StopLog,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'LogNode.LogNode', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def StartLog(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, '/LogNode.LogNode/StartLog',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetLogInfo(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, '/LogNode.LogNode/GetLogInfo',
            Common__pb2.empty.SerializeToString,
            LogNode__pb2.log_info.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopLog(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, '/LogNode.LogNode/StopLog',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
