fromJson static method

ModelInfo fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static ModelInfo fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return ModelInfo(
      assetModelId: mapValueOfType<int>(json, r'AssetModelId'),
      assetId: mapValueOfType<int>(json, r'AssetId'),
      name: mapValueOfType<String>(json, r'Name'),
      revision: mapValueOfType<String>(json, r'Revision'),
      status: mapValueOfType<String>(json, r'Status'),
      isCurrent: mapValueOfType<bool>(json, r'IsCurrent'),
      uploadedById: mapValueOfType<String>(json, r'UploadedById'),
      segmentName: mapValueOfType<String>(json, r'SegmentName'),
      segmentId: mapValueOfType<String>(json, r'SegmentId'),
      assetName: mapValueOfType<String>(json, r'AssetName'),
      modelPath: mapValueOfType<String>(json, r'ModelPath'),
      modelSize: mapValueOfType<int>(json, r'ModelSize'),
      oneMeter: mapValueOfType<double>(json, r'OneMeter'),
      originalAuthorId: mapValueOfType<int>(json, r'OriginalAuthorId'),
      dateUploaded: mapDateTime(json, r'DateUploaded', ''),
      dateProcessed: mapDateTime(json, r'DateProcessed', ''),
      lastEntityId: mapValueOfType<int>(json, r'LastEntityId'),
      processingStage: mapValueOfType<String>(json, r'ProcessingStage'),
      processingStatus: mapValueOfType<String>(json, r'ProcessingStatus'),
    );
  }
  return null;
}