# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: servicebridge.proto
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from service_bridge.pb import servicebridge_pb2 as servicebridge__pb2

GRPC_GENERATED_VERSION = '1.68.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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        ' but the generated code in servicebridge_pb2_grpc.py depends on'
        f' grpcio>={GRPC_GENERATED_VERSION}.'
        ' Please upgrade your grpc module to grpcio>=' + GRPC_GENERATED_VERSION
        + ' or downgrade your generated code using grpcio-tools<=' + GRPC_VERSION,
        RuntimeWarning
    )


class ServiceBridgeStub(object):
    """ServiceBridge stub."""

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

Args:
    channel: A grpc.Channel.
"""
        self.RegisterFunction = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterFunction',
                request_serializer=servicebridge__pb2.RegisterFunctionRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterFunctionResponse.FromString,
                )
        self.RegisterConsumerGroup = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterConsumerGroup',
                request_serializer=servicebridge__pb2.RegisterConsumerGroupRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterConsumerGroupResponse.FromString,
                )
        self.RegisterGroupMember = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterGroupMember',
                request_serializer=servicebridge__pb2.RegisterGroupMemberRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterGroupMemberResponse.FromString,
                )
        self.Heartbeat = channel.unary_unary(
                '/servicebridge.ServiceBridge/Heartbeat',
                request_serializer=servicebridge__pb2.HeartbeatRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.HeartbeatResponse.FromString,
                )
        self.RegisterHttpEndpoint = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterHttpEndpoint',
                request_serializer=servicebridge__pb2.RegisterHttpEndpointRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterHttpEndpointResponse.FromString,
                )
        self.HeartbeatHttpEndpoint = channel.unary_unary(
                '/servicebridge.ServiceBridge/HeartbeatHttpEndpoint',
                request_serializer=servicebridge__pb2.HeartbeatHttpEndpointRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.HeartbeatHttpEndpointResponse.FromString,
                )
        self.ProvisionWorkerCertificate = channel.unary_unary(
                '/servicebridge.ServiceBridge/ProvisionWorkerCertificate',
                request_serializer=servicebridge__pb2.ProvisionWorkerCertificateRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.ProvisionWorkerCertificateResponse.FromString,
                )
        self.OpenWorkerSession = channel.stream_stream(
                '/servicebridge.ServiceBridge/OpenWorkerSession',
                request_serializer=servicebridge__pb2.WorkerSessionRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.WorkerSessionResponse.FromString,
                )
        self.RegisterWorkflow = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterWorkflow',
                request_serializer=servicebridge__pb2.RegisterWorkflowRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterWorkflowResponse.FromString,
                )
        self.ExecuteWorkflow = channel.unary_unary(
                '/servicebridge.ServiceBridge/ExecuteWorkflow',
                request_serializer=servicebridge__pb2.RunWorkflowRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RunWorkflowResponse.FromString,
                )
        self.CancelWorkflow = channel.unary_unary(
                '/servicebridge.ServiceBridge/CancelWorkflow',
                request_serializer=servicebridge__pb2.CancelWorkflowRunRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.CancelWorkflowRunResponse.FromString,
                )
        self.RegisterJob = channel.unary_unary(
                '/servicebridge.ServiceBridge/RegisterJob',
                request_serializer=servicebridge__pb2.RegisterJobRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegisterJobResponse.FromString,
                )
        self.WatchRegistry = channel.unary_stream(
                '/servicebridge.ServiceBridge/WatchRegistry',
                request_serializer=servicebridge__pb2.WatchRegistryRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RegistryMessage.FromString,
                )
        self.LookupFunction = channel.unary_unary(
                '/servicebridge.ServiceBridge/LookupFunction',
                request_serializer=servicebridge__pb2.LookupFunctionRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.LookupFunctionResponse.FromString,
                )
        self.ReportCallStart = channel.unary_unary(
                '/servicebridge.ServiceBridge/ReportCallStart',
                request_serializer=servicebridge__pb2.ReportCallStartRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.ReportCallResponse.FromString,
                )
        self.ReportCall = channel.unary_unary(
                '/servicebridge.ServiceBridge/ReportCall',
                request_serializer=servicebridge__pb2.ReportCallRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.ReportCallResponse.FromString,
                )
        self.ReportLog = channel.unary_unary(
                '/servicebridge.ServiceBridge/ReportLog',
                request_serializer=servicebridge__pb2.ReportLogRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.ReportLogResponse.FromString,
                )
        self.Publish = channel.unary_unary(
                '/servicebridge.ServiceBridge/Publish',
                request_serializer=servicebridge__pb2.PublishRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.PublishResponse.FromString,
                )
        self.AppendStream = channel.unary_unary(
                '/servicebridge.ServiceBridge/AppendStream',
                request_serializer=servicebridge__pb2.AppendStreamRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.AppendStreamResponse.FromString,
                )
        self.WatchTrace = channel.unary_stream(
                '/servicebridge.ServiceBridge/WatchTrace',
                request_serializer=servicebridge__pb2.WatchRunRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.RunStreamChunk.FromString,
                )


class ServiceBridgeServicer(object):
    """ServiceBridge servicer."""
    pass


def add_ServiceBridgeServicer_to_server(servicer, server):
    pass


class ServiceBridgeWorkerStub(object):
    """ServiceBridgeWorker stub."""

    def __init__(self, channel):
        self.Handle = channel.unary_unary(
                '/servicebridge.ServiceBridgeWorker/Handle',
                request_serializer=servicebridge__pb2.HandleRequest.SerializeToString,
                response_deserializer=servicebridge__pb2.HandleResponse.FromString,
                )


class ServiceBridgeWorkerServicer(object):
    """ServiceBridgeWorker servicer."""

    def Handle(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServiceBridgeWorkerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Handle': grpc.unary_unary_rpc_method_handler(
            servicer.Handle,
            request_deserializer=servicebridge__pb2.HandleRequest.FromString,
            response_serializer=servicebridge__pb2.HandleResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_service_handler(
        'servicebridge.ServiceBridgeWorker', rpc_method_handlers
    ) if hasattr(grpc, 'method_service_handler') else None
    if generic_handler is not None:
        server.add_generic_rpc_handlers((generic_handler,))
    else:
        server.add_registered_method_handlers('servicebridge.ServiceBridgeWorker', rpc_method_handlers)
