toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => <String, Object?>{
      'pageDataMode': _name(pageDataMode),
      'cacheTtlSeconds': cacheTtl.inSeconds,
      'staleForSeconds': staleFor.inSeconds,
      // The two old values written as they always were, so a manifest an
      // older server reads still means what it meant.
      'streaming': switch (streamingMode) {
        DVPageStreaming.off => false,
        DVPageStreaming.head => true,
        DVPageStreaming.shell => 'shell',
      },
      if (cache != null) 'cache': cache,
      // Only when declared, so a manifest without it reads as it always did.
      if (http.toJson().isNotEmpty) 'http': http.toJson(),
    };