export type CreateApiV01UserInvitationsAppsInvitationTokenRejectArgs = {invitation_token: string, body: Record}; export type CreateApiV01UserInvitationsAppsInvitationTokenRejectOptions = {baseUrl?: string | undefined, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Rejects a pending invitation for the specified user * * POST /v0.1/user/invitations/apps/{invitation_token}/reject */ export const createApiV01UserInvitationsAppsInvitationTokenReject = async (args: CreateApiV01UserInvitationsAppsInvitationTokenRejectArgs, options?: CreateApiV01UserInvitationsAppsInvitationTokenRejectOptions) => { const {baseUrl = "https://api.appcenter.ms", fetch: fetchFn = fetch, APIToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIToken !== undefined) headers.set("X-API-Token", APIToken) const url = `${baseUrl.replace(/\/+$/, '')}/v0.1/user/invitations/apps/${encodeURIComponent(String(args.invitation_token))}/reject${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };