export type GetApiAppLinkingGLinkingIdPingArgs = {linkingId: number}; export type GetApiAppLinkingGLinkingIdPingOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /app/linking/g/{linkingId}/ping */ export const getApiAppLinkingGLinkingIdPing = async (args: GetApiAppLinkingGLinkingIdPingArgs, options: GetApiAppLinkingGLinkingIdPingOptions) => { 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))}/ping${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };