export type GetApiManagementPerformanceSlowMethodsArgs = {limit?: number | undefined, thresholdMs?: number | undefined}; export type GetApiManagementPerformanceSlowMethodsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /management/performance/slow-methods */ export const getApiManagementPerformanceSlowMethods = async (args: GetApiManagementPerformanceSlowMethodsArgs, options?: GetApiManagementPerformanceSlowMethodsOptions) => { const {baseUrl = "http://167.86.118.166:32080", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.limit != null) query.append("limit", String(args.limit)) if (args.thresholdMs != null) query.append("thresholdMs", String(args.thresholdMs)) const url = `${baseUrl.replace(/\/+$/, '')}/management/performance/slow-methods${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };