export type DeleteApiAccountInstitutionRolesAccountIdGroupIdRoleIdArgs = {account_id: number, group_id: number, role_id: number}; export type DeleteApiAccountInstitutionRolesAccountIdGroupIdRoleIdOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Institution Account Group Role * * DELETE /account/institution/roles/{account_id}/{group_id}/{role_id} */ export const deleteApiAccountInstitutionRolesAccountIdGroupIdRoleId = async (args: DeleteApiAccountInstitutionRolesAccountIdGroupIdRoleIdArgs, options?: DeleteApiAccountInstitutionRolesAccountIdGroupIdRoleIdOptions) => { const {baseUrl = "https://api.figshare.com/v2", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/account/institution/roles/${encodeURIComponent(String(args.account_id))}/${encodeURIComponent(String(args.group_id))}/${encodeURIComponent(String(args.role_id))}${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 undefined };