fromJson static method

HealthDto? fromJson(
  1. dynamic value
)

Returns a new HealthDto instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static HealthDto? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return HealthDto(
      serverTime: mapDateTime(json, r'serverTime', ''),
      health: HealthStatus.fromJson(json[r'health']),
      apiVersion: mapValueOfType<String>(json, r'apiVersion'),
      connectionString: mapValueOfType<String>(json, r'connectionString'),
      envConnectionString:
          mapValueOfType<String>(json, r'envConnectionString'),
    );
  }
  return null;
}