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

import tracing_pb2 as tracing__pb2

GRPC_GENERATED_VERSION = '1.71.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 tracing_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 TracingServiceStub(object):
    """Tracing Service - Manages distributed tracing and replay
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SaveSpan = channel.unary_unary(
                '/omium.tracing.v1.TracingService/SaveSpan',
                request_serializer=tracing__pb2.SaveSpanRequest.SerializeToString,
                response_deserializer=tracing__pb2.SaveSpanResponse.FromString,
                _registered_method=True)
        self.GetTrace = channel.unary_unary(
                '/omium.tracing.v1.TracingService/GetTrace',
                request_serializer=tracing__pb2.GetTraceRequest.SerializeToString,
                response_deserializer=tracing__pb2.GetTraceResponse.FromString,
                _registered_method=True)
        self.ListTraces = channel.unary_unary(
                '/omium.tracing.v1.TracingService/ListTraces',
                request_serializer=tracing__pb2.ListTracesRequest.SerializeToString,
                response_deserializer=tracing__pb2.ListTracesResponse.FromString,
                _registered_method=True)
        self.BuildDependencyGraph = channel.unary_unary(
                '/omium.tracing.v1.TracingService/BuildDependencyGraph',
                request_serializer=tracing__pb2.BuildDependencyGraphRequest.SerializeToString,
                response_deserializer=tracing__pb2.BuildDependencyGraphResponse.FromString,
                _registered_method=True)


class TracingServiceServicer(object):
    """Tracing Service - Manages distributed tracing and replay
    """

    def SaveSpan(self, request, context):
        """Save a trace span
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTrace(self, request, context):
        """Get a complete trace
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListTraces(self, request, context):
        """List traces for an execution
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BuildDependencyGraph(self, request, context):
        """Build dependency graph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TracingServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SaveSpan': grpc.unary_unary_rpc_method_handler(
                    servicer.SaveSpan,
                    request_deserializer=tracing__pb2.SaveSpanRequest.FromString,
                    response_serializer=tracing__pb2.SaveSpanResponse.SerializeToString,
            ),
            'GetTrace': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTrace,
                    request_deserializer=tracing__pb2.GetTraceRequest.FromString,
                    response_serializer=tracing__pb2.GetTraceResponse.SerializeToString,
            ),
            'ListTraces': grpc.unary_unary_rpc_method_handler(
                    servicer.ListTraces,
                    request_deserializer=tracing__pb2.ListTracesRequest.FromString,
                    response_serializer=tracing__pb2.ListTracesResponse.SerializeToString,
            ),
            'BuildDependencyGraph': grpc.unary_unary_rpc_method_handler(
                    servicer.BuildDependencyGraph,
                    request_deserializer=tracing__pb2.BuildDependencyGraphRequest.FromString,
                    response_serializer=tracing__pb2.BuildDependencyGraphResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'omium.tracing.v1.TracingService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('omium.tracing.v1.TracingService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class TracingService(object):
    """Tracing Service - Manages distributed tracing and replay
    """

    @staticmethod
    def SaveSpan(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,
            '/omium.tracing.v1.TracingService/SaveSpan',
            tracing__pb2.SaveSpanRequest.SerializeToString,
            tracing__pb2.SaveSpanResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTrace(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,
            '/omium.tracing.v1.TracingService/GetTrace',
            tracing__pb2.GetTraceRequest.SerializeToString,
            tracing__pb2.GetTraceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListTraces(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,
            '/omium.tracing.v1.TracingService/ListTraces',
            tracing__pb2.ListTracesRequest.SerializeToString,
            tracing__pb2.ListTracesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BuildDependencyGraph(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,
            '/omium.tracing.v1.TracingService/BuildDependencyGraph',
            tracing__pb2.BuildDependencyGraphRequest.SerializeToString,
            tracing__pb2.BuildDependencyGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
