export type DeleteApiJourneysTemplateIdTemplatesNotificationIdArgs = {templateId: string, notificationId: string}; export type DeleteApiJourneysTemplateIdTemplatesNotificationIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive a journey-scoped notification template * * DELETE /journeys/{templateId}/templates/{notificationId} */ export const deleteApiJourneysTemplateIdTemplatesNotificationId = async (args: DeleteApiJourneysTemplateIdTemplatesNotificationIdArgs, options?: DeleteApiJourneysTemplateIdTemplatesNotificationIdOptions) => { const {baseUrl = "https://api.courier.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/journeys/${encodeURIComponent(String(args.templateId))}/templates/${encodeURIComponent(String(args.notificationId))}${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 };