# 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 cp_public_pb2 as cp__public__pb2
from . import session_pb2 as session__pb2

GRPC_GENERATED_VERSION = '1.74.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},'
        + f' but the generated code in cp_public_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 PublicControlPlaneAPIStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListRegions = channel.unary_unary(
                '/rlmesh.v1.PublicControlPlaneAPI/ListRegions',
                request_serializer=cp__public__pb2.ListRegionsReq.SerializeToString,
                response_deserializer=cp__public__pb2.ListRegionsRes.FromString,
                _registered_method=True)
        self.ListEnvironments = channel.unary_unary(
                '/rlmesh.v1.PublicControlPlaneAPI/ListEnvironments',
                request_serializer=cp__public__pb2.ListEnvironmentsReq.SerializeToString,
                response_deserializer=cp__public__pb2.ListEnvironmentsRes.FromString,
                _registered_method=True)
        self.CreateSession = channel.unary_unary(
                '/rlmesh.v1.PublicControlPlaneAPI/CreateSession',
                request_serializer=cp__public__pb2.CreateSessionReq.SerializeToString,
                response_deserializer=session__pb2.Session.FromString,
                _registered_method=True)
        self.DescribeSession = channel.unary_unary(
                '/rlmesh.v1.PublicControlPlaneAPI/DescribeSession',
                request_serializer=cp__public__pb2.DescribeReq.SerializeToString,
                response_deserializer=cp__public__pb2.DescribeRes.FromString,
                _registered_method=True)
        self.WatchSession = channel.unary_stream(
                '/rlmesh.v1.PublicControlPlaneAPI/WatchSession',
                request_serializer=cp__public__pb2.WatchReq.SerializeToString,
                response_deserializer=session__pb2.Session.FromString,
                _registered_method=True)
        self.GetResults = channel.unary_unary(
                '/rlmesh.v1.PublicControlPlaneAPI/GetResults',
                request_serializer=cp__public__pb2.GetResultsReq.SerializeToString,
                response_deserializer=cp__public__pb2.GetResultsRes.FromString,
                _registered_method=True)


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

    def ListRegions(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 ListEnvironments(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 CreateSession(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 DescribeSession(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 WatchSession(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 GetResults(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_PublicControlPlaneAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListRegions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListRegions,
                    request_deserializer=cp__public__pb2.ListRegionsReq.FromString,
                    response_serializer=cp__public__pb2.ListRegionsRes.SerializeToString,
            ),
            'ListEnvironments': grpc.unary_unary_rpc_method_handler(
                    servicer.ListEnvironments,
                    request_deserializer=cp__public__pb2.ListEnvironmentsReq.FromString,
                    response_serializer=cp__public__pb2.ListEnvironmentsRes.SerializeToString,
            ),
            'CreateSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateSession,
                    request_deserializer=cp__public__pb2.CreateSessionReq.FromString,
                    response_serializer=session__pb2.Session.SerializeToString,
            ),
            'DescribeSession': grpc.unary_unary_rpc_method_handler(
                    servicer.DescribeSession,
                    request_deserializer=cp__public__pb2.DescribeReq.FromString,
                    response_serializer=cp__public__pb2.DescribeRes.SerializeToString,
            ),
            'WatchSession': grpc.unary_stream_rpc_method_handler(
                    servicer.WatchSession,
                    request_deserializer=cp__public__pb2.WatchReq.FromString,
                    response_serializer=session__pb2.Session.SerializeToString,
            ),
            'GetResults': grpc.unary_unary_rpc_method_handler(
                    servicer.GetResults,
                    request_deserializer=cp__public__pb2.GetResultsReq.FromString,
                    response_serializer=cp__public__pb2.GetResultsRes.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'rlmesh.v1.PublicControlPlaneAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('rlmesh.v1.PublicControlPlaneAPI', rpc_method_handlers)


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

    @staticmethod
    def ListRegions(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,
            '/rlmesh.v1.PublicControlPlaneAPI/ListRegions',
            cp__public__pb2.ListRegionsReq.SerializeToString,
            cp__public__pb2.ListRegionsRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListEnvironments(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,
            '/rlmesh.v1.PublicControlPlaneAPI/ListEnvironments',
            cp__public__pb2.ListEnvironmentsReq.SerializeToString,
            cp__public__pb2.ListEnvironmentsRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateSession(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,
            '/rlmesh.v1.PublicControlPlaneAPI/CreateSession',
            cp__public__pb2.CreateSessionReq.SerializeToString,
            session__pb2.Session.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DescribeSession(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,
            '/rlmesh.v1.PublicControlPlaneAPI/DescribeSession',
            cp__public__pb2.DescribeReq.SerializeToString,
            cp__public__pb2.DescribeRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WatchSession(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,
            '/rlmesh.v1.PublicControlPlaneAPI/WatchSession',
            cp__public__pb2.WatchReq.SerializeToString,
            session__pb2.Session.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetResults(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,
            '/rlmesh.v1.PublicControlPlaneAPI/GetResults',
            cp__public__pb2.GetResultsReq.SerializeToString,
            cp__public__pb2.GetResultsRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
