fromJson static method

AssetSegment fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static AssetSegment fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return AssetSegment(
      name: mapValueOfType<String>(json, r'Name'),
      description: mapValueOfType<String>(json, r'Description'),
      isDefault: mapValueOfType<bool>(json, r'IsDefault'),
      segmentId: mapValueOfType<String>(json, r'SegmentId'),
      createdById: mapValueOfType<String>(json, r'CreatedById'),
      modifiedById: mapValueOfType<String>(json, r'ModifiedById'),
      assetId: mapValueOfType<int>(json, r'AssetId'),
      asset: mapValueOfType<Object>(json, r'Asset'),
      models: ModelInfo.listFromJson(json[r'Models']),
      modelEntities: ApiClient.listFromJson(json[r'ModelEntities']),
    );
  }
  return null;
}