# 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 galaxy_repository_pb2 as galaxy__repository__pb2

GRPC_GENERATED_VERSION = '1.80.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},'
        + ' but the generated code in galaxy_repository_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 GalaxyRepositoryStub(object):
    """Wire-compatibility policy (ProtobufStyleGuide): this contract evolves
    additively only. Never renumber or repurpose an existing field number or
    enum value. When a field or enum value is removed, add a `reserved` range
    (and `reserved` name) covering it in the same change so a future editor
    cannot accidentally reuse the retired tag. There are no `reserved`
    declarations today because no field or enum value has ever been removed.

    Read-only browse over the AVEVA System Platform Galaxy Repository (ZB SQL
    database). Lets clients enumerate the deployed object hierarchy and each
    object's dynamic attributes so they know what tag references to subscribe
    to via the MxAccessGateway service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.TestConnection = channel.unary_unary(
                '/galaxy_repository.v1.GalaxyRepository/TestConnection',
                request_serializer=galaxy__repository__pb2.TestConnectionRequest.SerializeToString,
                response_deserializer=galaxy__repository__pb2.TestConnectionReply.FromString,
                _registered_method=True)
        self.GetLastDeployTime = channel.unary_unary(
                '/galaxy_repository.v1.GalaxyRepository/GetLastDeployTime',
                request_serializer=galaxy__repository__pb2.GetLastDeployTimeRequest.SerializeToString,
                response_deserializer=galaxy__repository__pb2.GetLastDeployTimeReply.FromString,
                _registered_method=True)
        self.DiscoverHierarchy = channel.unary_unary(
                '/galaxy_repository.v1.GalaxyRepository/DiscoverHierarchy',
                request_serializer=galaxy__repository__pb2.DiscoverHierarchyRequest.SerializeToString,
                response_deserializer=galaxy__repository__pb2.DiscoverHierarchyReply.FromString,
                _registered_method=True)
        self.WatchDeployEvents = channel.unary_stream(
                '/galaxy_repository.v1.GalaxyRepository/WatchDeployEvents',
                request_serializer=galaxy__repository__pb2.WatchDeployEventsRequest.SerializeToString,
                response_deserializer=galaxy__repository__pb2.DeployEvent.FromString,
                _registered_method=True)
        self.BrowseChildren = channel.unary_unary(
                '/galaxy_repository.v1.GalaxyRepository/BrowseChildren',
                request_serializer=galaxy__repository__pb2.BrowseChildrenRequest.SerializeToString,
                response_deserializer=galaxy__repository__pb2.BrowseChildrenReply.FromString,
                _registered_method=True)


class GalaxyRepositoryServicer(object):
    """Wire-compatibility policy (ProtobufStyleGuide): this contract evolves
    additively only. Never renumber or repurpose an existing field number or
    enum value. When a field or enum value is removed, add a `reserved` range
    (and `reserved` name) covering it in the same change so a future editor
    cannot accidentally reuse the retired tag. There are no `reserved`
    declarations today because no field or enum value has ever been removed.

    Read-only browse over the AVEVA System Platform Galaxy Repository (ZB SQL
    database). Lets clients enumerate the deployed object hierarchy and each
    object's dynamic attributes so they know what tag references to subscribe
    to via the MxAccessGateway service.
    """

    def TestConnection(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 GetLastDeployTime(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 DiscoverHierarchy(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 WatchDeployEvents(self, request, context):
        """Server-stream of deploy events. The server emits the current state immediately
        on subscribe (so clients can bootstrap their cache without waiting for the next
        deploy), then emits one event each time the gateway's hierarchy cache observes
        a new galaxy.time_of_last_deploy. The sequence field is monotonically
        increasing per server start; gaps indicate the per-subscriber buffer dropped
        older events because the client was too slow.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BrowseChildren(self, request, context):
        """Returns the direct children of a parent object (or the root objects when
        `parent` is unset). Designed for OPC UA-style lazy expand: clients walk
        one level at a time instead of paging the full hierarchy. Filters mirror
        DiscoverHierarchy exactly. Backed by the same shared hierarchy cache.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GalaxyRepositoryServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'TestConnection': grpc.unary_unary_rpc_method_handler(
                    servicer.TestConnection,
                    request_deserializer=galaxy__repository__pb2.TestConnectionRequest.FromString,
                    response_serializer=galaxy__repository__pb2.TestConnectionReply.SerializeToString,
            ),
            'GetLastDeployTime': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLastDeployTime,
                    request_deserializer=galaxy__repository__pb2.GetLastDeployTimeRequest.FromString,
                    response_serializer=galaxy__repository__pb2.GetLastDeployTimeReply.SerializeToString,
            ),
            'DiscoverHierarchy': grpc.unary_unary_rpc_method_handler(
                    servicer.DiscoverHierarchy,
                    request_deserializer=galaxy__repository__pb2.DiscoverHierarchyRequest.FromString,
                    response_serializer=galaxy__repository__pb2.DiscoverHierarchyReply.SerializeToString,
            ),
            'WatchDeployEvents': grpc.unary_stream_rpc_method_handler(
                    servicer.WatchDeployEvents,
                    request_deserializer=galaxy__repository__pb2.WatchDeployEventsRequest.FromString,
                    response_serializer=galaxy__repository__pb2.DeployEvent.SerializeToString,
            ),
            'BrowseChildren': grpc.unary_unary_rpc_method_handler(
                    servicer.BrowseChildren,
                    request_deserializer=galaxy__repository__pb2.BrowseChildrenRequest.FromString,
                    response_serializer=galaxy__repository__pb2.BrowseChildrenReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'galaxy_repository.v1.GalaxyRepository', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('galaxy_repository.v1.GalaxyRepository', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class GalaxyRepository(object):
    """Wire-compatibility policy (ProtobufStyleGuide): this contract evolves
    additively only. Never renumber or repurpose an existing field number or
    enum value. When a field or enum value is removed, add a `reserved` range
    (and `reserved` name) covering it in the same change so a future editor
    cannot accidentally reuse the retired tag. There are no `reserved`
    declarations today because no field or enum value has ever been removed.

    Read-only browse over the AVEVA System Platform Galaxy Repository (ZB SQL
    database). Lets clients enumerate the deployed object hierarchy and each
    object's dynamic attributes so they know what tag references to subscribe
    to via the MxAccessGateway service.
    """

    @staticmethod
    def TestConnection(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,
            '/galaxy_repository.v1.GalaxyRepository/TestConnection',
            galaxy__repository__pb2.TestConnectionRequest.SerializeToString,
            galaxy__repository__pb2.TestConnectionReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLastDeployTime(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,
            '/galaxy_repository.v1.GalaxyRepository/GetLastDeployTime',
            galaxy__repository__pb2.GetLastDeployTimeRequest.SerializeToString,
            galaxy__repository__pb2.GetLastDeployTimeReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DiscoverHierarchy(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,
            '/galaxy_repository.v1.GalaxyRepository/DiscoverHierarchy',
            galaxy__repository__pb2.DiscoverHierarchyRequest.SerializeToString,
            galaxy__repository__pb2.DiscoverHierarchyReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WatchDeployEvents(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,
            '/galaxy_repository.v1.GalaxyRepository/WatchDeployEvents',
            galaxy__repository__pb2.WatchDeployEventsRequest.SerializeToString,
            galaxy__repository__pb2.DeployEvent.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BrowseChildren(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,
            '/galaxy_repository.v1.GalaxyRepository/BrowseChildren',
            galaxy__repository__pb2.BrowseChildrenRequest.SerializeToString,
            galaxy__repository__pb2.BrowseChildrenReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
