docs/classes/management.SDK.HttpResponsePromise.html
A promise that returns the parsed response and lets you retrieve the raw response too.
fromFunctioninterceptFunctionfromPromisefromExecutorfromResultthencatchfinallywithRawResponse
StaticfromFunctionfromFunction<F extends (...args: never[]) => Promise<WithRawResponse<T>>, T>(
fn: F,
...args: Parameters<F>,
): HttpResponsePromise<T>
Creates an HttpResponsePromise from a function that returns a promise.
A function that returns a promise resolving to a WithRawResponse object.
Arguments to pass to the function.
An HttpResponsePromise instance.
StaticinterceptFunctioninterceptFunction<
F extends (...args: never[]) => Promise<WithRawResponse<T>>,
T = Awaited<ReturnType<F>>["data"],
>(
fn: F,
): (...args: Parameters<F>) => HttpResponsePromise<T>
Creates a function that returns an HttpResponsePromise from a function that returns a promise.
A function that returns a promise resolving to a WithRawResponse object.
A function that returns an HttpResponsePromise instance.
StaticfromPromisefromPromise<T>(promise: Promise<WithRawResponse<T>>): HttpResponsePromise<T>
Creates an HttpResponsePromise from an existing promise.
A promise resolving to a WithRawResponse object.
An HttpResponsePromise instance.
StaticfromExecutorfromExecutor<T>(
executor: (
resolve: (value: WithRawResponse<T>) => void,
reject: (reason?: unknown) => void,
) => void,
): HttpResponsePromise<T>
Creates an HttpResponsePromise from an executor function.
A function that takes resolve and reject callbacks to create a promise.
An HttpResponsePromise instance.
StaticfromResultfromResult<T>(result: WithRawResponse<T>): HttpResponsePromise<T>
Creates an HttpResponsePromise from a resolved result.
A WithRawResponse object to resolve immediately.
An HttpResponsePromise instance.
then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,
): Promise<TResult1 | TResult2>
Optionalonfulfilled: ((value: T) => TResult1 | PromiseLike<TResult1>) | nullOptionalonrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | nullcatch<TResult = never>(
onrejected?:
| ((reason: unknown) => TResult | PromiseLike<TResult>)
| null,
): Promise<T | TResult>
finally(onfinally?: (() => void) | null): Promise<T>
Optionalonfinally: (() => void) | nullwithRawResponse(): Promise<WithRawResponse<T>>
Retrieves the data and raw response.
A promise resolving to a WithRawResponse object.
Member Visibility
ThemeOSLightDark
Methods fromFunctioninterceptFunctionfromPromisefromExecutorfromResultthencatchfinallywithRawResponse