export type DeleteApiV1PlaygroundEndpointsIdArgs = {id: string}; export type DeleteApiV1PlaygroundEndpointsIdOptions = {baseUrl?: string | undefined, ProjectPrivateApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a playground endpoint * * DELETE /v1/playground-endpoints/{id} */ export const deleteApiV1PlaygroundEndpointsId = async (args: DeleteApiV1PlaygroundEndpointsIdArgs, options?: DeleteApiV1PlaygroundEndpointsIdOptions) => { const {baseUrl = "https://api.lunary.ai", fetch: fetchFn = fetch, ProjectPrivateApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ProjectPrivateApiKeyAuth !== undefined) headers.set('authorization', `Bearer ${ProjectPrivateApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/playground-endpoints/${encodeURIComponent(String(args.id))}${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 };