export type GetApiOrgStorageListsFetchArgs = {'X-Phantombuster-Org'?: string | undefined, id: string}; export type GetApiOrgStorageListsFetchOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get one list by ID - Beta. * * GET /org-storage/lists/fetch */ export const getApiOrgStorageListsFetch = async (args: GetApiOrgStorageListsFetchArgs, options?: GetApiOrgStorageListsFetchOptions) => { const {baseUrl = "https://api.phantombuster.com/api/v2", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Phantombuster-Org'] != null) headers.set("X-Phantombuster-Org", String(args['X-Phantombuster-Org'])) if (args.id != null) query.append("id", String(args.id)) if (apiKeyAuth !== undefined) headers.set("X-Phantombuster-Key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/org-storage/lists/fetch${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };