export type AlterConfigBatchRequestData = {data: Array<{name: string, value?: (string | null) | undefined, operation?: (string | null) | undefined}>, validate_only?: boolean | undefined}; export type CreateApiClustersClusterIdBrokersBrokerIdConfigsAlterArgs = {body: AlterConfigBatchRequestData}; export type CreateApiClustersClusterIdBrokersBrokerIdConfigsAlterOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Batch Alter Broker Configs * * POST /clusters/{cluster_id}/brokers/{broker_id}/configs:alter */ export const createApiClustersClusterIdBrokersBrokerIdConfigsAlter = async (args: CreateApiClustersClusterIdBrokersBrokerIdConfigsAlterArgs, options?: CreateApiClustersClusterIdBrokersBrokerIdConfigsAlterOptions) => { const {baseUrl = "http://localhost:8082/v3", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/clusters/${encodeURIComponent(String(args.cluster_id))}/brokers/${encodeURIComponent(String(args.broker_id))}/configs:alter${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };