EntertainmentSegmentCapabilities.fromJson constructor

EntertainmentSegmentCapabilities.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a EntertainmentSegmentCapabilities object from the JSON response to a GET request.

Implementation

factory EntertainmentSegmentCapabilities.fromJson(
    Map<String, dynamic> dataMap) {
  return EntertainmentSegmentCapabilities(
    isConfigurable: dataMap[ApiFields.isConfigurable] ?? false,
    maxSegments: dataMap[ApiFields.maxSegments] ?? 1,
    segments: (dataMap[ApiFields.segments] as List<dynamic>?)
            ?.map((segmentMap) => EntertainmentSegment.fromJson(
                Map<String, dynamic>.from(segmentMap)))
            .toList() ??
        [],
  );
}