# 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from insightproto.proto.results.v1 import results_pb2 as insightproto_dot_proto_dot_results_dot_v1_dot_results__pb2
from insightproto.proto.results.v1 import updates_pb2 as insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2

GRPC_GENERATED_VERSION = '1.71.2'
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 insightproto/proto/results/v1/updates_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 UpdateServiceStub(object):
    """UpdateService provides a gRPC service for streaming real-time updates
    during investigation processing.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.StreamUpdates = channel.stream_unary(
                '/insightproto.proto.results.v1.UpdateService/StreamUpdates',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.UpdateRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Thinking = channel.unary_unary(
                '/insightproto.proto.results.v1.UpdateService/Thinking',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Thought.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Phase1UpdateResult = channel.unary_unary(
                '/insightproto.proto.results.v1.UpdateService/Phase1UpdateResult',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase1Update.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Phase2UpdateResult = channel.unary_unary(
                '/insightproto.proto.results.v1.UpdateService/Phase2UpdateResult',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase2Update.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Phase3UpdateResult = channel.unary_unary(
                '/insightproto.proto.results.v1.UpdateService/Phase3UpdateResult',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase3Update.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.CompleteInvestigation = channel.unary_unary(
                '/insightproto.proto.results.v1.UpdateService/CompleteInvestigation',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_results__pb2.InvestigationResult.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)


class UpdateServiceServicer(object):
    """UpdateService provides a gRPC service for streaming real-time updates
    during investigation processing.
    """

    def StreamUpdates(self, request_iterator, context):
        """StreamUpdates allows server-side streaming of updates from the agent
        to the server. The agent sends incremental updates without requiring acknowledgement.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Thinking(self, request, context):
        """Thinking allows the agent to communicate a new thought
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Phase1UpdateResult(self, request, context):
        """allow the agent to send the result of the phase1 update as soon as it is ready
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Phase2UpdateResult(self, request, context):
        """post the phase 2 results
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Phase3UpdateResult(self, request, context):
        """post the phase 3 results
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CompleteInvestigation(self, request, context):
        """Post the complete investigation result
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UpdateServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StreamUpdates': grpc.stream_unary_rpc_method_handler(
                    servicer.StreamUpdates,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.UpdateRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Thinking': grpc.unary_unary_rpc_method_handler(
                    servicer.Thinking,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Thought.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Phase1UpdateResult': grpc.unary_unary_rpc_method_handler(
                    servicer.Phase1UpdateResult,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase1Update.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Phase2UpdateResult': grpc.unary_unary_rpc_method_handler(
                    servicer.Phase2UpdateResult,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase2Update.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Phase3UpdateResult': grpc.unary_unary_rpc_method_handler(
                    servicer.Phase3UpdateResult,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase3Update.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'CompleteInvestigation': grpc.unary_unary_rpc_method_handler(
                    servicer.CompleteInvestigation,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_results__pb2.InvestigationResult.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'insightproto.proto.results.v1.UpdateService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('insightproto.proto.results.v1.UpdateService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class UpdateService(object):
    """UpdateService provides a gRPC service for streaming real-time updates
    during investigation processing.
    """

    @staticmethod
    def StreamUpdates(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,
            '/insightproto.proto.results.v1.UpdateService/StreamUpdates',
            insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.UpdateRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Thinking(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,
            '/insightproto.proto.results.v1.UpdateService/Thinking',
            insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Thought.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Phase1UpdateResult(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,
            '/insightproto.proto.results.v1.UpdateService/Phase1UpdateResult',
            insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase1Update.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Phase2UpdateResult(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,
            '/insightproto.proto.results.v1.UpdateService/Phase2UpdateResult',
            insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase2Update.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Phase3UpdateResult(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,
            '/insightproto.proto.results.v1.UpdateService/Phase3UpdateResult',
            insightproto_dot_proto_dot_results_dot_v1_dot_updates__pb2.Phase3Update.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CompleteInvestigation(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,
            '/insightproto.proto.results.v1.UpdateService/CompleteInvestigation',
            insightproto_dot_proto_dot_results_dot_v1_dot_results__pb2.InvestigationResult.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
