export type DeleteApiV1PriceTemplatesPriceTemplateIdArgs = {price_template_id: string}; export type DeleteApiV1PriceTemplatesPriceTemplateIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Price Template * * DELETE /v1/price_templates/{price_template_id} */ export const deleteApiV1PriceTemplatesPriceTemplateId = async (args: DeleteApiV1PriceTemplatesPriceTemplateIdArgs, options?: DeleteApiV1PriceTemplatesPriceTemplateIdOptions) => { const {baseUrl = "https://api.aghanim.com/s2s", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/price_templates/${encodeURIComponent(String(args.price_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 };