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

from yandex.cloud.ai.assistants.v1.threads import message_pb2 as yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2
from yandex.cloud.ai.assistants.v1.threads import message_service_pb2 as yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2


class MessageServiceStub(object):
    """MessageService provides operations for managing messages.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Create = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.threads.MessageService/Create',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.CreateMessageRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
                )
        self.Get = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.threads.MessageService/Get',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.GetMessageRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
                )
        self.List = channel.unary_stream(
                '/yandex.cloud.ai.assistants.v1.threads.MessageService/List',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.ListMessagesRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
                )


class MessageServiceServicer(object):
    """MessageService provides operations for managing messages.
    """

    def Create(self, request, context):
        """Create a new message.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Get(self, request, context):
        """Retrieve details of a specific message by its ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """List messages in a specific thread.
        By default, messages are listed in reverse chronological order, i.e., from the newest to the oldest.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MessageServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.CreateMessageRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.GetMessageRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.SerializeToString,
            ),
            'List': grpc.unary_stream_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.ListMessagesRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.ai.assistants.v1.threads.MessageService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class MessageService(object):
    """MessageService provides operations for managing messages.
    """

    @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, '/yandex.cloud.ai.assistants.v1.threads.MessageService/Create',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.CreateMessageRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Get(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, '/yandex.cloud.ai.assistants.v1.threads.MessageService/Get',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.GetMessageRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def List(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, '/yandex.cloud.ai.assistants.v1.threads.MessageService/List',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__service__pb2.ListMessagesRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_threads_dot_message__pb2.Message.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
