export type CreateApiV2ClubsClubIdInviteXuidArgs = {clubId: string, xuid: string}; export type CreateApiV2ClubsClubIdInviteXuidOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Invite someone to a club * * POST /v2/clubs/{clubId}/invite/{xuid} */ export const createApiV2ClubsClubIdInviteXuid = async (args: CreateApiV2ClubsClubIdInviteXuidArgs, options?: CreateApiV2ClubsClubIdInviteXuidOptions) => { const {baseUrl = "https://api.xbl.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/clubs/${encodeURIComponent(String(args.clubId))}/invite/${encodeURIComponent(String(args.xuid))}${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 undefined };