export type DeleteApiVideosVideoIdPrivacyUsersUserIdArgs = {user_id: number, video_id: number}; export type DeleteApiVideosVideoIdPrivacyUsersUserIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restrict a user from viewing a private video * * DELETE /videos/{video_id}/privacy/users/{user_id} */ export const deleteApiVideosVideoIdPrivacyUsersUserId = async (args: DeleteApiVideosVideoIdPrivacyUsersUserIdArgs, options?: DeleteApiVideosVideoIdPrivacyUsersUserIdOptions) => { const {baseUrl = "https://api.vimeo.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/videos/${encodeURIComponent(String(args.video_id))}/privacy/users/${encodeURIComponent(String(args.user_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 };