export type BoardInfo = {name: string, description?: (string | null) | undefined}; export type UpdateApiV3BoardsBoardIdArgs = {'Accept-Language'?: string | undefined, board_id: string, body: BoardInfo}; export type UpdateApiV3BoardsBoardIdOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a board * * PUT /v3/boards/{board_id} * * Also accepts auth: OAuth2 */ export const updateApiV3BoardsBoardId = async (args: UpdateApiV3BoardsBoardIdArgs, options: UpdateApiV3BoardsBoardIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) if (ApiKey !== undefined) headers.set("Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/boards/${encodeURIComponent(String(args.board_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };