export type DeleteApiV1RoomsRoomSidBookmarksBookmarkSidArgs = {room_sid: string, bookmark_sid: string}; export type DeleteApiV1RoomsRoomSidBookmarksBookmarkSidOptions = {baseUrl?: string | undefined, apiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete Bookmark * * DELETE /v1/rooms/{room_sid}/bookmarks/{bookmark_sid} * * Also accepts auth: bearer-auth */ export const deleteApiV1RoomsRoomSidBookmarksBookmarkSid = async (args: DeleteApiV1RoomsRoomSidBookmarksBookmarkSidArgs, options?: DeleteApiV1RoomsRoomSidBookmarksBookmarkSidOptions) => { const {baseUrl = "https://api.prod-us.streem.cloud", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (apiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${apiKey.username}:${apiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/rooms/${encodeURIComponent(String(args.room_sid))}/bookmarks/${encodeURIComponent(String(args.bookmark_sid))}${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 (await res.json()) as unknown };