export type DeleteApiApiV2CareerhubUpskillPlanTemplatesPlanIdArgs = {Authorization: string, planId: string}; export type DeleteApiApiV2CareerhubUpskillPlanTemplatesPlanIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Upskill Plan Template * * DELETE /api/v2/careerhub/upskill-plan-templates/{planId} */ export const deleteApiApiV2CareerhubUpskillPlanTemplatesPlanId = async (args: DeleteApiApiV2CareerhubUpskillPlanTemplatesPlanIdArgs, options?: DeleteApiApiV2CareerhubUpskillPlanTemplatesPlanIdOptions) => { const {baseUrl = "https://apiv2.eightfold.ai", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/careerhub/upskill-plan-templates/${encodeURIComponent(String(args.planId))}${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 };