SessionGetResponseParam.fromJson constructor

SessionGetResponseParam.fromJson(
  1. JsonMap rawData
)

Implementation

factory SessionGetResponseParam.fromJson(JsonMap rawData) {
  final rawUnits = rawData[SessionGetArgument.units.argName];
  final units =
      (rawUnits is JsonMap) ? SessionUnits.fromJson(rawUnits) : null;
  return SessionGetResponseParam(
    version: rawData[SessionGetArgument.version.argName] as String?,
    altSpeedDown: rawData[SessionGetArgument.altSpeedDown.argName] as num?,
    altSpeedEnabled:
        rawData[SessionGetArgument.altSpeedEnabled.argName] as bool?,
    altSpeedTimeBegin:
        rawData[SessionGetArgument.altSpeedTimeBegin.argName] as num?,
    altSpeedTimeDay:
        rawData[SessionGetArgument.altSpeedTimeDay.argName] as num?,
    altSpeedTimeEnabled:
        rawData[SessionGetArgument.altSpeedTimeEnabled.argName] as bool?,
    altSpeedTimeEnd:
        rawData[SessionGetArgument.altSpeedTimeEnd.argName] as num?,
    altSpeedUp: rawData[SessionGetArgument.altSpeedUp.argName] as num?,
    blocklistEnabled:
        rawData[SessionGetArgument.blocklistEnabled.argName] as bool?,
    blocklistSize: rawData[SessionGetArgument.blocklistSize.argName] as num?,
    blocklistUrl: rawData[SessionGetArgument.blocklistUrl.argName] as String?,
    cacheSizeMb: rawData[SessionGetArgument.cacheSizeMb.argName] as num?,
    configDir: rawData[SessionGetArgument.configDir.argName] as String?,
    defaultTrackers:
        rawData[SessionGetArgument.defaultTrackers.argName] as String?,
    dhtEnabled: rawData[SessionGetArgument.dhtEnabled.argName] as bool?,
    downloadDir: rawData[SessionGetArgument.downloadDir.argName] as String?,
    downloadDirFreeSpace:
        rawData[SessionGetArgument.downloadDirFreeSpace.argName] as num?,
    downloadQueueEnabled:
        rawData[SessionGetArgument.downloadQueueEnabled.argName] as bool?,
    downloadQueueSize:
        rawData[SessionGetArgument.downloadQueueSize.argName] as num?,
    encryption: rawData[SessionGetArgument.encryption.argName] as String?,
    idleSeedingLimitEnabled:
        rawData[SessionGetArgument.idleSeedingLimitEnabled.argName] as bool?,
    idleSeedingLimit:
        rawData[SessionGetArgument.idleSeedingLimit.argName] as num?,
    incompleteDirEnabled:
        rawData[SessionGetArgument.incompleteDirEnabled.argName] as bool?,
    incompleteDir:
        rawData[SessionGetArgument.incompleteDir.argName] as String?,
    lpdEnabled: rawData[SessionGetArgument.lpdEnabled.argName] as bool?,
    peerLimitGlobal:
        rawData[SessionGetArgument.peerLimitGlobal.argName] as num?,
    peerLimitPerTorrent:
        rawData[SessionGetArgument.peerLimitPerTorrent.argName] as num?,
    peerPortRandomOnStart:
        rawData[SessionGetArgument.peerPortRandomOnStart.argName] as bool?,
    peerPort: rawData[SessionGetArgument.peerPort.argName] as num?,
    pexEnabled: rawData[SessionGetArgument.pexEnabled.argName] as bool?,
    portForwardingEnabled:
        rawData[SessionGetArgument.portForwardingEnabled.argName] as bool?,
    queueStalledEnabled:
        rawData[SessionGetArgument.queueStalledEnabled.argName] as bool?,
    queueStalledMinutes:
        rawData[SessionGetArgument.queueStalledMinutes.argName] as num?,
    renamePartialFiles:
        rawData[SessionGetArgument.renamePartialFiles.argName] as bool?,
    rpcVersionMinimum:
        rawData[SessionGetArgument.rpcVersionMinimum.argName] as num?,
    rpcVersionSemver:
        rawData[SessionGetArgument.rpcVersionSemver.argName] as String?,
    rpcVersion: rawData[SessionGetArgument.rpcVersion.argName] as num?,
    scriptTorrentAddedEnabled:
        rawData[SessionGetArgument.scriptTorrentAddedEnabled.argName]
            as bool?,
    scriptTorrentAddedFilename:
        rawData[SessionGetArgument.scriptTorrentAddedFilename.argName]
            as String?,
    scriptTorrentDoneEnabled:
        rawData[SessionGetArgument.scriptTorrentDoneEnabled.argName] as bool?,
    scriptTorrentDoneFilename:
        rawData[SessionGetArgument.scriptTorrentDoneFilename.argName]
            as String?,
    scriptTorrentDoneSeedingEnabled:
        rawData[SessionGetArgument.scriptTorrentDoneSeedingEnabled.argName]
            as bool?,
    scriptTorrentDoneSeedingFilename:
        rawData[SessionGetArgument.scriptTorrentDoneSeedingFilename.argName]
            as String?,
    seedQueueEnabled:
        rawData[SessionGetArgument.seedQueueEnabled.argName] as bool?,
    seedQueueSize: rawData[SessionGetArgument.seedQueueSize.argName] as num?,
    seedRatioLimit: rawData[SessionGetArgument.seedRatioLimit.argName],
    seedRatioLimited:
        rawData[SessionGetArgument.seedRatioLimited.argName] as bool?,
    sessionId: rawData[SessionGetArgument.sessionId.argName] as String?,
    speedLimitDownEnabled:
        rawData[SessionGetArgument.speedLimitDownEnabled.argName] as bool?,
    speedLimitDown:
        rawData[SessionGetArgument.speedLimitDown.argName] as num?,
    speedLimitUpEnabled:
        rawData[SessionGetArgument.speedLimitUpEnabled.argName] as bool?,
    speedLimitUp: rawData[SessionGetArgument.speedLimitUp.argName] as num?,
    startAddedTorrents:
        rawData[SessionGetArgument.startAddedTorrents.argName] as bool?,
    trashOriginalTorrentFiles:
        rawData[SessionGetArgument.trashOriginalTorrentFiles.argName]
            as bool?,
    units: units,
    utpEnabled: rawData[SessionGetArgument.utpEnabled.argName] as bool?,
  );
}