export type DeleteApiV1PromotionsFacebookBusinessAssetsAdAccountUsersArgs = {adAccountId?: string | undefined, viaAdAccountId?: string | undefined, userId?: string | undefined}; export type DeleteApiV1PromotionsFacebookBusinessAssetsAdAccountUsersOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /v1/promotions/facebook/businessAssets/adAccountUsers */ export const deleteApiV1PromotionsFacebookBusinessAssetsAdAccountUsers = async (args: DeleteApiV1PromotionsFacebookBusinessAssetsAdAccountUsersArgs, options: DeleteApiV1PromotionsFacebookBusinessAssetsAdAccountUsersOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.adAccountId != null) query.append("adAccountId", String(args.adAccountId)) if (args.viaAdAccountId != null) query.append("viaAdAccountId", String(args.viaAdAccountId)) if (args.userId != null) query.append("userId", String(args.userId)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/promotions/facebook/businessAssets/adAccountUsers${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 (await res.json()) as unknown };