aboutsummaryrefslogtreecommitdiff
path: root/api_torrent_get.go
blob: 9aa8fbd2c3049b811b7fac58609725447e4eac33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package transmission

type CallTorrentGetArguments struct {
	Ids    []uint   `json:"ids"`
	Fields []string `json:"fields"`
}

type CallTorrentGetAllArguments struct {
	Fields []string `json:"fields"`
}

type CallTorrentGetResponse struct {
	Result    string                          `json:"result"`
	Arguments CallTorrentGetResponseArguments `json:"arguments"`
	Tag       uint                            `json:"tag"`
}

type CallTorrentGetResponseArguments struct {
	Torrents []Torrent `json:"torrents"`
	Removed  []Torrent `json:"removed"`
}

func (this *Client) CallTorrentGet(arguments CallTorrentGetArguments) (CallTorrentGetResponse, error) {
	var response CallTorrentGetResponse

	err := this.Call("torrent-get", arguments, this.makeTag(), &response)

	return response, err
}

func (this *Client) CallTorrentGetAll(arguments CallTorrentGetAllArguments) (CallTorrentGetResponse, error) {
	var response CallTorrentGetResponse

	err := this.Call("torrent-get", arguments, this.makeTag(), &response)

	return response, err
}