export type DeleteApiApiAtlasV2OrgsOrgIdInvitesInvitationIdArgs = {envelope?: boolean | undefined, orgId: string, pretty?: boolean | undefined, invitationId: string}; export type DeleteApiApiAtlasV2OrgsOrgIdInvitesInvitationIdOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove One Invitation from One Organization * * DELETE /api/atlas/v2/orgs/{orgId}/invites/{invitationId} * * Also accepts auth: DigestAuth */ export const deleteApiApiAtlasV2OrgsOrgIdInvitesInvitationId = async (args: DeleteApiApiAtlasV2OrgsOrgIdInvitesInvitationIdArgs, options?: DeleteApiApiAtlasV2OrgsOrgIdInvitesInvitationIdOptions) => { const {baseUrl = "https://cloud.mongodb.com", fetch: fetchFn = fetch, ServiceAccounts} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.atlas.2023-01-01+json") if (args.envelope != null) query.append("envelope", String(args.envelope)) if (args.pretty != null) query.append("pretty", String(args.pretty)) if (ServiceAccounts !== undefined) headers.set('authorization', `Bearer ${ServiceAccounts}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/atlas/v2/orgs/${encodeURIComponent(String(args.orgId))}/invites/${encodeURIComponent(String(args.invitationId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };