export type DeleteApiDemandAccountsAccountIdProfilingTemplatesProfileTemplateIdArgs = {locales?: string | undefined}; export type DeleteApiDemandAccountsAccountIdProfilingTemplatesProfileTemplateIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a profile template * * DELETE /demand/accounts/{account_id}/profiling-templates/{profile_template_id} */ export const deleteApiDemandAccountsAccountIdProfilingTemplatesProfileTemplateId = async (args: DeleteApiDemandAccountsAccountIdProfilingTemplatesProfileTemplateIdArgs, options?: DeleteApiDemandAccountsAccountIdProfilingTemplatesProfileTemplateIdOptions) => { const {baseUrl = "https://api.cint.com/v1", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.locales != null) query.append("locales", String(args.locales)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/demand/accounts/${encodeURIComponent(String(args.account_id))}/profiling-templates/${encodeURIComponent(String(args.profile_template_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 };