export type CreateApiApiSystemsSystemIdCommandBuiltinRestartArgs = {'x-org-id'?: string | undefined}; export type CreateApiApiSystemsSystemIdCommandBuiltinRestartOptions = {baseUrl?: string | undefined, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restart a System * * POST /api/systems/{system_id}/command/builtin/restart */ export const createApiApiSystemsSystemIdCommandBuiltinRestart = async (args: CreateApiApiSystemsSystemIdCommandBuiltinRestartArgs, options?: CreateApiApiSystemsSystemIdCommandBuiltinRestartOptions) => { const {baseUrl = "https://console.jumpcloud.com", fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-org-id'] != null) headers.set("x-org-id", String(args['x-org-id'])) if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/systems/${encodeURIComponent(String(args.system_id))}/command/builtin/restart${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };