# Copyright (c) 2017-2026 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 party_management_service_pb2 as com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2

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

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

        Args:
            channel: A grpc.Channel.
        """
        self.AddPartyAsync = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/AddPartyAsync',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncResponse.FromString,
                _registered_method=True)
        self.GetAddPartyStatus = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/GetAddPartyStatus',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusResponse.FromString,
                _registered_method=True)
        self.ExportPartyAcs = channel.unary_stream(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/ExportPartyAcs',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsResponse.FromString,
                _registered_method=True)
        self.ImportPartyAcs = channel.stream_unary(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/ImportPartyAcs',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsResponse.FromString,
                _registered_method=True)
        self.GetHighestOffsetByTimestamp = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/GetHighestOffsetByTimestamp',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampResponse.FromString,
                _registered_method=True)
        self.ClearPartyOnboardingFlag = channel.unary_unary(
                '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/ClearPartyOnboardingFlag',
                request_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagResponse.FromString,
                _registered_method=True)


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

    def AddPartyAsync(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 GetAddPartyStatus(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 ExportPartyAcs(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 ImportPartyAcs(self, request_iterator, 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 GetHighestOffsetByTimestamp(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 ClearPartyOnboardingFlag(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_PartyManagementServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AddPartyAsync': grpc.unary_unary_rpc_method_handler(
                    servicer.AddPartyAsync,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncResponse.SerializeToString,
            ),
            'GetAddPartyStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAddPartyStatus,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusResponse.SerializeToString,
            ),
            'ExportPartyAcs': grpc.unary_stream_rpc_method_handler(
                    servicer.ExportPartyAcs,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsResponse.SerializeToString,
            ),
            'ImportPartyAcs': grpc.stream_unary_rpc_method_handler(
                    servicer.ImportPartyAcs,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsResponse.SerializeToString,
            ),
            'GetHighestOffsetByTimestamp': grpc.unary_unary_rpc_method_handler(
                    servicer.GetHighestOffsetByTimestamp,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampResponse.SerializeToString,
            ),
            'ClearPartyOnboardingFlag': grpc.unary_unary_rpc_method_handler(
                    servicer.ClearPartyOnboardingFlag,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'com.digitalasset.canton.admin.participant.v30.PartyManagementService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('com.digitalasset.canton.admin.participant.v30.PartyManagementService', rpc_method_handlers)


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

    @staticmethod
    def AddPartyAsync(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.PartyManagementService/AddPartyAsync',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.AddPartyAsyncResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAddPartyStatus(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.PartyManagementService/GetAddPartyStatus',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetAddPartyStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExportPartyAcs(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,
            '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/ExportPartyAcs',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ExportPartyAcsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ImportPartyAcs(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,
            '/com.digitalasset.canton.admin.participant.v30.PartyManagementService/ImportPartyAcs',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ImportPartyAcsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetHighestOffsetByTimestamp(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.PartyManagementService/GetHighestOffsetByTimestamp',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.GetHighestOffsetByTimestampResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ClearPartyOnboardingFlag(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.PartyManagementService/ClearPartyOnboardingFlag',
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_admin_dot_participant_dot_v30_dot_party__management__service__pb2.ClearPartyOnboardingFlagResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
