export type DeleteApiUsersUserIdProjectsProjectIdArgs = {project_id: number, user_id: number, should_delete_clips?: boolean | undefined}; export type DeleteApiUsersUserIdProjectsProjectIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a project * * DELETE /users/{user_id}/projects/{project_id} */ export const deleteApiUsersUserIdProjectsProjectId = async (args: DeleteApiUsersUserIdProjectsProjectIdArgs, options?: DeleteApiUsersUserIdProjectsProjectIdOptions) => { 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 (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/users/${encodeURIComponent(String(args.user_id))}/projects/${encodeURIComponent(String(args.project_id))}${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 };