const std = @import("std"); const Request = @import("request.zig"); const Types = @import("types.zig"); pub const Response = @This(); pub const TorrentGet = struct { pub const Arguments = struct { torrents: ?[]Types.Torrent = null, }; result: []const u8, arguments: Arguments, }; pub const Object = struct { pub const Arguments = union(Request.Method) { torrent_start, torrent_start_now, torrent_stop, torrent_verify, torrent_reannounce, torrent_set, torrent_get: TorrentGet.Arguments, torrent_add, torrent_remove, torrent_set_location, torrent_rename_path, session_get, session_set, }; result: []const u8, arguments: Arguments, pub fn init(arguments: Arguments, result: []const u8) Object { switch (arguments) { .torrent_get => { return Object{ .result = result, .arguments = arguments, }; }, else => unreachable, } } };