text: const Service = require('../service.js');
  const AppwriteException = require('../exception.js');
  
  class Health extends Service {
  
      /**
       * Get HTTP
       *
       * Check the Appwrite HTTP server is up and responsive.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async get() {
          let path = '/health';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Anti virus
       *
       * Check the Appwrite Anti Virus server is up and connection is successful.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getAntiVirus() {
          let path = '/health/anti-virus';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Cache
       *
       * Check the Appwrite in-memory cache server is up and connection is
       * successful.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getCache() {
          let path = '/health/cache';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get DB
       *
       * Check the Appwrite database server is up and connection is successful.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getDB() {
          let path = '/health/db';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Certificates Queue
       *
       * Get the number of certificates that are waiting to be issued against
       * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
       * server.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueCertificates() {
          let path = '/health/queue/certificates';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Functions Queue
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueFunctions() {
          let path = '/health/queue/functions';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Logs Queue
       *
       * Get the number of logs that are waiting to be processed in the Appwrite
       * internal queue server.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueLogs() {
          let path = '/health/queue/logs';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Tasks Queue
       *
       * Get the number of tasks that are waiting to be processed in the Appwrite
       * internal queue server.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueTasks() {
          let path = '/health/queue/tasks';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Usage Queue
       *
       * Get the number of usage stats that are waiting to be processed in the
       * Appwrite internal queue server.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueUsage() {
          let path = '/health/queue/usage';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Webhooks Queue
       *
       * Get the number of webhooks that are waiting to be processed in the Appwrite
       * internal queue server.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getQueueWebhooks() {
          let path = '/health/queue/webhooks';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Local Storage
       *
       * Check the Appwrite local storage device is up and connection is successful.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getStorageLocal() {
          let path = '/health/storage/local';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  
      /**
       * Get Time
       *
       * Check the Appwrite server time is synced with Google remote NTP server. We
       * use this technology to smoothly handle leap seconds with no disruptive
       * events. The [Network Time
       * Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
       * used by hundreds of millions of computers and devices to synchronize their
       * clocks over the Internet. If your computer sets its own clock, it likely
       * uses NTP.
       *
       * @throws {AppwriteException}
       * @returns {Promise}
       */
      async getTime() {
          let path = '/health/time';
          let payload = {};
  
          return await this.client.call('get', path, {
              'content-type': 'application/json',
          }, payload);
      }
  }
  
  module.exports = Health;