export type DeleteApiV1ApplicationsApplicationIdCampaignsCampaignIdStoresBudgetsArgs = {applicationId: number, campaignId: number, action?: 'setDiscount' | undefined, period?: ('overall' | 'daily' | 'weekly' | 'monthly' | 'yearly') | undefined}; export type DeleteApiV1ApplicationsApplicationIdCampaignsCampaignIdStoresBudgetsOptions = {baseUrl?: string | undefined, managerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete campaign store budgets * * DELETE /v1/applications/{applicationId}/campaigns/{campaignId}/stores/budgets * * Also accepts auth: management_key */ export const deleteApiV1ApplicationsApplicationIdCampaignsCampaignIdStoresBudgets = async (args: DeleteApiV1ApplicationsApplicationIdCampaignsCampaignIdStoresBudgetsArgs, options?: DeleteApiV1ApplicationsApplicationIdCampaignsCampaignIdStoresBudgetsOptions) => { const {baseUrl = "https://yourbaseurl.talon.one", fetch: fetchFn = fetch, managerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.action != null) query.append("action", String(args.action)) if (args.period != null) query.append("period", String(args.period)) if (managerAuth !== undefined) headers.set("Authorization", managerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/applications/${encodeURIComponent(String(args.applicationId))}/campaigns/${encodeURIComponent(String(args.campaignId))}/stores/budgets${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 };