export type DeleteApiAccessControlUsersUserIdProfileOptionsKeyOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Profile Option * * DELETE /access_control/users/{user_id}/profile_options/{key} */ export const deleteApiAccessControlUsersUserIdProfileOptionsKey = async (options?: DeleteApiAccessControlUsersUserIdProfileOptionsKeyOptions) => { const {baseUrl = "https://api.treasuredata.com/v3", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set('authorization', `TD1 ${ApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/access_control/users/${encodeURIComponent(String(args.user_id))}/profile_options/${encodeURIComponent(String(args.key))}${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 };