export type GetApiAppLinkingMetaLinkingIdPingArgs = {linkingId: number}; export type GetApiAppLinkingMetaLinkingIdPingOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /app/linking/meta/{linkingId}/ping */ export const getApiAppLinkingMetaLinkingIdPing = async (args: GetApiAppLinkingMetaLinkingIdPingArgs, options: GetApiAppLinkingMetaLinkingIdPingOptions) => { 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/meta/${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 };