-
Notifications
You must be signed in to change notification settings - Fork 3
/
request.py
176 lines (172 loc) · 5.95 KB
/
request.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# -*- coding: utf-8 -*-
from milky import models
"""Method properties.
{'prefix': {'method': (auth_required,
(required_args, ), (optional_args, ),
response_model), }, }
"""
METHODS = {
'auth': {
'checkToken': (False,
('auth_token', ), (),
models.Auth, ),
'getFrob': (False,
(), (),
models.Frob, ),
'getToken': (False,
('frob', ), (),
models.Auth, ), },
'contacts': {
'add': (True,
('timeline', 'contact', ), (),
models.Contact, ),
'delete': (True,
('timeline', 'contact_id', ), (),
models.Stat, ),
'getList': (True,
(), (),
models.Contacts, ), },
'groups': {
'add': (True,
('timeline', 'group', ), (),
models.Group, ),
'addContact': (True,
('timeline', 'group_id', 'contact_id', ), (),
models.Stat, ),
'delete': (True,
('timeline', 'group_id', ), (),
models.Stat, ),
'getList': (True,
(), (),
models.Groups, ),
'removeContact': (True,
('timeline', 'group_id', 'contact_id', ), (),
models.Stat, ), },
'lists': {
'add': (True,
('timeline', 'name', ), ('filter', ),
models.List, ),
'archive': (True,
('timeline', 'list_id', ), (),
models.List, ),
'delete': (True,
('timeline', 'list_id', ), (),
models.List, ),
'getList': (True,
(), (),
models.Lists, ),
'setDefaultList': (True,
('timeline', ), ('list_id', ),
models.Stat, ),
'setName': (True,
('timeline', 'list_id', 'name', ), (),
models.List, ),
'unarchive': (True,
('timeline', ), ('list_id', ),
models.List, ), },
'locations': {
'getList': (True,
(), (),
models.Locations, ), },
'reflection': {
'getMethodInfo': (False,
('method_name', ), (),
models.Method, ),
'getMethods': (False,
(), (),
models.Methods, ), },
'settings': {
'getList': (True,
(), (),
models.Settings, ), },
'tasks': {
'add': (True,
('timeline', 'name', ), ('list_id', 'parse', ),
models.TaskList, ),
'addTags': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', 'tags', ), (),
models.TaskList, ),
'complete': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), (),
models.TaskList, ),
'delete': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), (),
models.TaskList, ),
'getList': (True,
(), ('list_id', 'filter', 'last_sync', ),
models.Tasks, ),
'movePriority': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', 'direction', ), (),
models.TaskList, ),
'moveTo': (True,
('timeline', 'from_list_id', 'to_list_id', 'taskseries_id', 'task_id', ), (),
models.TaskList, ),
'postpone': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), (),
models.TaskList, ),
'removeTags': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', 'tags', ), (),
models.TaskList, ),
'setDueDate': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('due', 'has_due_time', 'parse', ),
models.TaskList, ),
'setEstimate': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('estimate', ),
models.TaskList, ),
'setLocation': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('location_id', ),
models.TaskList, ),
'setName': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', 'name', ), (),
models.TaskList, ),
'setPriority': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('priority', ),
models.TaskList, ),
'setRecurrence': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('repeat', ),
models.TaskList, ),
'setTags': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('tags', ),
models.TaskList, ),
'setURL': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('url', ),
models.TaskList, ),
'uncomplete': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', ), (),
models.TaskList, ), },
'tasksnotes': {
'add': (True,
('timeline', 'list_id', 'taskseries_id', 'task_id', 'note_title', 'note_text', ), (),
models.Note, ),
'delete': (True,
('timeline', 'note_id', ), (),
models.Stat, ),
'edit': (True,
('timeline', 'note_id', 'note_title', 'note_text', ), (),
models.Note, ), },
'test': {
'echo': (False,
(), (),
models.Stat, ),
'login': (True,
(), (),
models.User, ), },
'time': {
'convert': (True,
('to_timezone', ), ('from_timezone', 'to_timezone', 'time', ),
models.Time, ),
'parse': (True,
('text', ), ('timezone', 'dateformat', ),
models.Time, ), },
'timelines': {
'create': (True,
(), (),
models.Timeline, ), },
'timezones': {
'getList': (True,
(), (),
models.Timezones, ), },
'transactions': {
'undo': (True,
('timeline', 'transaction_id', ), (),
models.Stat, ), }, }