export type DeleteApiKafkaV3ClustersClusterIdLinksLinkNameArgs = {force?: boolean | undefined, validate_only?: boolean | undefined}; export type DeleteApiKafkaV3ClustersClusterIdLinksLinkNameOptions = {baseUrl?: string | undefined, resourceApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete the cluster link * * DELETE /kafka/v3/clusters/{cluster_id}/links/{link_name} * * Also accepts auth: external-access-token */ export const deleteApiKafkaV3ClustersClusterIdLinksLinkName = async (args: DeleteApiKafkaV3ClustersClusterIdLinksLinkNameArgs, options?: DeleteApiKafkaV3ClustersClusterIdLinksLinkNameOptions) => { const {baseUrl = "https://api.confluent.cloud", fetch: fetchFn = fetch, resourceApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.force != null) query.append("force", String(args.force)) if (args.validate_only != null) query.append("validate_only", String(args.validate_only)) if (resourceApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${resourceApiKey.username}:${resourceApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/kafka/v3/clusters/${encodeURIComponent(String(args.cluster_id))}/links/${encodeURIComponent(String(args.link_name))}${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 };