export type UpdateApiUsersUserIdAlbumsAlbumIdVideosArgs = {album_id: number, user_id: number, body: {videos: string}}; export type UpdateApiUsersUserIdAlbumsAlbumIdVideosOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace all the videos in an album * * PUT /users/{user_id}/albums/{album_id}/videos */ export const updateApiUsersUserIdAlbumsAlbumIdVideos = async (args: UpdateApiUsersUserIdAlbumsAlbumIdVideosArgs, options?: UpdateApiUsersUserIdAlbumsAlbumIdVideosOptions) => { const {baseUrl = "https://api.vimeo.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/users/${encodeURIComponent(String(args.user_id))}/albums/${encodeURIComponent(String(args.album_id))}/videos${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 };