export type GetApiGamesV1configurationApplicationsApplicationIdAchievementsArgs = {applicationId: string, maxResults?: number | undefined, pageToken?: string | undefined}; export type GetApiGamesV1configurationApplicationsApplicationIdAchievementsOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns a list of the achievement configurations in this application. * * GET /games/v1configuration/applications/{applicationId}/achievements */ export const getApiGamesV1configurationApplicationsApplicationIdAchievements = async (args: GetApiGamesV1configurationApplicationsApplicationIdAchievementsArgs, options?: GetApiGamesV1configurationApplicationsApplicationIdAchievementsOptions) => { const {baseUrl = "https://gamesconfiguration.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.maxResults != null) query.append("maxResults", String(args.maxResults)) if (args.pageToken != null) query.append("pageToken", String(args.pageToken)) if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/games/v1configuration/applications/${encodeURIComponent(String(args.applicationId))}/achievements${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 res.blob() };