AuditRecordCreate.fromJson constructor

AuditRecordCreate.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory AuditRecordCreate.fromJson(Map<String, Object?> json) {
  return AuditRecordCreate(
    author: json[r'author'] != null
        ? AuditRecordCreateAuthor.fromJson(
            json[r'author']! as Map<String, Object?>)
        : null,
    remoteAddress: json[r'remoteAddress'] as String? ?? '',
    creationDate: (json[r'creationDate'] as num?)?.toInt(),
    summary: json[r'summary'] as String?,
    description: json[r'description'] as String?,
    category: json[r'category'] as String?,
    sysAdmin: json[r'sysAdmin'] as bool? ?? false,
    affectedObject: json[r'affectedObject'] != null
        ? AffectedObject.fromJson(
            json[r'affectedObject']! as Map<String, Object?>)
        : null,
    changedValues: (json[r'changedValues'] as List<Object?>?)
            ?.map((i) =>
                ChangedValue.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    associatedObjects: (json[r'associatedObjects'] as List<Object?>?)
            ?.map((i) => AffectedObject.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}