export type CreateApiGamesV1managementAchievementsAchievementIdResetArgs = {achievementId: string}; export type CreateApiGamesV1managementAchievementsAchievementIdResetOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. * * POST /games/v1management/achievements/{achievementId}/reset */ export const createApiGamesV1managementAchievementsAchievementIdReset = async (args: CreateApiGamesV1managementAchievementsAchievementIdResetArgs, options?: CreateApiGamesV1managementAchievementsAchievementIdResetOptions) => { const {baseUrl = "https://gamesmanagement.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/games/v1management/achievements/${encodeURIComponent(String(args.achievementId))}/reset${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };