export type CreateApiV01OrgsOrgNameInvitationsEmailResendArgs = {org_name: string, email: string, body: {role?: ('admin' | 'collaborator' | 'member') | undefined}}; export type CreateApiV01OrgsOrgNameInvitationsEmailResendOptions = {baseUrl?: string | undefined, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancels an existing organization invitation for the user and sends a new one * * POST /v0.1/orgs/{org_name}/invitations/{email}/resend */ export const createApiV01OrgsOrgNameInvitationsEmailResend = async (args: CreateApiV01OrgsOrgNameInvitationsEmailResendArgs, options?: CreateApiV01OrgsOrgNameInvitationsEmailResendOptions) => { 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/orgs/${encodeURIComponent(String(args.org_name))}/invitations/${encodeURIComponent(String(args.email))}/resend${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 };