export type DeleteApiV3BoardsBoardIdAssetsArgs = {'Accept-Language'?: string | undefined, board_id: string, asset_ids?: Array | undefined}; export type DeleteApiV3BoardsBoardIdAssetsOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove assets from a board * * DELETE /v3/boards/{board_id}/assets * * Also accepts auth: OAuth2 */ export const deleteApiV3BoardsBoardIdAssets = async (args: DeleteApiV3BoardsBoardIdAssetsArgs, options: DeleteApiV3BoardsBoardIdAssetsOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) for (const item of args.asset_ids ?? []) query.append("asset_ids", String(item)) if (ApiKey !== undefined) headers.set("Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/boards/${encodeURIComponent(String(args.board_id))}/assets${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 };