export type GetApiGamesV1configurationLeaderboardsLeaderboardIdArgs = {leaderboardId: string}; export type GetApiGamesV1configurationLeaderboardsLeaderboardIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieves the metadata of the leaderboard configuration with the given ID. * * GET /games/v1configuration/leaderboards/{leaderboardId} */ export const getApiGamesV1configurationLeaderboardsLeaderboardId = async (args: GetApiGamesV1configurationLeaderboardsLeaderboardIdArgs, options?: GetApiGamesV1configurationLeaderboardsLeaderboardIdOptions) => { const {baseUrl = "https://gamesconfiguration.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/v1configuration/leaderboards/${encodeURIComponent(String(args.leaderboardId))}${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() };