export type LocalizedString = {value?: string | undefined, locale?: string | undefined, kind?: string | undefined}; export type LocalizedStringBundle = {kind?: string | undefined, translations?: Array | undefined}; export type AchievementConfigurationDetail = {sortRank?: number | undefined, kind?: string | undefined, pointValue?: number | undefined, name?: LocalizedStringBundle | undefined, description?: LocalizedStringBundle | undefined, iconUrl?: string | undefined}; export type AchievementConfiguration = {id?: string | undefined, stepsToUnlock?: number | undefined, initialState?: ('INITIAL_STATE_UNSPECIFIED' | 'HIDDEN' | 'REVEALED') | undefined, kind?: string | undefined, draft?: AchievementConfigurationDetail | undefined, published?: AchievementConfigurationDetail | undefined, token?: string | undefined, achievementType?: ('ACHIEVEMENT_TYPE_UNSPECIFIED' | 'STANDARD' | 'INCREMENTAL') | undefined}; export type UpdateApiGamesV1configurationAchievementsAchievementIdArgs = {achievementId: string, body: AchievementConfiguration}; export type UpdateApiGamesV1configurationAchievementsAchievementIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update the metadata of the achievement configuration with the given ID. * * PUT /games/v1configuration/achievements/{achievementId} */ export const updateApiGamesV1configurationAchievementsAchievementId = async (args: UpdateApiGamesV1configurationAchievementsAchievementIdArgs, options?: UpdateApiGamesV1configurationAchievementsAchievementIdOptions) => { const {baseUrl = "https://gamesconfiguration.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/games/v1configuration/achievements/${encodeURIComponent(String(args.achievementId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };