export type UpdateApiMeProjectsProjectIdVideosArgs = {project_id: number, uris: string}; export type UpdateApiMeProjectsProjectIdVideosOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add a list of videos to a project * * PUT /me/projects/{project_id}/videos */ export const updateApiMeProjectsProjectIdVideos = async (args: UpdateApiMeProjectsProjectIdVideosArgs, options?: UpdateApiMeProjectsProjectIdVideosOptions) => { const {baseUrl = "https://api.vimeo.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.uris != null) query.append("uris", String(args.uris)) if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/me/projects/${encodeURIComponent(String(args.project_id))}/videos${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };