export type DeleteApiOndemandPagesOndemandIdPromotionsPromotionIdArgs = {ondemand_id: number, promotion_id: number}; export type DeleteApiOndemandPagesOndemandIdPromotionsPromotionIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a promotion from an On Demand page * * DELETE /ondemand/pages/{ondemand_id}/promotions/{promotion_id} */ export const deleteApiOndemandPagesOndemandIdPromotionsPromotionId = async (args: DeleteApiOndemandPagesOndemandIdPromotionsPromotionIdArgs, options?: DeleteApiOndemandPagesOndemandIdPromotionsPromotionIdOptions) => { 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(/\/+$/, '')}/ondemand/pages/${encodeURIComponent(String(args.ondemand_id))}/promotions/${encodeURIComponent(String(args.promotion_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 };