export type DeleteApiSchemasNameArgs = {name: string, fullName?: string | undefined, force?: boolean | undefined}; export type DeleteApiSchemasNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Deletes the specified schema from the parent catalog. The caller must be the owner * * DELETE /schemas/{name} */ export const deleteApiSchemasName = async (args: DeleteApiSchemasNameArgs, options: DeleteApiSchemasNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.fullName != null) query.append("fullName", String(args.fullName)) if (args.force != null) query.append("force", String(args.force)) const url = `${baseUrl.replace(/\/+$/, '')}/schemas/${encodeURIComponent(String(args.name))}${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 };