export type UpdateApiPublicDebugV1LoggersModeTracingEnabledArgs = {enabled: boolean}; export type UpdateApiPublicDebugV1LoggersModeTracingEnabledOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable or disable tracing mode * * PUT /public/debug/v1/loggers-mode/tracing/{enabled} */ export const updateApiPublicDebugV1LoggersModeTracingEnabled = async (args: UpdateApiPublicDebugV1LoggersModeTracingEnabledArgs, options: UpdateApiPublicDebugV1LoggersModeTracingEnabledOptions) => { 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/debug/v1/loggers-mode/tracing/${encodeURIComponent(String(args.enabled))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };