export type DeleteApiV1CreatorGamesGameIdArgs = {gameId: string, version: number}; export type DeleteApiV1CreatorGamesGameIdOptions = {baseUrl: string, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /v1/creator/games/{gameId} */ export const deleteApiV1CreatorGamesGameId = async (args: DeleteApiV1CreatorGamesGameIdArgs, options: DeleteApiV1CreatorGamesGameIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.version != null) query.append("version", String(args.version)) if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/creator/games/${encodeURIComponent(String(args.gameId))}${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 };