# 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.session import session_pb2 as yeying_dot_api_dot_session_dot_session__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/session/session_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 SessionStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Create = channel.unary_unary(
            "/yeying.api.session.Session/Create",
            request_serializer=yeying_dot_api_dot_session_dot_session__pb2.CreateSessionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_session_dot_session__pb2.CreateSessionResponse.FromString,
            _registered_method=True,
        )
        self.Delete = channel.unary_unary(
            "/yeying.api.session.Session/Delete",
            request_serializer=yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionResponse.FromString,
            _registered_method=True,
        )
        self.Detail = channel.unary_unary(
            "/yeying.api.session.Session/Detail",
            request_serializer=yeying_dot_api_dot_session_dot_session__pb2.SessionDetailRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_session_dot_session__pb2.SessionDetailResponse.FromString,
            _registered_method=True,
        )
        self.Search = channel.unary_unary(
            "/yeying.api.session.Session/Search",
            request_serializer=yeying_dot_api_dot_session_dot_session__pb2.SearchSessionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_session_dot_session__pb2.SearchSessionResponse.FromString,
            _registered_method=True,
        )
        self.Update = channel.unary_unary(
            "/yeying.api.session.Session/Update",
            request_serializer=yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionResponse.FromString,
            _registered_method=True,
        )


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

    def Create(self, request, context):
        """创建会话"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Delete(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 Search(self, request, context):
        """搜索会话"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Update(self, request, context):
        """更新会话"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_SessionServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Create": grpc.unary_unary_rpc_method_handler(
            servicer.Create,
            request_deserializer=yeying_dot_api_dot_session_dot_session__pb2.CreateSessionRequest.FromString,
            response_serializer=yeying_dot_api_dot_session_dot_session__pb2.CreateSessionResponse.SerializeToString,
        ),
        "Delete": grpc.unary_unary_rpc_method_handler(
            servicer.Delete,
            request_deserializer=yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionRequest.FromString,
            response_serializer=yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionResponse.SerializeToString,
        ),
        "Detail": grpc.unary_unary_rpc_method_handler(
            servicer.Detail,
            request_deserializer=yeying_dot_api_dot_session_dot_session__pb2.SessionDetailRequest.FromString,
            response_serializer=yeying_dot_api_dot_session_dot_session__pb2.SessionDetailResponse.SerializeToString,
        ),
        "Search": grpc.unary_unary_rpc_method_handler(
            servicer.Search,
            request_deserializer=yeying_dot_api_dot_session_dot_session__pb2.SearchSessionRequest.FromString,
            response_serializer=yeying_dot_api_dot_session_dot_session__pb2.SearchSessionResponse.SerializeToString,
        ),
        "Update": grpc.unary_unary_rpc_method_handler(
            servicer.Update,
            request_deserializer=yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionRequest.FromString,
            response_serializer=yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("yeying.api.session.Session", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("yeying.api.session.Session", rpc_method_handlers)


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

    @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.session.Session/Create",
            yeying_dot_api_dot_session_dot_session__pb2.CreateSessionRequest.SerializeToString,
            yeying_dot_api_dot_session_dot_session__pb2.CreateSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Delete(
        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.session.Session/Delete",
            yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionRequest.SerializeToString,
            yeying_dot_api_dot_session_dot_session__pb2.DeleteSessionResponse.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.session.Session/Detail",
            yeying_dot_api_dot_session_dot_session__pb2.SessionDetailRequest.SerializeToString,
            yeying_dot_api_dot_session_dot_session__pb2.SessionDetailResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Search(
        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.session.Session/Search",
            yeying_dot_api_dot_session_dot_session__pb2.SearchSessionRequest.SerializeToString,
            yeying_dot_api_dot_session_dot_session__pb2.SearchSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Update(
        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.session.Session/Update",
            yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionRequest.SerializeToString,
            yeying_dot_api_dot_session_dot_session__pb2.UpdateSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
