export type DeleteApiPublicV1ClustersClusterNameConsumergroupsConsumerGroupArgs = {clusterName: string, consumerGroup: string}; export type DeleteApiPublicV1ClustersClusterNameConsumergroupsConsumerGroupOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete consumer group * * DELETE /public/v1/clusters/{clusterName}/consumergroups/{consumerGroup} */ export const deleteApiPublicV1ClustersClusterNameConsumergroupsConsumerGroup = async (args: DeleteApiPublicV1ClustersClusterNameConsumergroupsConsumerGroupArgs, options: DeleteApiPublicV1ClustersClusterNameConsumergroupsConsumerGroupOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/clusters/${encodeURIComponent(String(args.clusterName))}/consumergroups/${encodeURIComponent(String(args.consumerGroup))}${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 };