fromJson static method

AttributeValue fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static AttributeValue fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return AttributeValue(
      definitionId: mapValueOfType<int>(json, r'DefinitionId'),
      groupType: AttributeValueGroupTypeEnum.fromJson(json[r'GroupType']),
      groupName: mapValueOfType<String>(json, r'GroupName'),
      name: mapValueOfType<String>(json, r'Name'),
      canonicalName: mapValueOfType<String>(json, r'CanonicalName'),
      value: ValueContainer.fromJson(json[r'Value']),
      unit: mapValueOfType<String>(json, r'Unit'),
      semanticType: mapValueOfType<String>(json, r'SemanticType'),
      dateCreated: mapDateTime(json, r'DateCreated', ''),
      dateModified: mapDateTime(json, r'DateModified', ''),
    );
  }
  return null;
}