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

import grpc
import warnings

from . import aduib_rpc_v2_pb2 as aduib__rpc__v2__pb2

GRPC_GENERATED_VERSION = "1.78.0"
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower

    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f"The grpc package installed is at version {GRPC_VERSION},"
        + " but the generated code in aduib_rpc_v2_pb2_grpc.py depends on"
        + f" grpcio>={GRPC_GENERATED_VERSION}."
        + f" Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}"
        + f" or downgrade your generated code using grpcio-tools<={GRPC_VERSION}."
    )


class AduibRpcServiceStub(object):
    """============================================================
    服务定义
    ============================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Call = channel.unary_unary(
            "/aduib.rpc.v2.AduibRpcService/Call",
            request_serializer=aduib__rpc__v2__pb2.Request.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.Response.FromString,
            _registered_method=True,
        )
        self.CallServerStream = channel.unary_stream(
            "/aduib.rpc.v2.AduibRpcService/CallServerStream",
            request_serializer=aduib__rpc__v2__pb2.Request.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.Response.FromString,
            _registered_method=True,
        )
        self.CallClientStream = channel.stream_unary(
            "/aduib.rpc.v2.AduibRpcService/CallClientStream",
            request_serializer=aduib__rpc__v2__pb2.Request.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.Response.FromString,
            _registered_method=True,
        )
        self.CallBidirectional = channel.stream_stream(
            "/aduib.rpc.v2.AduibRpcService/CallBidirectional",
            request_serializer=aduib__rpc__v2__pb2.Request.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.Response.FromString,
            _registered_method=True,
        )


class AduibRpcServiceServicer(object):
    """============================================================
    服务定义
    ============================================================

    """

    def Call(self, request, context):
        """一元调用"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CallServerStream(self, request, context):
        """服务端流式"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CallClientStream(self, request_iterator, context):
        """客户端流式"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CallBidirectional(self, request_iterator, context):
        """双向流式"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_AduibRpcServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Call": grpc.unary_unary_rpc_method_handler(
            servicer.Call,
            request_deserializer=aduib__rpc__v2__pb2.Request.FromString,
            response_serializer=aduib__rpc__v2__pb2.Response.SerializeToString,
        ),
        "CallServerStream": grpc.unary_stream_rpc_method_handler(
            servicer.CallServerStream,
            request_deserializer=aduib__rpc__v2__pb2.Request.FromString,
            response_serializer=aduib__rpc__v2__pb2.Response.SerializeToString,
        ),
        "CallClientStream": grpc.stream_unary_rpc_method_handler(
            servicer.CallClientStream,
            request_deserializer=aduib__rpc__v2__pb2.Request.FromString,
            response_serializer=aduib__rpc__v2__pb2.Response.SerializeToString,
        ),
        "CallBidirectional": grpc.stream_stream_rpc_method_handler(
            servicer.CallBidirectional,
            request_deserializer=aduib__rpc__v2__pb2.Request.FromString,
            response_serializer=aduib__rpc__v2__pb2.Response.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("aduib.rpc.v2.AduibRpcService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("aduib.rpc.v2.AduibRpcService", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class AduibRpcService(object):
    """============================================================
    服务定义
    ============================================================

    """

    @staticmethod
    def Call(
        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,
            "/aduib.rpc.v2.AduibRpcService/Call",
            aduib__rpc__v2__pb2.Request.SerializeToString,
            aduib__rpc__v2__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def CallServerStream(
        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,
            "/aduib.rpc.v2.AduibRpcService/CallServerStream",
            aduib__rpc__v2__pb2.Request.SerializeToString,
            aduib__rpc__v2__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def CallClientStream(
        request_iterator,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            "/aduib.rpc.v2.AduibRpcService/CallClientStream",
            aduib__rpc__v2__pb2.Request.SerializeToString,
            aduib__rpc__v2__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def CallBidirectional(
        request_iterator,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.stream_stream(
            request_iterator,
            target,
            "/aduib.rpc.v2.AduibRpcService/CallBidirectional",
            aduib__rpc__v2__pb2.Request.SerializeToString,
            aduib__rpc__v2__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Submit = channel.unary_unary(
            "/aduib.rpc.v2.TaskService/Submit",
            request_serializer=aduib__rpc__v2__pb2.TaskSubmitRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.TaskSubmitResponse.FromString,
            _registered_method=True,
        )
        self.Query = channel.unary_unary(
            "/aduib.rpc.v2.TaskService/Query",
            request_serializer=aduib__rpc__v2__pb2.TaskQueryRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.TaskQueryResponse.FromString,
            _registered_method=True,
        )
        self.Cancel = channel.unary_unary(
            "/aduib.rpc.v2.TaskService/Cancel",
            request_serializer=aduib__rpc__v2__pb2.TaskCancelRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.TaskCancelResponse.FromString,
            _registered_method=True,
        )
        self.Subscribe = channel.unary_stream(
            "/aduib.rpc.v2.TaskService/Subscribe",
            request_serializer=aduib__rpc__v2__pb2.TaskSubscribeRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.TaskEvent.FromString,
            _registered_method=True,
        )


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

    def Submit(self, request, context):
        """提交任务"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Query(self, request, context):
        """查询任务"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Cancel(self, request, context):
        """取消任务"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Subscribe(self, request, context):
        """订阅任务事件"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_TaskServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Submit": grpc.unary_unary_rpc_method_handler(
            servicer.Submit,
            request_deserializer=aduib__rpc__v2__pb2.TaskSubmitRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.TaskSubmitResponse.SerializeToString,
        ),
        "Query": grpc.unary_unary_rpc_method_handler(
            servicer.Query,
            request_deserializer=aduib__rpc__v2__pb2.TaskQueryRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.TaskQueryResponse.SerializeToString,
        ),
        "Cancel": grpc.unary_unary_rpc_method_handler(
            servicer.Cancel,
            request_deserializer=aduib__rpc__v2__pb2.TaskCancelRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.TaskCancelResponse.SerializeToString,
        ),
        "Subscribe": grpc.unary_stream_rpc_method_handler(
            servicer.Subscribe,
            request_deserializer=aduib__rpc__v2__pb2.TaskSubscribeRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.TaskEvent.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("aduib.rpc.v2.TaskService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("aduib.rpc.v2.TaskService", rpc_method_handlers)


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

    @staticmethod
    def Submit(
        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,
            "/aduib.rpc.v2.TaskService/Submit",
            aduib__rpc__v2__pb2.TaskSubmitRequest.SerializeToString,
            aduib__rpc__v2__pb2.TaskSubmitResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Query(
        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,
            "/aduib.rpc.v2.TaskService/Query",
            aduib__rpc__v2__pb2.TaskQueryRequest.SerializeToString,
            aduib__rpc__v2__pb2.TaskQueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Cancel(
        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,
            "/aduib.rpc.v2.TaskService/Cancel",
            aduib__rpc__v2__pb2.TaskCancelRequest.SerializeToString,
            aduib__rpc__v2__pb2.TaskCancelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Subscribe(
        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,
            "/aduib.rpc.v2.TaskService/Subscribe",
            aduib__rpc__v2__pb2.TaskSubscribeRequest.SerializeToString,
            aduib__rpc__v2__pb2.TaskEvent.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Check = channel.unary_unary(
            "/aduib.rpc.v2.HealthService/Check",
            request_serializer=aduib__rpc__v2__pb2.HealthCheckRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.HealthCheckResponse.FromString,
            _registered_method=True,
        )
        self.Watch = channel.unary_stream(
            "/aduib.rpc.v2.HealthService/Watch",
            request_serializer=aduib__rpc__v2__pb2.HealthCheckRequest.SerializeToString,
            response_deserializer=aduib__rpc__v2__pb2.HealthCheckResponse.FromString,
            _registered_method=True,
        )


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

    def Check(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 Watch(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_HealthServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Check": grpc.unary_unary_rpc_method_handler(
            servicer.Check,
            request_deserializer=aduib__rpc__v2__pb2.HealthCheckRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.HealthCheckResponse.SerializeToString,
        ),
        "Watch": grpc.unary_stream_rpc_method_handler(
            servicer.Watch,
            request_deserializer=aduib__rpc__v2__pb2.HealthCheckRequest.FromString,
            response_serializer=aduib__rpc__v2__pb2.HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("aduib.rpc.v2.HealthService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("aduib.rpc.v2.HealthService", rpc_method_handlers)


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

    @staticmethod
    def Check(
        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,
            "/aduib.rpc.v2.HealthService/Check",
            aduib__rpc__v2__pb2.HealthCheckRequest.SerializeToString,
            aduib__rpc__v2__pb2.HealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Watch(
        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,
            "/aduib.rpc.v2.HealthService/Watch",
            aduib__rpc__v2__pb2.HealthCheckRequest.SerializeToString,
            aduib__rpc__v2__pb2.HealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
