DashPackage.fromJson constructor

DashPackage.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DashPackage.fromJson(Map<String, dynamic> json) {
  return DashPackage(
    adTriggers: (json['adTriggers'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toAdTriggersElement())
        .toList(),
    adsOnDeliveryRestrictions: (json['adsOnDeliveryRestrictions'] as String?)
        ?.toAdsOnDeliveryRestrictions(),
    encryption: json['encryption'] != null
        ? DashEncryption.fromJson(json['encryption'] as Map<String, dynamic>)
        : null,
    manifestLayout: (json['manifestLayout'] as String?)?.toManifestLayout(),
    manifestWindowSeconds: json['manifestWindowSeconds'] as int?,
    minBufferTimeSeconds: json['minBufferTimeSeconds'] as int?,
    minUpdatePeriodSeconds: json['minUpdatePeriodSeconds'] as int?,
    periodTriggers: (json['periodTriggers'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toPeriodTriggersElement())
        .toList(),
    profile: (json['profile'] as String?)?.toProfile(),
    segmentDurationSeconds: json['segmentDurationSeconds'] as int?,
    segmentTemplateFormat:
        (json['segmentTemplateFormat'] as String?)?.toSegmentTemplateFormat(),
    streamSelection: json['streamSelection'] != null
        ? StreamSelection.fromJson(
            json['streamSelection'] as Map<String, dynamic>)
        : null,
    suggestedPresentationDelaySeconds:
        json['suggestedPresentationDelaySeconds'] as int?,
    utcTiming: (json['utcTiming'] as String?)?.toUtcTiming(),
    utcTimingUri: json['utcTimingUri'] as String?,
  );
}