/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: fac8da972f86
 */
export class APIPromise {
    #promise;
    #unwrapped;
    [Symbol.toStringTag] = "APIPromise";
    constructor(p) {
        this.#promise = p instanceof Promise ? p : Promise.resolve(p);
        this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
    }
    #getUnwrapped() {
        return (this.#unwrapped ?? (this.#unwrapped = this.#promise.then(([value]) => value)));
    }
    then(onfulfilled, onrejected) {
        return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
    }
    catch(onrejected) {
        return this.#getUnwrapped().catch(onrejected);
    }
    finally(onfinally) {
        return this.#getUnwrapped().finally(onfinally);
    }
    $inspect() {
        return this.#promise;
    }
}
//# sourceMappingURL=async.js.map