export type DeleteApiPartnerAppAppIdTemplateElementNameArgs = {Authorization?: string | undefined, appId: string, elementName: string}; export type DeleteApiPartnerAppAppIdTemplateElementNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * App | Delete Template * * DELETE /partner/app/{appId}/template/{elementName} */ export const deleteApiPartnerAppAppIdTemplateElementName = async (args: DeleteApiPartnerAppAppIdTemplateElementNameArgs, options?: DeleteApiPartnerAppAppIdTemplateElementNameOptions) => { const {baseUrl = "https://partner.gupshup.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/partner/app/${encodeURIComponent(String(args.appId))}/template/${encodeURIComponent(String(args.elementName))}${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 };