fromJson static method

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

Returns a new Configuration instance and imports its values from json if it's non-null, null if json is null.

Implementation

static Configuration? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  DateTime? createdAt =
      json[r'createdAt'] == null ? null : DateTime.parse(json[r'createdAt']);
  if (createdAt != null && createdAt.isUtc == false) {
    createdAt = DateTime.parse('${json[r'createdAt']}Z');
  }

  DateTime? updatedAt =
      json[r'updatedAt'] == null ? null : DateTime.parse(json[r'updatedAt']);
  if (updatedAt != null && updatedAt.isUtc == false) {
    updatedAt = DateTime.parse('${json[r'updatedAt']}Z');
  }

  return Configuration(
    links: ConfigurationLinks.fromJson(json[r'_links']),
    createdAt: createdAt,
    description: json[r'description'],
    id: json[r'id'],
    memberType: ConfigurationMemberType.fromJson(json[r'memberType']),
    name: json[r'name'],
    operationType:
        ConfigurationOperationType.fromJson(json[r'operationType']),
    placeType: ConfigurationPlaceType.fromJson(json[r'placeType']),
    reportType: ConfigurationReportType.fromJson(json[r'reportType']),
    type: json[r'type'],
    updatedAt: updatedAt,
  );
}