OnServerStatusPing.fromJson constructor

OnServerStatusPing.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory OnServerStatusPing.fromJson(Map<String, dynamic> json) => OnServerStatusPing(
    serverContext: Context.fromJson((json['ServerContext'] ?? {}) as Map<String, dynamic>),
    status: ServerStatus.fromValue((json['Status'] as num?)?.toInt() ?? 0),
    userCount: (json['UserCount'] as num?)?.toInt() ?? 0,
    clientCount: (json['ClientCount'] as num?)?.toInt() ?? 0,
    humanClientCount: (json['HumanClientCount'] as num?)?.toInt() ?? 0,
    idleTimeInSeconds: (json['IdleTimeInSeconds'] as num?)?.toInt() ?? 0,
    sentMessagesPerSecond: (json['SentMessagesPerSecond'] as num?)?.toDouble() ?? 0.0,
    sentMessagesBandwidth: (json['SentMessagesBandwidth'] as num?)?.toDouble() ?? 0.0,
    sentMessagesCount: (json['SentMessagesCount'] as num?)?.toInt() ?? 0,
    receivedMessagesPerSecond: (json['ReceivedMessagesPerSecond'] as num?)?.toDouble() ?? 0.0,
    receivedMessagesBandwidth: (json['ReceivedMessagesBandwidth'] as num?)?.toDouble() ?? 0.0,
    receivedMessagesCount: (json['ReceivedMessagesCount'] as num?)?.toInt() ?? 0,
    processCpuUsage: (json['ProcessCpuUsage'] as num?)?.toDouble() ?? 0.0,
    processMemoryUsedMb: (json['ProcessMemoryUsedMb'] as num?)?.toDouble() ?? 0.0,
    managedMemoryUsedMb: (json['ManagedMemoryUsedMb'] as num?)?.toDouble() ?? 0.0,
    memoryInfo: (json['MemoryInfo'] as String?) ?? '',
    isDoingBackgroundWork: (json['IsDoingBackgroundWork'] as bool?) ?? false,
);