/**
 * Interface of the server (auto-generated code)
 */
import {
	HTTPMimeType,
	HTTPRequestModel,
	RESTConfig,
	RESTRequestJson,
} from "../rest-tools";

import {
	HealthResult,
	isHealthResult,
} from "../model";

export namespace HealthCheck {

	/**
	 * Get the server state (health)
	 */
	export function getHealth({
			restConfig,
		}: {
		restConfig: RESTConfig,
	}): Promise<HealthResult> {
		return RESTRequestJson({
			restModel: {
				endPoint: "/health_check/",
				requestType: HTTPRequestModel.GET,
				accept: HTTPMimeType.JSON,
			},
			restConfig,
		}, isHealthResult);
	};
}
