import { KeetaAnchorError } from '../error.js';
class KeetaAnchorQueueIdempotentKeyExistsError extends KeetaAnchorError {
    static name = 'KeetaAnchorQueueIdempotentExists';
    KeetaAnchorQueueIdempotentExistsErrorObjectTypeID;
    static KeetaAnchorQueueIdempotentExistsErrorObjectTypeID = '8aa29501-53ac-40ee-9a6c-519b189e4bc8';
    idempotentIDsFound;
    constructor(message, idempotentIDsFound) {
        super(message ?? 'One or more idempotent entries already exist in the queue');
        this.statusCode = -1;
        Object.defineProperty(this, 'KeetaAnchorQueueIdempotentExistsErrorObjectTypeID', {
            value: KeetaAnchorQueueIdempotentKeyExistsError.KeetaAnchorQueueIdempotentExistsErrorObjectTypeID,
            enumerable: false
        });
        this.idempotentIDsFound = new Set(idempotentIDsFound);
    }
    static isInstance(input) {
        return (this.hasPropWithValue(input, 'KeetaAnchorQueueIdempotentExistsErrorObjectTypeID', KeetaAnchorQueueIdempotentKeyExistsError.KeetaAnchorQueueIdempotentExistsErrorObjectTypeID));
    }
}
class KeetaAnchorQueueIncorrectStateAssertedError extends KeetaAnchorError {
    static name = 'KeetaAnchorQueueIncorrectState';
    KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID;
    static KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID = '9a298ad0-7144-483c-bac2-20c914df3697';
    constructor(id, expectedStatus, actualStatus, message) {
        super(message ?? `The entry (${String(id)}) is in an incorrect state. Expected: ${expectedStatus}, Actual: ${actualStatus}`);
        this.statusCode = -1;
        this.retryable = true;
        Object.defineProperty(this, 'KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID', {
            value: KeetaAnchorQueueIncorrectStateAssertedError.KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID,
            enumerable: false
        });
    }
    static isInstance(input) {
        return (this.hasPropWithValue(input, 'KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID', KeetaAnchorQueueIncorrectStateAssertedError.KeetaAnchorQueueIncorrectStateAssertedErrorObjectTypeID));
    }
}
export const Errors = {
    /**
     * An entry already exists in the queue that contains one of the idempotent
     * ID(s) as the requested entry.
     */
    IdempotentExistsError: KeetaAnchorQueueIdempotentKeyExistsError,
    /**
     * The entry is not in the state asserted by the request
     */
    IncorrectStateAssertedError: KeetaAnchorQueueIncorrectStateAssertedError
};
//# sourceMappingURL=common.js.map