export type DeleteApiKafkaQuotasV1ClientQuotasIdArgs = {id: string}; export type DeleteApiKafkaQuotasV1ClientQuotasIdOptions = {baseUrl?: string | undefined, cloudApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Client Quota * * DELETE /kafka-quotas/v1/client-quotas/{id} * * Also accepts auth: global-api-key, confluent-sts-access-token */ export const deleteApiKafkaQuotasV1ClientQuotasId = async (args: DeleteApiKafkaQuotasV1ClientQuotasIdArgs, options?: DeleteApiKafkaQuotasV1ClientQuotasIdOptions) => { const {baseUrl = "https://api.confluent.cloud", fetch: fetchFn = fetch, cloudApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (cloudApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${cloudApiKey.username}:${cloudApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/kafka-quotas/v1/client-quotas/${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 };