# 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 yeying.api.audit import audit_pb2 as yeying_dot_api_dot_audit_dot_audit__pb2

GRPC_GENERATED_VERSION = "1.68.1"
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},"
        + f" but the generated code in yeying/api/audit/audit_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 AuditStub(object):
    """*
    审批服务
    发起应用访问申请->
    查看审批详情->
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Create = channel.unary_unary(
            "/yeying.api.audit.Audit/Create",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateResponse.FromString,
            _registered_method=True,
        )
        self.Detail = channel.unary_unary(
            "/yeying.api.audit.Audit/Detail",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.DetailRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.DetailResponse.FromString,
            _registered_method=True,
        )
        self.Cancel = channel.unary_unary(
            "/yeying.api.audit.Audit/Cancel",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CancelRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CancelResponse.FromString,
            _registered_method=True,
        )
        self.Unbind = channel.unary_unary(
            "/yeying.api.audit.Audit/Unbind",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.UnbindRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.UnbindResponse.FromString,
            _registered_method=True,
        )
        self.Audit = channel.unary_unary(
            "/yeying.api.audit.Audit/Audit",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditResponse.FromString,
            _registered_method=True,
        )
        self.CreateList = channel.unary_unary(
            "/yeying.api.audit.Audit/CreateList",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListResponse.FromString,
            _registered_method=True,
        )
        self.AuditList = channel.unary_unary(
            "/yeying.api.audit.Audit/AuditList",
            request_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditListRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditListResponse.FromString,
            _registered_method=True,
        )


class AuditServicer(object):
    """*
    审批服务
    发起应用访问申请->
    查看审批详情->
    """

    def Create(self, request, context):
        """发起申请"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Detail(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 Unbind(self, request, context):
        """解绑应用-移除申请成功的应用，不需要访问了"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Audit(self, request, context):
        """审批-通过/拒绝"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateList(self, request, context):
        """发起人申请列表"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def AuditList(self, request, context):
        """审批人审批列表"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_AuditServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Create": grpc.unary_unary_rpc_method_handler(
            servicer.Create,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateResponse.SerializeToString,
        ),
        "Detail": grpc.unary_unary_rpc_method_handler(
            servicer.Detail,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.DetailRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.DetailResponse.SerializeToString,
        ),
        "Cancel": grpc.unary_unary_rpc_method_handler(
            servicer.Cancel,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CancelRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CancelResponse.SerializeToString,
        ),
        "Unbind": grpc.unary_unary_rpc_method_handler(
            servicer.Unbind,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.UnbindRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.UnbindResponse.SerializeToString,
        ),
        "Audit": grpc.unary_unary_rpc_method_handler(
            servicer.Audit,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditResponse.SerializeToString,
        ),
        "CreateList": grpc.unary_unary_rpc_method_handler(
            servicer.CreateList,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListResponse.SerializeToString,
        ),
        "AuditList": grpc.unary_unary_rpc_method_handler(
            servicer.AuditList,
            request_deserializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditListRequest.FromString,
            response_serializer=yeying_dot_api_dot_audit_dot_audit__pb2.AuditListResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("yeying.api.audit.Audit", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("yeying.api.audit.Audit", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class Audit(object):
    """*
    审批服务
    发起应用访问申请->
    查看审批详情->
    """

    @staticmethod
    def Create(
        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,
            "/yeying.api.audit.Audit/Create",
            yeying_dot_api_dot_audit_dot_audit__pb2.CreateRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.CreateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Detail(
        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,
            "/yeying.api.audit.Audit/Detail",
            yeying_dot_api_dot_audit_dot_audit__pb2.DetailRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.DetailResponse.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,
            "/yeying.api.audit.Audit/Cancel",
            yeying_dot_api_dot_audit_dot_audit__pb2.CancelRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.CancelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Unbind(
        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,
            "/yeying.api.audit.Audit/Unbind",
            yeying_dot_api_dot_audit_dot_audit__pb2.UnbindRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.UnbindResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Audit(
        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,
            "/yeying.api.audit.Audit/Audit",
            yeying_dot_api_dot_audit_dot_audit__pb2.AuditRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.AuditResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def CreateList(
        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,
            "/yeying.api.audit.Audit/CreateList",
            yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.CreateAuditListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def AuditList(
        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,
            "/yeying.api.audit.Audit/AuditList",
            yeying_dot_api_dot_audit_dot_audit__pb2.AuditListRequest.SerializeToString,
            yeying_dot_api_dot_audit_dot_audit__pb2.AuditListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
