export type UpdateApiApiV1AdminMeteringConfigurationsOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Configures KKP metering tool. Only available in Kubermatic Enterprise Edition * * PUT /api/v1/admin/metering/configurations */ export const updateApiApiV1AdminMeteringConfigurations = async (options: UpdateApiApiV1AdminMeteringConfigurationsOptions) => { 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/admin/metering/configurations${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };