getPingWithHttpInfo method

Future<Response> getPingWithHttpInfo({
  1. bool? getServerStatus,
  2. String? deviceId,
})

Check system health

Check if the server is up and healthy based on the configuration setting GoRoutineHealthThreshold. If GoRoutineHealthThreshold and the number of goroutines on the server exceeds that threshold the server is considered unhealthy. If GoRoutineHealthThreshold is not set or the number of goroutines is below the threshold the server is considered healthy. Minimum server version: 3.10 If a "device_id" is passed in the query, it will test the Push Notification Proxy in order to discover whether the device is able to receive notifications. The response will have a "CanReceiveNotifications" property with one of the following values: - true: It can receive notifications - false: It cannot receive notifications - unknown: There has been an unknown error, and it is not certain whether it can receive notifications. Minimum server version: 6.5 ##### Permissions None.

Note: This method returns the HTTP Response.

Parameters:

  • bool getServerStatus: Check the status of the database and file storage as well

  • String deviceId: Check whether this device id can receive push notifications

Implementation

Future<Response> getPingWithHttpInfo({
  bool? getServerStatus,
  String? deviceId,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/system/ping';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (getServerStatus != null) {
    queryParams.addAll(_queryParams('', 'get_server_status', getServerStatus));
  }
  if (deviceId != null) {
    queryParams.addAll(_queryParams('', 'device_id', deviceId));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}