export type UpdateApiV1OrgsOrgIdLookupTablesIdArgs = {org_id: string, id: string, body: {data: string}}; export type UpdateApiV1OrgsOrgIdLookupTablesIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates data and/or metadata of a Lookup Table for the given org and id. * * PUT /v1/orgs/{org_id}/lookup_tables/{id} */ export const updateApiV1OrgsOrgIdLookupTablesId = async (args: UpdateApiV1OrgsOrgIdLookupTablesIdArgs, options?: UpdateApiV1OrgsOrgIdLookupTablesIdOptions) => { const {baseUrl = "https://api.edgedelta.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/x-www-form-urlencoded") if (ApiKeyAuth !== undefined) headers.set("X-ED-API-Token", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orgs/${encodeURIComponent(String(args.org_id))}/lookup_tables/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: new URLSearchParams(Object.entries(args.body).flatMap(([key, value]) => (value == null ? [] : [[key, String(value)]])))}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };