export type DeleteApiV1AiGatewaysGatewayIdConsumersConsumerIdCredentialsCredentialIdOptions = {baseUrl?: string | undefined, personalAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an AI Gateway Consumer Credential * * DELETE /v1/ai-gateways/{gatewayId}/consumers/{consumerId}/credentials/{credentialId} * * Also accepts auth: systemAccountAccessToken, konnectAccessToken, serviceAccessToken */ export const deleteApiV1AiGatewaysGatewayIdConsumersConsumerIdCredentialsCredentialId = async (options?: DeleteApiV1AiGatewaysGatewayIdConsumersConsumerIdCredentialsCredentialIdOptions) => { const {baseUrl = "https://global.api.konghq.com", fetch: fetchFn = fetch, personalAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (personalAccessToken !== undefined) headers.set('authorization', `Bearer ${personalAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/ai-gateways/${encodeURIComponent(String(args.gatewayId))}/consumers/${encodeURIComponent(String(args.consumerId))}/credentials/${encodeURIComponent(String(args.credentialId))}${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 };