export type GetApiSysteminsightsTpmInfoArgs = {skip?: number | undefined, sort?: Array | undefined, filter?: Array | undefined, 'x-org-id'?: string | undefined, limit?: number | undefined}; export type GetApiSysteminsightsTpmInfoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List System Insights TPM Info * * GET /systeminsights/tpm_info */ export const getApiSysteminsightsTpmInfo = async (args: GetApiSysteminsightsTpmInfoArgs, options?: GetApiSysteminsightsTpmInfoOptions) => { const {baseUrl = "https://console.jumpcloud.com/api/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/html") if (args.skip != null) query.append("skip", String(args.skip)) if (args.sort != null) query.append("sort", args.sort.join(',')) if (args.filter != null) query.append("filter", args.filter.join(',')) if (args['x-org-id'] != null) headers.set("x-org-id", String(args['x-org-id'])) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/systeminsights/tpm_info${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.text() };