# 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 transaction_service_pb2 as com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__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/daml/ledger/api/v1/transaction_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 TransactionServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetTransactions = channel.unary_stream(
                '/com.daml.ledger.api.v1.TransactionService/GetTransactions',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsResponse.FromString,
                _registered_method=True)
        self.GetTransactionTrees = channel.unary_stream(
                '/com.daml.ledger.api.v1.TransactionService/GetTransactionTrees',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionTreesResponse.FromString,
                _registered_method=True)
        self.GetTransactionByEventId = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetTransactionByEventId',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.FromString,
                _registered_method=True)
        self.GetTransactionById = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetTransactionById',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.FromString,
                _registered_method=True)
        self.GetFlatTransactionByEventId = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetFlatTransactionByEventId',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.FromString,
                _registered_method=True)
        self.GetFlatTransactionById = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetFlatTransactionById',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.FromString,
                _registered_method=True)
        self.GetLedgerEnd = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetLedgerEnd',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndResponse.FromString,
                _registered_method=True)
        self.GetLatestPrunedOffsets = channel.unary_unary(
                '/com.daml.ledger.api.v1.TransactionService/GetLatestPrunedOffsets',
                request_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsRequest.SerializeToString,
                response_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsResponse.FromString,
                _registered_method=True)


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

    def GetTransactions(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 GetTransactionTrees(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 GetTransactionByEventId(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 GetTransactionById(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 GetFlatTransactionByEventId(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 GetFlatTransactionById(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 GetLedgerEnd(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 GetLatestPrunedOffsets(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_TransactionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetTransactions': grpc.unary_stream_rpc_method_handler(
                    servicer.GetTransactions,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsResponse.SerializeToString,
            ),
            'GetTransactionTrees': grpc.unary_stream_rpc_method_handler(
                    servicer.GetTransactionTrees,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionTreesResponse.SerializeToString,
            ),
            'GetTransactionByEventId': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTransactionByEventId,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.SerializeToString,
            ),
            'GetTransactionById': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTransactionById,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.SerializeToString,
            ),
            'GetFlatTransactionByEventId': grpc.unary_unary_rpc_method_handler(
                    servicer.GetFlatTransactionByEventId,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.SerializeToString,
            ),
            'GetFlatTransactionById': grpc.unary_unary_rpc_method_handler(
                    servicer.GetFlatTransactionById,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.SerializeToString,
            ),
            'GetLedgerEnd': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLedgerEnd,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndResponse.SerializeToString,
            ),
            'GetLatestPrunedOffsets': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLatestPrunedOffsets,
                    request_deserializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsRequest.FromString,
                    response_serializer=com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'com.daml.ledger.api.v1.TransactionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('com.daml.ledger.api.v1.TransactionService', rpc_method_handlers)


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

    @staticmethod
    def GetTransactions(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.daml.ledger.api.v1.TransactionService/GetTransactions',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTransactionTrees(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.daml.ledger.api.v1.TransactionService/GetTransactionTrees',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionsRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionTreesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTransactionByEventId(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.daml.ledger.api.v1.TransactionService/GetTransactionByEventId',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTransactionById(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.daml.ledger.api.v1.TransactionService/GetTransactionById',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetFlatTransactionByEventId(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.daml.ledger.api.v1.TransactionService/GetFlatTransactionByEventId',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByEventIdRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetFlatTransactionById(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.daml.ledger.api.v1.TransactionService/GetFlatTransactionById',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetTransactionByIdRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetFlatTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLedgerEnd(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.daml.ledger.api.v1.TransactionService/GetLedgerEnd',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLedgerEndResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLatestPrunedOffsets(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.daml.ledger.api.v1.TransactionService/GetLatestPrunedOffsets',
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsRequest.SerializeToString,
            com_dot_daml_dot_ledger_dot_api_dot_v1_dot_transaction__service__pb2.GetLatestPrunedOffsetsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
