export type DeleteApiCheckoutLinksUuidArgs = {'X-Fanvue-API-Version': string, uuid: string}; export type DeleteApiCheckoutLinksUuidOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a checkout link * * DELETE /checkout-links/{uuid} */ export const deleteApiCheckoutLinksUuid = async (args: DeleteApiCheckoutLinksUuidArgs, options?: DeleteApiCheckoutLinksUuidOptions) => { const {baseUrl = "https://api.fanvue.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Fanvue-API-Version'] != null) headers.set("X-Fanvue-API-Version", String(args['X-Fanvue-API-Version'])) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/checkout-links/${encodeURIComponent(String(args.uuid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };