import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
import type { IBinaryWriter } from '@protobuf-ts/runtime';
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
import type { IBinaryReader } from '@protobuf-ts/runtime';
import type { PartialMessage } from '@protobuf-ts/runtime';
import { MessageType } from '@protobuf-ts/runtime';
import { SynchronizerTime } from './offset_checkpoint.js';
import { TraceContext } from './trace_context.js';
import { Duration } from '../../../../../google/protobuf/duration.js';
import { Status } from '../../../../../google/rpc/status.js';
/**
 * A completion represents the status of a submitted command on the ledger: it can be successful or failed.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Completion
 */
export interface Completion {
    /**
     * The ID of the succeeded or failed command.
     * Must be a valid LedgerString (as described in ``value.proto``).
     * Required
     *
     * @generated from protobuf field: string command_id = 1
     */
    commandId: string;
    /**
     * Identifies the exact type of the error.
     * It uses the same format of conveying error details as it is used for the RPC responses of the APIs.
     * Optional
     *
     * @generated from protobuf field: google.rpc.Status status = 2
     */
    status?: Status;
    /**
     * The update_id of the transaction or reassignment that resulted from the command with command_id.
     * Only set for successfully executed commands.
     * Must be a valid LedgerString (as described in ``value.proto``).
     *
     * @generated from protobuf field: string update_id = 3
     */
    updateId: string;
    /**
     * The user-id that was used for the submission, as described in ``commands.proto``.
     * Must be a valid UserIdString (as described in ``value.proto``).
     * Optional for historic completions where this data is not available.
     *
     * @generated from protobuf field: string user_id = 4
     */
    userId: string;
    /**
     * The set of parties on whose behalf the commands were executed.
     * Contains the ``act_as`` parties from ``commands.proto``
     * filtered to the requesting parties in CompletionStreamRequest.
     * The order of the parties need not be the same as in the submission.
     * Each element must be a valid PartyIdString (as described in ``value.proto``).
     * Optional for historic completions where this data is not available.
     *
     * @generated from protobuf field: repeated string act_as = 5
     */
    actAs: string[];
    /**
     * The submission ID this completion refers to, as described in ``commands.proto``.
     * Must be a valid LedgerString (as described in ``value.proto``).
     * Optional
     *
     * @generated from protobuf field: string submission_id = 6
     */
    submissionId: string;
    /**
     * The actual deduplication window used for the submission, which is derived from
     * ``Commands.deduplication_period``. The ledger may convert the deduplication period into other
     * descriptions and extend the period in implementation-specified ways.
     *
     * Used to audit the deduplication guarantee described in ``commands.proto``.
     *
     * Optional; the deduplication guarantee applies even if the completion omits this field.
     *
     * @generated from protobuf oneof: deduplication_period
     */
    deduplicationPeriod: {
        oneofKind: 'deduplicationOffset';
        /**
         * Specifies the start of the deduplication period by a completion stream offset (exclusive).
         *
         * Must be a valid absolute offset (positive integer) or participant begin (zero).
         *
         * @generated from protobuf field: int64 deduplication_offset = 7
         */
        deduplicationOffset: bigint;
    } | {
        oneofKind: 'deduplicationDuration';
        /**
         * Specifies the length of the deduplication period.
         * It is measured in record time of completions.
         *
         * Must be non-negative.
         *
         * @generated from protobuf field: google.protobuf.Duration deduplication_duration = 8
         */
        deduplicationDuration: Duration;
    } | {
        oneofKind: undefined;
    };
    /**
     * Optional; ledger API trace context
     *
     * The trace context transported in this message corresponds to the trace context supplied
     * by the client application in a HTTP2 header of the original command submission.
     * We typically use a header to transfer this type of information. Here we use message
     * body, because it is used in gRPC streams which do not support per message headers.
     * This field will be populated with the trace context contained in the original submission.
     * If that was not provided, a unique ledger-api-server generated trace context will be used
     * instead.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.TraceContext trace_context = 9
     */
    traceContext?: TraceContext;
    /**
     * May be used in a subsequent CompletionStreamRequest to resume the consumption of this stream at a later time.
     * Required, must be a valid absolute offset (positive integer).
     *
     * @generated from protobuf field: int64 offset = 10
     */
    offset: bigint;
    /**
     * The synchronizer along with its record time.
     * The synchronizer id provided, in case of
     *
     * - successful/failed transactions: identifies the synchronizer of the transaction
     * - for successful/failed unassign commands: identifies the source synchronizer
     * - for successful/failed assign commands: identifies the target synchronizer
     *
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.SynchronizerTime synchronizer_time = 11
     */
    synchronizerTime?: SynchronizerTime;
}
declare class Completion$Type extends MessageType<Completion> {
    constructor();
    create(value?: PartialMessage<Completion>): Completion;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Completion): Completion;
    internalBinaryWrite(message: Completion, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Completion
 */
export declare const Completion: Completion$Type;
export {};
//# sourceMappingURL=completion.d.ts.map