export type DeleteApi20220609CollectionsCollectionIdTemplatesTemplateIdArgs = {collectionId: string, templateId: string}; export type DeleteApi20220609CollectionsCollectionIdTemplatesTemplateIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Template * * DELETE /2022-06-09/collections/{collectionId}/templates/{templateId} */ export const deleteApi20220609CollectionsCollectionIdTemplatesTemplateId = async (args: DeleteApi20220609CollectionsCollectionIdTemplatesTemplateIdArgs, options?: DeleteApi20220609CollectionsCollectionIdTemplatesTemplateIdOptions) => { const {baseUrl = "https://staging.crossmint.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/2022-06-09/collections/${encodeURIComponent(String(args.collectionId))}/templates/${encodeURIComponent(String(args.templateId))}${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 };