export type DeleteApiMeProjectsProjectIdVideosArgs = {project_id: number, should_delete_clips?: boolean | undefined, uris: string}; export type DeleteApiMeProjectsProjectIdVideosOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a list of videos from a project * * DELETE /me/projects/{project_id}/videos */ export const deleteApiMeProjectsProjectIdVideos = async (args: DeleteApiMeProjectsProjectIdVideosArgs, options?: DeleteApiMeProjectsProjectIdVideosOptions) => { const {baseUrl = "https://api.vimeo.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.should_delete_clips != null) query.append("should_delete_clips", String(args.should_delete_clips)) 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: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };