OpsItem.fromJson constructor

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

Implementation

factory OpsItem.fromJson(Map<String, dynamic> json) {
  return OpsItem(
    actualEndTime: timeStampFromJson(json['ActualEndTime']),
    actualStartTime: timeStampFromJson(json['ActualStartTime']),
    category: json['Category'] as String?,
    createdBy: json['CreatedBy'] as String?,
    createdTime: timeStampFromJson(json['CreatedTime']),
    description: json['Description'] as String?,
    lastModifiedBy: json['LastModifiedBy'] as String?,
    lastModifiedTime: timeStampFromJson(json['LastModifiedTime']),
    notifications: (json['Notifications'] as List?)
        ?.whereNotNull()
        .map((e) => OpsItemNotification.fromJson(e as Map<String, dynamic>))
        .toList(),
    operationalData: (json['OperationalData'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(
            k, OpsItemDataValue.fromJson(e as Map<String, dynamic>))),
    opsItemId: json['OpsItemId'] as String?,
    opsItemType: json['OpsItemType'] as String?,
    plannedEndTime: timeStampFromJson(json['PlannedEndTime']),
    plannedStartTime: timeStampFromJson(json['PlannedStartTime']),
    priority: json['Priority'] as int?,
    relatedOpsItems: (json['RelatedOpsItems'] as List?)
        ?.whereNotNull()
        .map((e) => RelatedOpsItem.fromJson(e as Map<String, dynamic>))
        .toList(),
    severity: json['Severity'] as String?,
    source: json['Source'] as String?,
    status: (json['Status'] as String?)?.toOpsItemStatus(),
    title: json['Title'] as String?,
    version: json['Version'] as String?,
  );
}