export type DeleteApiCompanyNamedListsListNameItemIdArgs = {listName: string, itemId: string}; export type DeleteApiCompanyNamedListsListNameItemIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete an item from an existing list. * * DELETE /company/named-lists/{listName}/{itemId} * * Also accepts auth: Bearer */ export const deleteApiCompanyNamedListsListNameItemId = async (args: DeleteApiCompanyNamedListsListNameItemIdArgs, options?: DeleteApiCompanyNamedListsListNameItemIdOptions) => { const {baseUrl = "https://api.hibob.com/v1", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/company/named-lists/${encodeURIComponent(String(args.listName))}/${encodeURIComponent(String(args.itemId))}${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 };