# Copyright (c) 2017-2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# fmt: off
# isort: skip_file
# 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 . import package_service_pb2 as com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2

GRPC_GENERATED_VERSION = '1.67.1'
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 com/digitalasset/canton/admin/participant/v30/package_service_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 PackageServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListPackages = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/ListPackages',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesResponse.FromString,
                _registered_method=True)
        self.ListPackageContents = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/ListPackageContents',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsResponse.FromString,
                _registered_method=True)
        self.ListDars = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/ListDars',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsResponse.FromString,
                _registered_method=True)
        self.ListDarContents = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/ListDarContents',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsResponse.FromString,
                _registered_method=True)
        self.UploadDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/UploadDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarResponse.FromString,
                _registered_method=True)
        self.ValidateDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/ValidateDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarResponse.FromString,
                _registered_method=True)
        self.RemovePackage = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/RemovePackage',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageResponse.FromString,
                _registered_method=True)
        self.VetDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/VetDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarResponse.FromString,
                _registered_method=True)
        self.UnvetDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/UnvetDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarResponse.FromString,
                _registered_method=True)
        self.RemoveDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/RemoveDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarResponse.FromString,
                _registered_method=True)
        self.GetDar = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PackageService/GetDar',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarResponse.FromString,
                _registered_method=True)


class PackageServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def ListPackages(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 ListPackageContents(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 ListDars(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 ListDarContents(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 UploadDar(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 ValidateDar(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 RemovePackage(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 VetDar(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 UnvetDar(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 RemoveDar(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 GetDar(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_PackageServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListPackages': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPackages,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesResponse.SerializeToString,
            ),
            'ListPackageContents': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPackageContents,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsResponse.SerializeToString,
            ),
            'ListDars': grpc.unary_unary_rpc_method_handler(
                    servicer.ListDars,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsResponse.SerializeToString,
            ),
            'ListDarContents': grpc.unary_unary_rpc_method_handler(
                    servicer.ListDarContents,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsResponse.SerializeToString,
            ),
            'UploadDar': grpc.unary_unary_rpc_method_handler(
                    servicer.UploadDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarResponse.SerializeToString,
            ),
            'ValidateDar': grpc.unary_unary_rpc_method_handler(
                    servicer.ValidateDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarResponse.SerializeToString,
            ),
            'RemovePackage': grpc.unary_unary_rpc_method_handler(
                    servicer.RemovePackage,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageResponse.SerializeToString,
            ),
            'VetDar': grpc.unary_unary_rpc_method_handler(
                    servicer.VetDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarResponse.SerializeToString,
            ),
            'UnvetDar': grpc.unary_unary_rpc_method_handler(
                    servicer.UnvetDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarResponse.SerializeToString,
            ),
            'RemoveDar': grpc.unary_unary_rpc_method_handler(
                    servicer.RemoveDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarResponse.SerializeToString,
            ),
            'GetDar': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDar,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'com.digitalasset.canton.admin.participant.v30.PackageService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('com.digitalasset.canton.admin.participant.v30.PackageService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class PackageService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def ListPackages(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/ListPackages',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackagesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListPackageContents(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/ListPackageContents',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListPackageContentsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListDars(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/ListDars',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListDarContents(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/ListDarContents',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ListDarContentsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UploadDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/UploadDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UploadDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ValidateDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/ValidateDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.ValidateDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RemovePackage(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/RemovePackage',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemovePackageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def VetDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/VetDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.VetDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UnvetDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/UnvetDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.UnvetDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RemoveDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/RemoveDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.RemoveDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDar(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,
            '/com.digitalasset.canton.admin.participant.v30.PackageService/GetDar',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_package__service__pb2.GetDarResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
