# 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 gswarm.profiler import profiler_pb2 as profiler__pb2

GRPC_GENERATED_VERSION = '1.70.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 profiler_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 ProfilerServiceStub(object):
    """Service definition
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Connect = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/Connect',
                request_serializer=profiler__pb2.InitialInfo.SerializeToString,
                response_deserializer=profiler__pb2.ConnectResponse.FromString,
                _registered_method=True)
        self.StreamMetrics = channel.stream_unary(
                '/gswarm_profiler.ProfilerService/StreamMetrics',
                request_serializer=profiler__pb2.MetricsUpdate.SerializeToString,
                response_deserializer=profiler__pb2.Empty.FromString,
                _registered_method=True)
        self.GetStatus = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/GetStatus',
                request_serializer=profiler__pb2.Empty.SerializeToString,
                response_deserializer=profiler__pb2.StatusResponse.FromString,
                _registered_method=True)
        self.StartProfiling = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/StartProfiling',
                request_serializer=profiler__pb2.StartProfilingRequest.SerializeToString,
                response_deserializer=profiler__pb2.StartProfilingResponse.FromString,
                _registered_method=True)
        self.StopProfiling = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/StopProfiling',
                request_serializer=profiler__pb2.StopProfilingRequest.SerializeToString,
                response_deserializer=profiler__pb2.StopProfilingResponse.FromString,
                _registered_method=True)
        self.Exit = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/Exit',
                request_serializer=profiler__pb2.Empty.SerializeToString,
                response_deserializer=profiler__pb2.Empty.FromString,
                _registered_method=True)
        self.ReadClusterStatus = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/ReadClusterStatus',
                request_serializer=profiler__pb2.ReadClusterStatusRequest.SerializeToString,
                response_deserializer=profiler__pb2.ClusterStatusResponse.FromString,
                _registered_method=True)
        self.ReadNodeStatus = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/ReadNodeStatus',
                request_serializer=profiler__pb2.ReadNodeStatusRequest.SerializeToString,
                response_deserializer=profiler__pb2.NodeStatusResponse.FromString,
                _registered_method=True)
        self.SetBandwidthProfiling = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/SetBandwidthProfiling',
                request_serializer=profiler__pb2.SetBandwidthProfilingRequest.SerializeToString,
                response_deserializer=profiler__pb2.SetBandwidthProfilingResponse.FromString,
                _registered_method=True)
        self.SetNVLinkProfiling = channel.unary_unary(
                '/gswarm_profiler.ProfilerService/SetNVLinkProfiling',
                request_serializer=profiler__pb2.SetNVLinkProfilingRequest.SerializeToString,
                response_deserializer=profiler__pb2.SetNVLinkProfilingResponse.FromString,
                _registered_method=True)


class ProfilerServiceServicer(object):
    """Service definition
    """

    def Connect(self, request, context):
        """Client connects and sends initial info, then streams metrics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamMetrics(self, request_iterator, context):
        """Client streams metrics to head node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStatus(self, request, context):
        """Head node control endpoints
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StartProfiling(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 StopProfiling(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 Exit(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 ReadClusterStatus(self, request, context):
        """Missing service methods
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadNodeStatus(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 SetBandwidthProfiling(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 SetNVLinkProfiling(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_ProfilerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Connect': grpc.unary_unary_rpc_method_handler(
                    servicer.Connect,
                    request_deserializer=profiler__pb2.InitialInfo.FromString,
                    response_serializer=profiler__pb2.ConnectResponse.SerializeToString,
            ),
            'StreamMetrics': grpc.stream_unary_rpc_method_handler(
                    servicer.StreamMetrics,
                    request_deserializer=profiler__pb2.MetricsUpdate.FromString,
                    response_serializer=profiler__pb2.Empty.SerializeToString,
            ),
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=profiler__pb2.Empty.FromString,
                    response_serializer=profiler__pb2.StatusResponse.SerializeToString,
            ),
            'StartProfiling': grpc.unary_unary_rpc_method_handler(
                    servicer.StartProfiling,
                    request_deserializer=profiler__pb2.StartProfilingRequest.FromString,
                    response_serializer=profiler__pb2.StartProfilingResponse.SerializeToString,
            ),
            'StopProfiling': grpc.unary_unary_rpc_method_handler(
                    servicer.StopProfiling,
                    request_deserializer=profiler__pb2.StopProfilingRequest.FromString,
                    response_serializer=profiler__pb2.StopProfilingResponse.SerializeToString,
            ),
            'Exit': grpc.unary_unary_rpc_method_handler(
                    servicer.Exit,
                    request_deserializer=profiler__pb2.Empty.FromString,
                    response_serializer=profiler__pb2.Empty.SerializeToString,
            ),
            'ReadClusterStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadClusterStatus,
                    request_deserializer=profiler__pb2.ReadClusterStatusRequest.FromString,
                    response_serializer=profiler__pb2.ClusterStatusResponse.SerializeToString,
            ),
            'ReadNodeStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadNodeStatus,
                    request_deserializer=profiler__pb2.ReadNodeStatusRequest.FromString,
                    response_serializer=profiler__pb2.NodeStatusResponse.SerializeToString,
            ),
            'SetBandwidthProfiling': grpc.unary_unary_rpc_method_handler(
                    servicer.SetBandwidthProfiling,
                    request_deserializer=profiler__pb2.SetBandwidthProfilingRequest.FromString,
                    response_serializer=profiler__pb2.SetBandwidthProfilingResponse.SerializeToString,
            ),
            'SetNVLinkProfiling': grpc.unary_unary_rpc_method_handler(
                    servicer.SetNVLinkProfiling,
                    request_deserializer=profiler__pb2.SetNVLinkProfilingRequest.FromString,
                    response_serializer=profiler__pb2.SetNVLinkProfilingResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'gswarm_profiler.ProfilerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('gswarm_profiler.ProfilerService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ProfilerService(object):
    """Service definition
    """

    @staticmethod
    def Connect(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,
            '/gswarm_profiler.ProfilerService/Connect',
            profiler__pb2.InitialInfo.SerializeToString,
            profiler__pb2.ConnectResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamMetrics(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/gswarm_profiler.ProfilerService/StreamMetrics',
            profiler__pb2.MetricsUpdate.SerializeToString,
            profiler__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStatus(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,
            '/gswarm_profiler.ProfilerService/GetStatus',
            profiler__pb2.Empty.SerializeToString,
            profiler__pb2.StatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StartProfiling(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,
            '/gswarm_profiler.ProfilerService/StartProfiling',
            profiler__pb2.StartProfilingRequest.SerializeToString,
            profiler__pb2.StartProfilingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StopProfiling(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,
            '/gswarm_profiler.ProfilerService/StopProfiling',
            profiler__pb2.StopProfilingRequest.SerializeToString,
            profiler__pb2.StopProfilingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Exit(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,
            '/gswarm_profiler.ProfilerService/Exit',
            profiler__pb2.Empty.SerializeToString,
            profiler__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadClusterStatus(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,
            '/gswarm_profiler.ProfilerService/ReadClusterStatus',
            profiler__pb2.ReadClusterStatusRequest.SerializeToString,
            profiler__pb2.ClusterStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadNodeStatus(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,
            '/gswarm_profiler.ProfilerService/ReadNodeStatus',
            profiler__pb2.ReadNodeStatusRequest.SerializeToString,
            profiler__pb2.NodeStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetBandwidthProfiling(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,
            '/gswarm_profiler.ProfilerService/SetBandwidthProfiling',
            profiler__pb2.SetBandwidthProfilingRequest.SerializeToString,
            profiler__pb2.SetBandwidthProfilingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetNVLinkProfiling(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,
            '/gswarm_profiler.ProfilerService/SetNVLinkProfiling',
            profiler__pb2.SetNVLinkProfilingRequest.SerializeToString,
            profiler__pb2.SetNVLinkProfilingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
