
TORRENT_ARGUMENTS = {
    'torrent-start': {
        'ids': [
            (int, None, 'Request', 'an integer referring to a torrent id'),
            (list, None, 'Request', 'a list of torrent id numbers, sha1 hash strings, or both'),
            (str, None, 'Request', 'a string, "recently-active", for recently-active torrents')
        ]
    },
    'torrent-start-now': {
        'ids': [
            (int, None, 'Request', 'an integer referring to a torrent id'),
            (list, None, 'Request', 'a list of torrent id numbers, sha1 hash strings, or both'),
            (str, None, 'Request', 'a string, "recently-active", for recently-active torrents')
        ]
    },
    'torrent-stop': {
        'ids': [
            (int,  None, 'Request', 'an integer referring to a torrent id'),
            (list, None, 'Request', 'a list of torrent id numbers, sha1 hash strings, or both'),
            (str,  None, 'Request', 'a string, "recently-active", for recently-active torrents')
        ]
    },
    'torrent-verify': {
        'ids': [
            (int,  None, 'Request', 'an integer referring to a torrent id'),
            (list, None, 'Request', 'a list of torrent id numbers, sha1 hash strings, or both'),
            (str,  None, 'Request', 'a string, "recently-active", for recently-active torrents')
        ]
    },
    'torrent-reannounce': {
        'ids': [
            (int,  None, 'Request', 'an integer referring to a torrent id'),
            (list, None, 'Request', 'a list of torrent id numbers, sha1 hash strings, or both'),
            (str,  None, 'Request', 'a string, "recently-active", for recently-active torrents')
        ]
    },
    'torrent-set': {
        'bandwidthPriority':   (int,  None, 'Request', 'this torrents bandwidth tr_priority_t'),
        "downloadLimit":       (int,  None, 'Request', 'maximum download speed (KBps)'),
        "downloadLimited":     (bool, None, 'Request', 'true if "downloadLimit" is honored'),
        "files-wanted":        (list, None, 'Request', 'indices of file(s) to download'),
        "files-unwanted":      (list, None, 'Request', 'indices of file(s) to not download'),
        "honorsSessionLimits": (bool, None, 'Request', 'true if session upload limits are honored'),
        "ids":                 (list, None, 'Request', 'torrent list, as described in 3.1'),
        "location":            (str,  None, 'Request', 'new location of the torrents content'),
        "peer-limit":          (int,  None, 'Request', 'maximum number of peers'),
        "priority-high":       (list, None, 'Request', 'indices of high-priority file(s)'),
        "priority-low":        (list, None, 'Request', 'indices of low-priority file(s)'),
        "priority-normal":     (list, None, 'Request', 'indices of normal-priority file(s)'),
        "queuePosition":       (int,  None, 'Request', 'position of this torrent in its queue [0...n]'),
        "seedIdleLimit":       (int,  None, 'Request', 'torrent-level number of minutes of seeding inactivity'),
        "seedIdleMode":        (int,  None, 'Request', 'which seeding inactivity to use.  See tr_idlelimit'),
        "seedRatioLimit":      (int, None, 'Request', 'torrent-level seeding ratio'),
        "seedRatioMode":       (int,  None, 'Request', 'which ratio to use.  See tr_ratiolimit'),
        "trackerAdd":          (list, None, 'Request', 'strings of announce URLs to add'),
        "trackerRemove":       (list, None, 'Request', 'ids of trackers to remove'),
        "trackerReplace":      (list, None, 'Request', 'pairs of <trackerId/new announce URLs>'),
        "uploadLimit":         (int,  None, 'Request', 'maximum upload speed (KBps)'),
        "uploadLimited":       (bool, None, 'Request', 'true if "uploadLimit" is honored'),
    },
    'torrent-get': {
        'activityDate':            (int,    None, 'Response', 'Last time of upload or download activity.'),
        'addedDate':               (int,    None, 'Response', 'The date when this torrent was first added.'),
        'announceResponse':        (str,    None, 'Response', 'The announce message from the tracker.'),
        'announceURL':             (str,    None, 'Response', 'Current announce URL.'),
        'bandwidthPriority':       (int,    None, 'Response', 'Bandwidth priority. Low (-1), Normal (0) or High (1).'),
        'comment':                 (str,    None, 'Response', 'Torrent comment.'),
        'corruptEver':             (int,    None, 'Response', 'Number of bytes of corrupt data downloaded.'),
        'creator':                 (str,    None, 'Response', 'Torrent creator.'),
        'dateCreated':             (int,    None, 'Response', 'Torrent creation date.'),
        'desiredAvailable':        (int,    None, 'Response', 'Number of bytes avalable and left to be downloaded.'),
        'doneDate':                (int,    None, 'Response', 'The date when the torrent finished downloading.'),
        'downloadDir':             (str,    None, 'Response', 'The directory path where the torrent is downloaded to.'),
        'downloadedEver':          (int,    None, 'Response', 'Number of bytes of good data downloaded.'),
        'downloaders':             (int,    None, 'Response', 'Number of downloaders.'),
        'downloadLimit':           (int,    None, 'Response', 'Download limit in Kbps.'),
        'downloadLimited':         (bool,   None, 'Response', 'Download limit is enabled'),
        'downloadLimitMode':       (int,    None, 'Response', 'Download limit mode. 0 means global, 1 means signle, 2 unlimited.'),
        'error':                   (int,    None, 'Response', 'Kind of error. 0 means OK, 1 means tracker warning, 2 means tracker error, 3 means local error.'),
        'errorString':             (int,    None, 'Response', 'Error message.'),
        'eta':                     (int,    None, 'Response', 'Estimated number of seconds left when downloading or seeding. -1 means not available and -2 means unknown.'),
        'etaIdle':                 (int,    None, 'Response', 'Estimated number of seconds left until the idle time limit is reached. -1 means not available and -2 means unknown.'),
        'files':                   (list,   None, 'Response', 'Array of file object containing key, bytesCompleted, length and name.'),
        'fileStats':               (list,   None, 'Response', 'Aray of file statistics containing bytesCompleted, wanted and priority.'),
        'hashString':              (str,    None, 'Response', 'Hashstring unique for the torrent even between sessions.'),
        'haveUnchecked':           (int,    None, 'Response', 'Number of bytes of partial pieces.'),
        'haveValid':               (int,    None, 'Response', 'Number of bytes of checksum verified data.'),
        'honorsSessionLimits':     (bool,   None, 'Response', 'True if session upload limits are honored'),
        'id':                      (int,    None, 'Response', 'Session unique torrent id.'),
        'isFinished':              (bool,   None, 'Response', 'True if the torrent is finished. Downloaded and seeded.'),
        'isPrivate':               (bool,   None, 'Response', 'True if the torrent is private.'),
        'isStalled':               (bool,   None, 'Response', 'True if the torrent has stalled (been idle for a long time).'),
        'lastAnnounceTime':        (int,    None, 'Response', 'The time of the last announcement.'),
        'lastScrapeTime':          (int,    None, 'Response', 'The time af the last successful scrape.'),
        'leechers':                (int,    None, 'Response', 'Number of leechers.'),
        'leftUntilDone':           (int,    None, 'Response', 'Number of bytes left until the download is done.'),
        'magnetLink':              (str,    None, 'Response', 'The magnet link for this torrent.'),
        'manualAnnounceTime':      (int,    None, 'Response', 'The time until you manually ask for more peers.'),
        'maxConnectedPeers':       (int,    None, 'Response', 'Maximum of connected peers.'),
        'metadataPercentComplete': (int,    None, 'Response', 'Download progress of metadata. 0.0 to 1.0.'),
        'name':                    (str,    None, 'Response', 'Torrent name.'),
        'nextAnnounceTime':        (int,    None, 'Response', 'Next announce time.'),
        'nextScrapeTime':          (int,    None, 'Response', 'Next scrape time.'),
        'peer-limit':              (int,    None, 'Response', 'Maximum number of peers.'),
        'peers':                   (list,   None, 'Response', 'Array of peer objects.'),
        'peersConnected':          (int,    None, 'Response', 'Number of peers we are connected to.'),
        'peersFrom':               (object, None, 'Response', 'Object containing download peers counts for different peer types.'),
        'peersGettingFromUs':      (int,    None, 'Response', 'Number of peers we are sending data to.'),
        'peersKnown':              (int,    None, 'Response', 'Number of peers that the tracker knows.'),
        'peersSendingToUs':        (int,    None, 'Response', 'Number of peers sending to us'),
        'percentDone':             (int,   None, 'Response', 'Download progress of selected files. 0.0 to 1.0.'),
        'pieces':                  (str,    None, 'Response', 'String with base64 encoded bitfield indicating finished pieces.'),
        'pieceCount':              (int,    None, 'Response', 'Number of pieces.'),
        'pieceSize':               (int,    None, 'Response', 'Number of bytes in a piece.'),
        'priorities':              (list,   None, 'Response', 'Array of file priorities.'),
        'queuePosition':           (int,    None, 'Response', 'The queue position.'),
        'rateDownload':            (int,    None, 'Response', 'Download rate in bps.'),
        'rateUpload':              (int,    None, 'Response', 'Upload rate in bps.'),
        'recheckProgress':         (int,   None, 'Response', 'Progress of recheck. 0.0 to 1.0.'),
        'secondsDownloading':      (int,    None, 'Response', ''),
        'secondsSeeding':          (int,    None, 'Response', ''),
        'scrapeResponse':          (str,    None, 'Response', 'Scrape response message.'),
        'scrapeURL':               (str,    None, 'Response', 'Current scrape URL'),
        'seeders':                 (int,    None, 'Response', 'Number of seeders reported by the tracker.'),
        'seedIdleLimit':           (int,    None, 'Response', 'Idle limit in minutes.'),
        'seedIdleMode':            (int,    None, 'Response', 'Use global (0), torrent (1), or unlimited (2) limit.'),
        'seedRatioLimit':          (int,   None, 'Response', 'Seed ratio limit.'),
        'seedRatioMode':           (int,    None, 'Response', 'Use global (0), torrent (1), or unlimited (2) limit.'),
        'sizeWhenDone':            (int,    None, 'Response', 'Size of the torrent download in bytes.'),
        'startDate':               (int,    None, 'Response', 'The date when the torrent was last started.'),
        'status':                  (int,    None, 'Response', 'Current status, see source'),
        'swarmSpeed':              (int,    None, 'Response', 'Estimated speed in Kbps in the swarm.'),
        'timesCompleted':          (int,    None, 'Response', 'Number of successful downloads reported by the tracker.'),
        'trackers':                (list,   None, 'Response', 'Array of tracker objects.'),
        'trackerStats':            (object, None, 'Response', 'Array of object containing tracker statistics.'),
        'totalSize':               (int,    None, 'Response', 'Total size of the torrent in bytes'),
        'torrentFile':             (str,    None, 'Response', 'Path to .torrent file.'),
        'uploadedEver':            (int,    None, 'Response', 'Number of bytes uploaded, ever.'),
        'uploadLimit':             (int,    None, 'Response', 'Upload limit in Kbps'),
        'uploadLimitMode':         (int,    None, 'Response', 'Upload limit mode. 0 means global, 1 means signle, 2 unlimited.'),
        'uploadLimited':           (bool,   None, 'Response', 'Upload limit enabled.'),
        'uploadRatio':             (int,   None, 'Response', 'Seed ratio.'),
        'wanted':                  (list,   None, 'Response', 'Array of booleans indicated wanted files.'),
        'webseeds':                (list,   None, 'Response', 'Array of webseeds objects'),
        'webseedsSendingToUs':     (int,    None, 'Response', 'Number of webseeds seeding to us.'),
    },
    'torrent-add': {
        "cookies":           (str,  None, 'Request', 'pointer to a string of one or more cookies.'),
        "download-dir":      (str,  None, 'Request', 'path to download the torrent to'),
        "filename":          (str,  None, 'Request', 'filename or URL of the .torrent file'),
        "metainfo":          (str,  None, 'Request', 'base64-encoded .torrent content'),
        "paused":            (bool, None, 'Request', 'if true, dont start the torrent'),
        "peer-limit":        (int,  None, 'Request', 'maximum number of peers'),
        "bandwidthPriority": (int,  None, 'Request', 'torrents bandwidth tr_priority_t'),
        "files-wanted":      (list, None, 'Request', 'indices of file(s) to download'),
        "files-unwanted":    (list, None, 'Request', 'indices of file(s) to not download'),
        "priority-high":     (list, None, 'Request', 'indices of high-priority file(s)'),
        "priority-low":      (list, None, 'Request', 'indices of low-priority file(s)'),
        "priority-normal":   (list, None, 'Request', 'indices of normal-priority file(s)'),
    },
    'torrent-remove': {
        "ids":               (list, None, 'Request', 'torrent list, as described in 3.1'),
        "delete-local-data": (bool, None, 'Request', 'delete local data. (default: false)'),
    },
    'torrent-set-location': {
        "ids":      (list, None, 'Request','torrent list, as described in 3.1'),
        "location": (str,  None, 'Request', 'the new torrent location'),
        "move":     (bool, None, 'Request', 'if true, move from previous location. otherwise, search "location" for files (default: false)'),
    },
    'torrent-rename-path': {
        "ids":  (list, None, 'Request', 'the torrent torrent list, as described in 3.1 (must only be 1 torrent)'),
        "path": (str,  None, 'Request', 'the path to the file or folder that will be renamed'),
        "name": (str,  None, 'Request', 'the file or folders new name')
    },
    'session-set': {
        "alt-speed-down":               ( int  ,  None, 'All',      'max global download speed (KBps)'),
        "alt-speed-enabled":            ( bool ,  None, 'All',      'true means use the alt speeds'),
        "alt-speed-time-begin":         ( int  ,  None, 'All',      'when to turn on alt speeds (units: minutes after midnight)'),
        "alt-speed-time-enabled":       ( bool ,  None, 'All',      'true means the scheduled on/off times are used'),
        "alt-speed-time-end":           ( int  ,  None, 'All',      'when to turn off alt speeds (units: same)'),
        "alt-speed-time-day":           ( int  ,  None, 'All',      'what day(s) to turn on alt speeds (look at tr_sched_day)'),
        "alt-speed-up":                 ( int  ,  None, 'All',      'max global upload speed (KBps)'),
        "blocklist-url":                ( str  ,  None, 'All',      'location of the blocklist to use for "blocklist-update"'),
        "blocklist-enabled":            ( bool ,  None, 'All',      'true means enabled'),
        "blocklist-size":               ( int  ,  None, 'All',      'number of rules in the blocklist'),
        "cache-size-mb":                ( int  ,  None, 'All',      'maximum size of the disk cache (MB)'),
        "config-dir":                   ( str  ,  None, 'Response', 'location of transmissions configuration directory'),
        "download-dir":                 ( str  ,  None, 'All',      'default path to download torrents'),
        "download-queue-size":          ( int  ,  None, 'All',      'max number of torrents to download at once (see download-queue-enabled)'),
        "download-queue-enabled":       ( bool ,  None, 'All',      'if true, limit how many torrents can be downloaded at once'),
        "dht-enabled":                  ( bool ,  None, 'All',      'true means allow dht in public torrents'),
        "encryption":                   ( str  ,  None, 'All',      '"required", "preferred", "tolerated"'),
        "idle-seeding-limit":           ( int  ,  None, 'All',      "torrents we're seeding will be stopped if they're idle for this long"),
        "idle-seeding-limit-enabled":   ( bool ,  None, 'All',      'true if the seeding inactivity limit is honored by default'),
        "incomplete-dir":               ( str  ,  None, 'All',      'path for incomplete torrents, when enabled'),
        "incomplete-dir-enabled":       ( bool ,  None, 'All',      'true means keep torrents in incomplete-dir until done'),
        "lpd-enabled":                  ( bool ,  None, 'All',      'true means allow Local Peer Discovery in public torrents'),
        "peer-limit-global":            ( int  ,  None, 'All',      'maximum global number of peers'),
        "peer-limit-per-torrent":       ( int  ,  None, 'All',      'maximum global number of peers'),
        "pex-enabled":                  ( bool ,  None, 'All',      'true means allow pex in public torrents'),
        "peer-port":                    ( int  ,  None, 'All',      'port number'),
        "peer-port-random-on-start":    ( bool ,  None, 'All',      'true means pick a random peer port on launch'),
        "port-forwarding-enabled":      ( bool ,  None, 'All',      'true means enabled'),
        "queue-stalled-enabled":        ( bool ,  None, 'All',      'whether or not to consider idle torrents as stalled'),
        "queue-stalled-minutes":        ( int  ,  None, 'All',      "torrents that are idle for N minuets aren't counted toward seed-queue-size or download-queue-size"),
        "rename-partial-files":         ( bool ,  None, 'All',      'true means append ".part" to incomplete files'),
        "rpc-version":                  ( int  ,  None, 'Response', 'the current RPC API version'),
        "rpc-version-minimum":          ( int  ,  None, 'Response', 'the minimum RPC API version supported'),
        "script-torrent-done-filename": ( str  ,  None, 'All',      'filename of the script to run'),
        "script-torrent-done-enabled":  ( bool ,  None, 'All',      'whether or not to call the "done" script'),
        "seedRatioLimit":               ( int ,  None, 'All',      'the default seed ratio for torrents to use'),
        "seedRatioLimited":             ( bool ,  None, 'All',      'true if seedRatioLimit is honored by default'),
        "seed-queue-size":              ( int  ,  None, 'All',      'max number of torrents to uploaded at once (see seed-queue-enabled)'),
        "seed-queue-enabled":           ( bool ,  None, 'All',      'if true, limit how many torrents can be uploaded at once'),
        "speed-limit-down":             ( int  ,  None, 'All',      'max global download speed (KBps)'),
        "speed-limit-down-enabled":     ( bool ,  None, 'All',      'true means enabled'),
        "speed-limit-up":               ( int  ,  None, 'All',      'max global upload speed (KBps)'),
        "speed-limit-up-enabled":       ( bool ,  None, 'All',      'true means enabled'),
        "start-added-torrents":         ( bool ,  None, 'All',      'true means added torrents will be started right away'),
        "trash-original-torrent-files": ( bool ,  None, 'All',      'true means the .torrent file of added torrents will be deleted'),
        "units":                        ( object, None, 'All',      'see below'),
        "utp-enabled":                  ( bool ,  None, 'All',      'true means allow utp'),
        "version":                      ( str  ,  None, 'Response', 'long version string "$version ($revision)"')
    },
    'session-stats': {
        "activeTorrentCount": ( int,    None, 'Response', 'Number of active torrents'),
        "downloadSpeed":      ( int,    None, 'Response', 'Download Speed'),
        "pausedTorrentCount": ( int,    None, 'Response', 'Number of paused torrent'),
        "torrentCount":       ( int,    None, 'Response', 'Number of torrents'),
        "uploadSpeed":        ( int,    None, 'Response', 'Upload Speed'),
        "cumulative-stats":   ( object, None, 'Response', ''),
        "current-stats":      ( object, None, 'Response', '')
    },
    "blocklist-update": {
        "blocklist-size": (int, None, 'Response', '')
    },
    "port-test": {
        "port-is-open": (bool, None, 'Response', '')
    },
    "queue-move-top": {
        "ids": (list, None, 'Response', '')
    },
    "queue-move-up": {
        "ids": (list, None, 'Response', '')
    },
    "queue-move-down": {
        "ids": (list, None, 'Response', '')
    },
    "queue-move-bottom": {
        "ids": (list, None, 'Response', '')
    },
    "free-space": {
        "path":       (str, None, 'All', ''),
        "size-bytes": (int, None, 'Response', 'the size, in bytes, of the free space in that directory')
    }
}
