export type UpdateApiRoomsRoomNameThemeLogoArgs = {roomName: string, body: {theme?: 'default' | undefined}}; export type UpdateApiRoomsRoomNameThemeLogoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set room logo * * PUT /rooms/{roomName}/theme/logo */ export const updateApiRoomsRoomNameThemeLogo = async (args: UpdateApiRoomsRoomNameThemeLogoArgs, options?: UpdateApiRoomsRoomNameThemeLogoOptions) => { const {baseUrl = "https://api.whereby.dev/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/rooms/${encodeURIComponent(String(args.roomName))}/theme/logo${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 };