export type DeleteApiV1LeaderboardsLeaderboardIdArgs = {leaderboard_id: string}; export type DeleteApiV1LeaderboardsLeaderboardIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Leaderboard * * DELETE /v1/leaderboards/{leaderboard_id} */ export const deleteApiV1LeaderboardsLeaderboardId = async (args: DeleteApiV1LeaderboardsLeaderboardIdArgs, options?: DeleteApiV1LeaderboardsLeaderboardIdOptions) => { const {baseUrl = "https://api.aghanim.com/s2s", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/leaderboards/${encodeURIComponent(String(args.leaderboard_id))}${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 };