# 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 topology_manager_write_service_pb2 as com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2

GRPC_GENERATED_VERSION = '1.72.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/topology/admin/v30/topology_manager_write_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 TopologyManagerWriteServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Authorize = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/Authorize',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeResponse.FromString,
                _registered_method=True)
        self.AddTransactions = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/AddTransactions',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsResponse.FromString,
                _registered_method=True)
        self.ImportTopologySnapshot = channel.stream_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/ImportTopologySnapshot',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotResponse.FromString,
                _registered_method=True)
        self.SignTransactions = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/SignTransactions',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsResponse.FromString,
                _registered_method=True)
        self.GenerateTransactions = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/GenerateTransactions',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsResponse.FromString,
                _registered_method=True)
        self.CreateTemporaryTopologyStore = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/CreateTemporaryTopologyStore',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreResponse.FromString,
                _registered_method=True)
        self.DropTemporaryTopologyStore = channel.unary_unary(
                '/com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService/DropTemporaryTopologyStore',
                request_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreRequest.SerializeToString,
                response_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreResponse.FromString,
                _registered_method=True)


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

    def Authorize(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 AddTransactions(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 ImportTopologySnapshot(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 SignTransactions(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 GenerateTransactions(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 CreateTemporaryTopologyStore(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 DropTemporaryTopologyStore(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_TopologyManagerWriteServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Authorize': grpc.unary_unary_rpc_method_handler(
                    servicer.Authorize,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeResponse.SerializeToString,
            ),
            'AddTransactions': grpc.unary_unary_rpc_method_handler(
                    servicer.AddTransactions,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsResponse.SerializeToString,
            ),
            'ImportTopologySnapshot': grpc.stream_unary_rpc_method_handler(
                    servicer.ImportTopologySnapshot,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotResponse.SerializeToString,
            ),
            'SignTransactions': grpc.unary_unary_rpc_method_handler(
                    servicer.SignTransactions,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsResponse.SerializeToString,
            ),
            'GenerateTransactions': grpc.unary_unary_rpc_method_handler(
                    servicer.GenerateTransactions,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsResponse.SerializeToString,
            ),
            'CreateTemporaryTopologyStore': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateTemporaryTopologyStore,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreResponse.SerializeToString,
            ),
            'DropTemporaryTopologyStore': grpc.unary_unary_rpc_method_handler(
                    servicer.DropTemporaryTopologyStore,
                    request_deserializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreRequest.FromString,
                    response_serializer=com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('com.digitalasset.canton.topology.admin.v30.TopologyManagerWriteService', rpc_method_handlers)


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

    @staticmethod
    def Authorize(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.topology.admin.v30.TopologyManagerWriteService/Authorize',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AuthorizeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AddTransactions(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.topology.admin.v30.TopologyManagerWriteService/AddTransactions',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.AddTransactionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ImportTopologySnapshot(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.topology.admin.v30.TopologyManagerWriteService/ImportTopologySnapshot',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.ImportTopologySnapshotResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SignTransactions(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.topology.admin.v30.TopologyManagerWriteService/SignTransactions',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.SignTransactionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GenerateTransactions(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.topology.admin.v30.TopologyManagerWriteService/GenerateTransactions',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.GenerateTransactionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateTemporaryTopologyStore(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.topology.admin.v30.TopologyManagerWriteService/CreateTemporaryTopologyStore',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.CreateTemporaryTopologyStoreResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DropTemporaryTopologyStore(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.topology.admin.v30.TopologyManagerWriteService/DropTemporaryTopologyStore',
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreRequest.SerializeToString,
            com_dot_digitalasset_dot_canton_dot_topology_dot_admin_dot_v30_dot_topology__manager__write__service__pb2.DropTemporaryTopologyStoreResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
