export type DeleteApiApiV1SeedSeedNameDcDcArgs = {seed_name: string, dc: string}; export type DeleteApiApiV1SeedSeedNameDcDcOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the datacenter. * * DELETE /api/v1/seed/{seed_name}/dc/{dc} */ export const deleteApiApiV1SeedSeedNameDcDc = async (args: DeleteApiApiV1SeedSeedNameDcDcArgs, options: DeleteApiApiV1SeedSeedNameDcDcOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/seed/${encodeURIComponent(String(args.seed_name))}/dc/${encodeURIComponent(String(args.dc))}${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 };