export type DeleteApiV1NamespacesNamespaceApplicationsAppnameArgs = {namespace: string, appname: string}; export type DeleteApiV1NamespacesNamespaceApplicationsAppnameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * create or update oam application in the specified namespace * * DELETE /v1/namespaces/{namespace}/applications/{appname} */ export const deleteApiV1NamespacesNamespaceApplicationsAppname = async (args: DeleteApiV1NamespacesNamespaceApplicationsAppnameArgs, options: DeleteApiV1NamespacesNamespaceApplicationsAppnameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/namespaces/${encodeURIComponent(String(args.namespace))}/applications/${encodeURIComponent(String(args.appname))}${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 };