export type UpdateApiInternalV1DashboardsProjectIdDashboardIdPinnedArgs = {project_id: number, dashboard_id: number}; export type UpdateApiInternalV1DashboardsProjectIdDashboardIdPinnedOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Pin a dashboard * * PUT /internal/v1/dashboards/{project_id}/{dashboard_id}/pinned * * Also accepts auth: authTokenQuery */ export const updateApiInternalV1DashboardsProjectIdDashboardIdPinned = async (args: UpdateApiInternalV1DashboardsProjectIdDashboardIdPinnedArgs, options?: UpdateApiInternalV1DashboardsProjectIdDashboardIdPinnedOptions) => { const {baseUrl = "https://api.uptrace.dev", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/internal/v1/dashboards/${encodeURIComponent(String(args.project_id))}/${encodeURIComponent(String(args.dashboard_id))}/pinned${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 };