export type DeleteApiV1AiGatewaysGatewayIdConfigStoresConfigStoreIdOrNameArgs = {force?: boolean | undefined}; export type DeleteApiV1AiGatewaysGatewayIdConfigStoresConfigStoreIdOrNameOptions = {baseUrl?: string | undefined, personalAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an AI Gateway Config Store * * DELETE /v1/ai-gateways/{gatewayId}/config-stores/{configStoreIdOrName} * * Also accepts auth: systemAccountAccessToken, konnectAccessToken, serviceAccessToken */ export const deleteApiV1AiGatewaysGatewayIdConfigStoresConfigStoreIdOrName = async (args: DeleteApiV1AiGatewaysGatewayIdConfigStoresConfigStoreIdOrNameArgs, options?: DeleteApiV1AiGatewaysGatewayIdConfigStoresConfigStoreIdOrNameOptions) => { const {baseUrl = "https://global.api.konghq.com", fetch: fetchFn = fetch, personalAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.force != null) query.append("force", String(args.force)) if (personalAccessToken !== undefined) headers.set('authorization', `Bearer ${personalAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/ai-gateways/${encodeURIComponent(String(args.gatewayId))}/config-stores/${encodeURIComponent(String(args.configStoreIdOrName))}${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 };