export type DeleteApiV3DeploymentsIdArgs = {id: string}; export type DeleteApiV3DeploymentsIdOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a deployment by its ID. * * DELETE /v3/deployments/{id} */ export const deleteApiV3DeploymentsId = async (args: DeleteApiV3DeploymentsIdArgs, options: DeleteApiV3DeploymentsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) query.set("api_key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/deployments/${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 };