# 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.runs import run_pb2 as yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2
from yandex.cloud.ai.assistants.v1.runs import run_service_pb2 as yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2


class RunServiceStub(object):
    """RunService provides operations for managing runs.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Create = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.runs.RunService/Create',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.CreateRunRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.FromString,
                )
        self.Listen = channel.unary_stream(
                '/yandex.cloud.ai.assistants.v1.runs.RunService/Listen',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListenRunRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.StreamEvent.FromString,
                )
        self.Get = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.runs.RunService/Get',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetRunRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.FromString,
                )
        self.GetLastByThread = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.runs.RunService/GetLastByThread',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetLastRunByThreadRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.FromString,
                )
        self.List = channel.unary_unary(
                '/yandex.cloud.ai.assistants.v1.runs.RunService/List',
                request_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsResponse.FromString,
                )


class RunServiceServicer(object):
    """RunService provides operations for managing runs.
    """

    def Create(self, request, context):
        """Create a new run for a given assistant and thread.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Listen(self, request, context):
        """Listen to events from a specific run.
        If the run was created with `stream = false`, Listen will only respond with the final status of the run
        and will not stream partial messages or intermediate events.
        """
        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 run by its ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLastByThread(self, request, context):
        """Retrieves the most recent run for a specific thread.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """List runs in a specific folder.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_RunServiceServicer_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_runs_dot_run__service__pb2.CreateRunRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.SerializeToString,
            ),
            'Listen': grpc.unary_stream_rpc_method_handler(
                    servicer.Listen,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListenRunRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.StreamEvent.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetRunRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.SerializeToString,
            ),
            'GetLastByThread': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLastByThread,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetLastRunByThreadRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.ai.assistants.v1.runs.RunService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @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.runs.RunService/Create',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.CreateRunRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Listen(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.runs.RunService/Listen',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListenRunRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.StreamEvent.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.runs.RunService/Get',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetRunRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetLastByThread(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.runs.RunService/GetLastByThread',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.GetLastRunByThreadRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__pb2.Run.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_unary(request, target, '/yandex.cloud.ai.assistants.v1.runs.RunService/List',
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsRequest.SerializeToString,
            yandex_dot_cloud_dot_ai_dot_assistants_dot_v1_dot_runs_dot_run__service__pb2.ListRunsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
