export type DeleteApiV1AccountsAccountIdProfilesUserProfileIdArgs = {accountId: number, userProfileId: number}; export type DeleteApiV1AccountsAccountIdProfilesUserProfileIdOptions = {baseUrl: string, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove related profile from the account * * DELETE /v1/Accounts/{accountId}/profiles/{userProfileId} */ export const deleteApiV1AccountsAccountIdProfilesUserProfileId = async (args: DeleteApiV1AccountsAccountIdProfilesUserProfileIdArgs, options: DeleteApiV1AccountsAccountIdProfilesUserProfileIdOptions) => { const {baseUrl, 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(/\/+$/, '')}/v1/Accounts/${encodeURIComponent(String(args.accountId))}/profiles/${encodeURIComponent(String(args.userProfileId))}${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 };