fromJson static method

AttributeDefinitionCreate fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static AttributeDefinitionCreate fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return AttributeDefinitionCreate(
      assetModelId: mapValueOfType<int>(json, r'AssetModelId'),
      name: mapValueOfType<String>(json, r'Name'),
      groupName: mapValueOfType<String>(json, r'GroupName'),
      groupType: AttributeDefinitionCreateGroupTypeEnum.fromJson(json[r'GroupType']),
      dataType: AttributeDefinitionCreateDataTypeEnum.fromJson(json[r'DataType']),
      semanticType: mapValueOfType<String>(json, r'SemanticType'),
      unit: mapValueOfType<String>(json, r'Unit'),
    );
  }
  return null;
}