// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; export class HealthCheck extends APIResource { /** * Returns the health status of the API to verify it is running properly */ status( params: HealthCheckStatusParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.get('/health-check', { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } /** * Tests the connection to AIP service with API key authentication */ testAuth( params: HealthCheckTestAuthParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.get('/health-check/auth-test', { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response model for health check API. * * Attributes: message (str): The health check status message. build_id (str | * None): The build ID of the application. Defaults to None. status (str | None): * The health check status. Defaults to None. version_number (str | None): The * version number of the application. Defaults to None. */ export interface Healthcheck { /** * The health check status message */ message: string; /** * The build ID of the application */ build_id?: string | null; /** * The health check status */ status?: string | null; /** * The version number of the application */ version_number?: string | null; } export interface HealthCheckStatusParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export interface HealthCheckTestAuthParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace HealthCheck { export { type Healthcheck as Healthcheck, type HealthCheckStatusParams as HealthCheckStatusParams, type HealthCheckTestAuthParams as HealthCheckTestAuthParams, }; }