export type DeleteApiAppLinkingGLinkingIdArgs = {linkingId: number}; export type DeleteApiAppLinkingGLinkingIdOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /app/linking/g/{linkingId} */ export const deleteApiAppLinkingGLinkingId = async (args: DeleteApiAppLinkingGLinkingIdArgs, options: DeleteApiAppLinkingGLinkingIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (token !== undefined) headers.set("authorization", token) const url = `${baseUrl.replace(/\/+$/, '')}/app/linking/g/${encodeURIComponent(String(args.linkingId))}${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 };