universal-mcp 0.1.8rc2__py3-none-any.whl → 0.1.8rc3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. universal_mcp/__init__.py +0 -2
  2. universal_mcp/analytics.py +75 -0
  3. universal_mcp/applications/application.py +27 -5
  4. universal_mcp/applications/calendly/app.py +413 -160
  5. universal_mcp/applications/coda/README.md +133 -0
  6. universal_mcp/applications/coda/__init__.py +0 -0
  7. universal_mcp/applications/coda/app.py +3704 -0
  8. universal_mcp/applications/e2b/app.py +6 -7
  9. universal_mcp/applications/firecrawl/app.py +1 -1
  10. universal_mcp/applications/github/app.py +41 -42
  11. universal_mcp/applications/google_calendar/app.py +20 -20
  12. universal_mcp/applications/google_docs/app.py +22 -29
  13. universal_mcp/applications/google_drive/app.py +53 -59
  14. universal_mcp/applications/google_mail/app.py +40 -40
  15. universal_mcp/applications/google_sheet/app.py +44 -51
  16. universal_mcp/applications/markitdown/app.py +4 -4
  17. universal_mcp/applications/notion/app.py +93 -83
  18. universal_mcp/applications/perplexity/app.py +5 -5
  19. universal_mcp/applications/reddit/app.py +32 -32
  20. universal_mcp/applications/resend/app.py +4 -4
  21. universal_mcp/applications/serpapi/app.py +4 -4
  22. universal_mcp/applications/tavily/app.py +4 -4
  23. universal_mcp/applications/wrike/app.py +566 -226
  24. universal_mcp/applications/youtube/app.py +626 -166
  25. universal_mcp/applications/zenquotes/app.py +3 -3
  26. universal_mcp/exceptions.py +1 -0
  27. universal_mcp/integrations/__init__.py +11 -2
  28. universal_mcp/integrations/integration.py +2 -2
  29. universal_mcp/logger.py +3 -56
  30. universal_mcp/servers/__init__.py +2 -1
  31. universal_mcp/servers/server.py +76 -77
  32. universal_mcp/stores/store.py +5 -3
  33. universal_mcp/tools/__init__.py +1 -1
  34. universal_mcp/tools/adapters.py +4 -1
  35. universal_mcp/tools/func_metadata.py +5 -6
  36. universal_mcp/tools/tools.py +108 -51
  37. universal_mcp/utils/docgen.py +121 -69
  38. universal_mcp/utils/docstring_parser.py +44 -21
  39. universal_mcp/utils/dump_app_tools.py +33 -23
  40. universal_mcp/utils/openapi.py +121 -47
  41. {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/METADATA +2 -2
  42. universal_mcp-0.1.8rc3.dist-info/RECORD +75 -0
  43. universal_mcp-0.1.8rc2.dist-info/RECORD +0 -71
  44. {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/WHEEL +0 -0
  45. {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/entry_points.txt +0 -0
@@ -8,15 +8,15 @@ class WrikeApp(APIApplication):
8
8
  def __init__(self, integration: Integration = None, **kwargs) -> None:
9
9
  """
10
10
  Initializes the OfficialWrikeCollectionV21App with a specified integration and additional keyword arguments.
11
-
11
+
12
12
  Args:
13
13
  integration: Integration, optional. The integration instance to associate with this app. Defaults to None.
14
14
  **kwargs: Additional keyword arguments passed to the superclass initializer.
15
-
15
+
16
16
  Returns:
17
17
  None. This constructor initializes the instance in place.
18
18
  """
19
- super().__init__(name='wrike', integration=integration, **kwargs)
19
+ super().__init__(name="wrike", integration=integration, **kwargs)
20
20
  self.base_url = "https://www.wrike.com/api/v4"
21
21
 
22
22
  def _get_headers(self):
@@ -29,23 +29,30 @@ class WrikeApp(APIApplication):
29
29
  return {
30
30
  "Authorization": f"Bearer {credentials['access_token']}",
31
31
  "Content-Type": "application/json",
32
- }
33
-
32
+ }
34
33
 
35
34
  def get_contacts(self, deleted=None, fields=None, metadata=None) -> Any:
36
35
  """
37
36
  Retrieves a list of contacts from the server, with optional filtering and field selection.
38
-
37
+
39
38
  Args:
40
39
  deleted: Optional[bool]. If set, filters contacts by their deleted status. Only contacts matching the specified deleted state are returned.
41
40
  fields: Optional[str]. Comma-separated list of fields to include in the response for each contact. Limits the contact fields returned.
42
41
  metadata: Optional[str]. Comma-separated list of metadata fields to include in the response. Filters which metadata is returned for each contact.
43
-
42
+
44
43
  Returns:
45
44
  The JSON-decoded response from the server containing contact information, as a Python object (such as a list or dictionary) depending on the backend API response structure.
46
45
  """
47
46
  url = f"{self.base_url}/contacts"
48
- query_params = {k: v for k, v in [('deleted', deleted), ('fields', fields), ('metadata', metadata)] if v is not None}
47
+ query_params = {
48
+ k: v
49
+ for k, v in [
50
+ ("deleted", deleted),
51
+ ("fields", fields),
52
+ ("metadata", metadata),
53
+ ]
54
+ if v is not None
55
+ }
49
56
  response = self._get(url, params=query_params)
50
57
  response.raise_for_status()
51
58
  return response.json()
@@ -53,26 +60,35 @@ class WrikeApp(APIApplication):
53
60
  def get_contacts_by_contactid(self, contactId, fields=None) -> Any:
54
61
  """
55
62
  Retrieves contact information for a specific contact ID, optionally returning only specified fields.
56
-
63
+
57
64
  Args:
58
65
  contactId: The unique identifier of the contact to retrieve. Must not be None.
59
66
  fields: Optional; a comma-separated string specifying which fields to include in the response. If None, all fields are returned.
60
-
67
+
61
68
  Returns:
62
69
  A JSON-decoded object containing the contact's details as returned by the API.
63
70
  """
64
71
  if contactId is None:
65
72
  raise ValueError("Missing required parameter 'contactId'")
66
73
  url = f"{self.base_url}/contacts/{contactId}"
67
- query_params = {k: v for k, v in [('fields', fields)] if v is not None}
74
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
68
75
  response = self._get(url, params=query_params)
69
76
  response.raise_for_status()
70
77
  return response.json()
71
78
 
72
- def put_contacts_by_contactid(self, contactId, metadata=None, currentBillRate=None, currentCostRate=None, jobRoleId=None, customFields=None, fields=None) -> Any:
79
+ def put_contacts_by_contactid(
80
+ self,
81
+ contactId,
82
+ metadata=None,
83
+ currentBillRate=None,
84
+ currentCostRate=None,
85
+ jobRoleId=None,
86
+ customFields=None,
87
+ fields=None,
88
+ ) -> Any:
73
89
  """
74
90
  Updates an existing contact by contact ID with provided details such as metadata, billing and cost rates, job role, custom fields, or additional fields.
75
-
91
+
76
92
  Args:
77
93
  contactId: The unique identifier of the contact to update. Must not be None.
78
94
  metadata: Optional metadata dictionary for the contact (default is None).
@@ -81,19 +97,19 @@ class WrikeApp(APIApplication):
81
97
  jobRoleId: Optional job role identifier associated with the contact (default is None).
82
98
  customFields: Optional dictionary of custom contact fields (default is None).
83
99
  fields: Optional list of specific fields to include in the response (default is None).
84
-
100
+
85
101
  Returns:
86
102
  The JSON-decoded response containing the updated contact details.
87
103
  """
88
104
  if contactId is None:
89
105
  raise ValueError("Missing required parameter 'contactId'")
90
106
  request_body = {
91
- 'metadata': metadata,
92
- 'currentBillRate': currentBillRate,
93
- 'currentCostRate': currentCostRate,
94
- 'jobRoleId': jobRoleId,
95
- 'customFields': customFields,
96
- 'fields': fields,
107
+ "metadata": metadata,
108
+ "currentBillRate": currentBillRate,
109
+ "currentCostRate": currentCostRate,
110
+ "jobRoleId": jobRoleId,
111
+ "customFields": customFields,
112
+ "fields": fields,
97
113
  }
98
114
  request_body = {k: v for k, v in request_body.items() if v is not None}
99
115
  url = f"{self.base_url}/contacts/{contactId}"
@@ -105,10 +121,10 @@ class WrikeApp(APIApplication):
105
121
  def get_users_by_userid(self, userId) -> Any:
106
122
  """
107
123
  Retrieves user information for a given user ID from the API endpoint.
108
-
124
+
109
125
  Args:
110
126
  userId: The unique identifier of the user whose information is to be retrieved.
111
-
127
+
112
128
  Returns:
113
129
  A JSON-decoded object containing user details as returned by the API.
114
130
  """
@@ -123,18 +139,18 @@ class WrikeApp(APIApplication):
123
139
  def put_users_by_userid(self, userId, profile=None) -> Any:
124
140
  """
125
141
  Updates a user's profile information by user ID using a PUT request.
126
-
142
+
127
143
  Args:
128
144
  userId: str. The unique identifier of the user. Must not be None.
129
145
  profile: dict or None. Optional. The profile information to update for the user. If None, no profile data is sent.
130
-
146
+
131
147
  Returns:
132
148
  Any. The parsed JSON response from the server after updating the user's information.
133
149
  """
134
150
  if userId is None:
135
151
  raise ValueError("Missing required parameter 'userId'")
136
152
  request_body = {
137
- 'profile': profile,
153
+ "profile": profile,
138
154
  }
139
155
  request_body = {k: v for k, v in request_body.items() if v is not None}
140
156
  url = f"{self.base_url}/users/{userId}"
@@ -143,47 +159,60 @@ class WrikeApp(APIApplication):
143
159
  response.raise_for_status()
144
160
  return response.json()
145
161
 
146
- def get_groups(self, metadata=None, pageSize=None, pageToken=None, fields=None) -> Any:
162
+ def get_groups(
163
+ self, metadata=None, pageSize=None, pageToken=None, fields=None
164
+ ) -> Any:
147
165
  """
148
166
  Retrieves a list of groups from the API, applying optional filtering and pagination parameters.
149
-
167
+
150
168
  Args:
151
169
  metadata: Optional. Specifies additional metadata to include or filter by in the group results.
152
170
  pageSize: Optional. The maximum number of groups to return in the response.
153
171
  pageToken: Optional. A token identifying the page of results to return, for pagination.
154
172
  fields: Optional. Selector specifying a subset of fields to include in the response.
155
-
173
+
156
174
  Returns:
157
175
  The API response parsed as a JSON-compatible object, typically a dictionary containing group information.
158
176
  """
159
177
  url = f"{self.base_url}/groups"
160
- query_params = {k: v for k, v in [('metadata', metadata), ('pageSize', pageSize), ('pageToken', pageToken), ('fields', fields)] if v is not None}
178
+ query_params = {
179
+ k: v
180
+ for k, v in [
181
+ ("metadata", metadata),
182
+ ("pageSize", pageSize),
183
+ ("pageToken", pageToken),
184
+ ("fields", fields),
185
+ ]
186
+ if v is not None
187
+ }
161
188
  response = self._get(url, params=query_params)
162
189
  response.raise_for_status()
163
190
  return response.json()
164
191
 
165
- def post_groups(self, title, members=None, parent=None, avatar=None, metadata=None) -> Any:
192
+ def post_groups(
193
+ self, title, members=None, parent=None, avatar=None, metadata=None
194
+ ) -> Any:
166
195
  """
167
196
  Creates a new group with the specified title and optional details, sending a POST request to the groups endpoint.
168
-
197
+
169
198
  Args:
170
199
  title: str. The name of the group to create. This parameter is required.
171
200
  members: Optional[list]. List of member identifiers to include in the group.
172
201
  parent: Optional[str]. Identifier of the parent group, if applicable.
173
202
  avatar: Optional[Any]. Avatar image or data to associate with the group.
174
203
  metadata: Optional[dict]. Additional metadata or custom fields for the group.
175
-
204
+
176
205
  Returns:
177
206
  Any. A dictionary containing the response data representing the created group.
178
207
  """
179
208
  if title is None:
180
209
  raise ValueError("Missing required parameter 'title'")
181
210
  request_body = {
182
- 'title': title,
183
- 'members': members,
184
- 'parent': parent,
185
- 'avatar': avatar,
186
- 'metadata': metadata,
211
+ "title": title,
212
+ "members": members,
213
+ "parent": parent,
214
+ "avatar": avatar,
215
+ "metadata": metadata,
187
216
  }
188
217
  request_body = {k: v for k, v in request_body.items() if v is not None}
189
218
  url = f"{self.base_url}/groups"
@@ -195,26 +224,37 @@ class WrikeApp(APIApplication):
195
224
  def get_groups_by_groupid(self, groupId, fields=None) -> Any:
196
225
  """
197
226
  Retrieves details for a specific group by its group ID, optionally returning only specified fields.
198
-
227
+
199
228
  Args:
200
229
  groupId: str. The unique identifier of the group to retrieve. Must not be None.
201
230
  fields: Optional[str]. A comma-separated list of fields to include in the response. If None, all fields are returned.
202
-
231
+
203
232
  Returns:
204
233
  dict. A dictionary containing the group details as returned by the API.
205
234
  """
206
235
  if groupId is None:
207
236
  raise ValueError("Missing required parameter 'groupId'")
208
237
  url = f"{self.base_url}/groups/{groupId}"
209
- query_params = {k: v for k, v in [('fields', fields)] if v is not None}
238
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
210
239
  response = self._get(url, params=query_params)
211
240
  response.raise_for_status()
212
241
  return response.json()
213
242
 
214
- def put_groups_by_groupid(self, groupId, title=None, addMembers=None, removeMembers=None, addInvitations=None, removeInvitations=None, parent=None, avatar=None, metadata=None) -> Any:
243
+ def put_groups_by_groupid(
244
+ self,
245
+ groupId,
246
+ title=None,
247
+ addMembers=None,
248
+ removeMembers=None,
249
+ addInvitations=None,
250
+ removeInvitations=None,
251
+ parent=None,
252
+ avatar=None,
253
+ metadata=None,
254
+ ) -> Any:
215
255
  """
216
256
  Updates an existing group identified by groupId with new properties and membership changes via a PUT request.
217
-
257
+
218
258
  Args:
219
259
  groupId: str. The unique identifier of the group to update. Required.
220
260
  title: str, optional. The new title for the group.
@@ -225,21 +265,21 @@ class WrikeApp(APIApplication):
225
265
  parent: str or None, optional. The new parent group identifier, if setting or changing the hierarchy.
226
266
  avatar: str or None, optional. New avatar for the group, typically a URL or encoded image data.
227
267
  metadata: dict or None, optional. Additional metadata to attach to the group.
228
-
268
+
229
269
  Returns:
230
270
  dict. The JSON response from the server containing the updated group details.
231
271
  """
232
272
  if groupId is None:
233
273
  raise ValueError("Missing required parameter 'groupId'")
234
274
  request_body = {
235
- 'title': title,
236
- 'addMembers': addMembers,
237
- 'removeMembers': removeMembers,
238
- 'addInvitations': addInvitations,
239
- 'removeInvitations': removeInvitations,
240
- 'parent': parent,
241
- 'avatar': avatar,
242
- 'metadata': metadata,
275
+ "title": title,
276
+ "addMembers": addMembers,
277
+ "removeMembers": removeMembers,
278
+ "addInvitations": addInvitations,
279
+ "removeInvitations": removeInvitations,
280
+ "parent": parent,
281
+ "avatar": avatar,
282
+ "metadata": metadata,
243
283
  }
244
284
  request_body = {k: v for k, v in request_body.items() if v is not None}
245
285
  url = f"{self.base_url}/groups/{groupId}"
@@ -251,10 +291,10 @@ class WrikeApp(APIApplication):
251
291
  def delete_groups_by_groupid(self, groupId) -> Any:
252
292
  """
253
293
  Deletes a group resource identified by the provided groupId using an HTTP DELETE request.
254
-
294
+
255
295
  Args:
256
296
  groupId: str. The unique identifier of the group to be deleted. Must not be None.
257
-
297
+
258
298
  Returns:
259
299
  Any. The JSON-decoded response from the API after deleting the group.
260
300
  """
@@ -269,17 +309,17 @@ class WrikeApp(APIApplication):
269
309
  def put_groups_bulk(self, members) -> Any:
270
310
  """
271
311
  Updates multiple group memberships in bulk by sending a PUT request with the given members data.
272
-
312
+
273
313
  Args:
274
314
  members: List or collection of member data to be processed in bulk. Must not be None.
275
-
315
+
276
316
  Returns:
277
317
  Parsed JSON response from the API containing the result of the bulk update operation.
278
318
  """
279
319
  if members is None:
280
320
  raise ValueError("Missing required parameter 'members'")
281
321
  request_body = {
282
- 'members': members,
322
+ "members": members,
283
323
  }
284
324
  request_body = {k: v for k, v in request_body.items() if v is not None}
285
325
  url = f"{self.base_url}/groups_bulk"
@@ -288,13 +328,15 @@ class WrikeApp(APIApplication):
288
328
  response.raise_for_status()
289
329
  return response.json()
290
330
 
291
- def get_invitations(self, ) -> Any:
331
+ def get_invitations(
332
+ self,
333
+ ) -> Any:
292
334
  """
293
335
  Retrieves all invitations from the server using a GET request.
294
-
336
+
295
337
  Args:
296
338
  None: This function takes no arguments
297
-
339
+
298
340
  Returns:
299
341
  The JSON-decoded response containing invitation data from the server.
300
342
  """
@@ -304,10 +346,20 @@ class WrikeApp(APIApplication):
304
346
  response.raise_for_status()
305
347
  return response.json()
306
348
 
307
- def post_invitations(self, email, firstName=None, lastName=None, role=None, external=None, subject=None, message=None, userTypeId=None) -> Any:
349
+ def post_invitations(
350
+ self,
351
+ email,
352
+ firstName=None,
353
+ lastName=None,
354
+ role=None,
355
+ external=None,
356
+ subject=None,
357
+ message=None,
358
+ userTypeId=None,
359
+ ) -> Any:
308
360
  """
309
361
  Sends an invitation email to a user with optional details such as name, role, and custom message.
310
-
362
+
311
363
  Args:
312
364
  email: str. The email address of the user to invite. Required.
313
365
  firstName: str, optional. The first name of the invitee.
@@ -317,21 +369,21 @@ class WrikeApp(APIApplication):
317
369
  subject: str, optional. Custom subject line for the invitation email.
318
370
  message: str, optional. Custom message to include in the invitation.
319
371
  userTypeId: Any, optional. The user type identifier to associate with the invitation.
320
-
372
+
321
373
  Returns:
322
374
  Any. The server's parsed JSON response to the invitation request.
323
375
  """
324
376
  if email is None:
325
377
  raise ValueError("Missing required parameter 'email'")
326
378
  request_body = {
327
- 'email': email,
328
- 'firstName': firstName,
329
- 'lastName': lastName,
330
- 'role': role,
331
- 'external': external,
332
- 'subject': subject,
333
- 'message': message,
334
- 'userTypeId': userTypeId,
379
+ "email": email,
380
+ "firstName": firstName,
381
+ "lastName": lastName,
382
+ "role": role,
383
+ "external": external,
384
+ "subject": subject,
385
+ "message": message,
386
+ "userTypeId": userTypeId,
335
387
  }
336
388
  request_body = {k: v for k, v in request_body.items() if v is not None}
337
389
  url = f"{self.base_url}/invitations"
@@ -340,27 +392,29 @@ class WrikeApp(APIApplication):
340
392
  response.raise_for_status()
341
393
  return response.json()
342
394
 
343
- def put_invitations_by_invitationid(self, invitationId, resend=None, role=None, external=None, userTypeId=None) -> Any:
395
+ def put_invitations_by_invitationid(
396
+ self, invitationId, resend=None, role=None, external=None, userTypeId=None
397
+ ) -> Any:
344
398
  """
345
399
  Updates an existing invitation by invitation ID with optional fields such as resend, role, external, and user type ID.
346
-
400
+
347
401
  Args:
348
402
  invitationId: The unique identifier of the invitation to update. Required.
349
403
  resend: Optional; whether to resend the invitation (boolean or compatible type).
350
404
  role: Optional; the role to assign with the invitation (string or compatible type).
351
405
  external: Optional; indicates if the invitation is for an external recipient (boolean or compatible type).
352
406
  userTypeId: Optional; the user type identifier to associate with the invitation (string, int, or compatible type).
353
-
407
+
354
408
  Returns:
355
409
  A dictionary representing the updated invitation resource as returned by the API.
356
410
  """
357
411
  if invitationId is None:
358
412
  raise ValueError("Missing required parameter 'invitationId'")
359
413
  request_body = {
360
- 'resend': resend,
361
- 'role': role,
362
- 'external': external,
363
- 'userTypeId': userTypeId,
414
+ "resend": resend,
415
+ "role": role,
416
+ "external": external,
417
+ "userTypeId": userTypeId,
364
418
  }
365
419
  request_body = {k: v for k, v in request_body.items() if v is not None}
366
420
  url = f"{self.base_url}/invitations/{invitationId}"
@@ -372,10 +426,10 @@ class WrikeApp(APIApplication):
372
426
  def delete_invitations_by_invitationid(self, invitationId) -> Any:
373
427
  """
374
428
  Deletes an invitation specified by its invitation ID.
375
-
429
+
376
430
  Args:
377
431
  invitationId: The unique identifier of the invitation to delete.
378
-
432
+
379
433
  Returns:
380
434
  A JSON-decoded response from the API after deleting the invitation.
381
435
  """
@@ -390,15 +444,15 @@ class WrikeApp(APIApplication):
390
444
  def get_a_ccount(self, fields=None) -> Any:
391
445
  """
392
446
  Retrieves account information from the API, optionally including only specified fields.
393
-
447
+
394
448
  Args:
395
449
  fields: Optional[str]. A comma-separated string of field names to include in the response. If None, all default fields are returned.
396
-
450
+
397
451
  Returns:
398
452
  Any. The JSON-decoded response from the API containing account details.
399
453
  """
400
454
  url = f"{self.base_url}/account"
401
- query_params = {k: v for k, v in [('fields', fields)] if v is not None}
455
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
402
456
  response = self._get(url, params=query_params)
403
457
  response.raise_for_status()
404
458
  return response.json()
@@ -406,15 +460,15 @@ class WrikeApp(APIApplication):
406
460
  def put_a_ccount(self, metadata=None) -> Any:
407
461
  """
408
462
  Sends a PUT request to update or create an account with the provided metadata and returns the server response as a JSON object.
409
-
463
+
410
464
  Args:
411
465
  metadata: Optional metadata to associate with the account. If provided, this will be included in the request body. The format should match the server's expected schema. Defaults to None.
412
-
466
+
413
467
  Returns:
414
468
  A JSON-decoded Python object representing the response from the account API endpoint.
415
469
  """
416
470
  request_body = {
417
- 'metadata': metadata,
471
+ "metadata": metadata,
418
472
  }
419
473
  request_body = {k: v for k, v in request_body.items() if v is not None}
420
474
  url = f"{self.base_url}/account"
@@ -423,13 +477,15 @@ class WrikeApp(APIApplication):
423
477
  response.raise_for_status()
424
478
  return response.json()
425
479
 
426
- def get_workflows(self, ) -> Any:
480
+ def get_workflows(
481
+ self,
482
+ ) -> Any:
427
483
  """
428
484
  Retrieves all workflows from the server using a GET request.
429
-
485
+
430
486
  Args:
431
487
  None: This function takes no arguments
432
-
488
+
433
489
  Returns:
434
490
  The parsed JSON response containing the list of workflows.
435
491
  """
@@ -442,48 +498,54 @@ class WrikeApp(APIApplication):
442
498
  def post_workflows(self, name=None, request_body=None) -> Any:
443
499
  """
444
500
  Creates a new workflow by sending a POST request to the workflows endpoint.
445
-
501
+
446
502
  Args:
447
503
  name: Optional; the name of the workflow to create. Included as a query parameter if provided.
448
504
  request_body: Optional; the request body containing workflow details, provided as the data payload for the POST request.
449
-
505
+
450
506
  Returns:
451
507
  The JSON-decoded response from the server containing details of the created workflow.
452
508
  """
453
509
  url = f"{self.base_url}/workflows"
454
- query_params = {k: v for k, v in [('name', name)] if v is not None}
510
+ query_params = {k: v for k, v in [("name", name)] if v is not None}
455
511
  response = self._post(url, data=request_body, params=query_params)
456
512
  response.raise_for_status()
457
513
  return response.json()
458
514
 
459
- def put_workflows_by_workflowid(self, workflowId, name=None, hidden=None, request_body=None) -> Any:
515
+ def put_workflows_by_workflowid(
516
+ self, workflowId, name=None, hidden=None, request_body=None
517
+ ) -> Any:
460
518
  """
461
519
  Updates an existing workflow by workflow ID with optional name, hidden status, and request body data.
462
-
520
+
463
521
  Args:
464
522
  workflowId: The unique identifier of the workflow to update. Required.
465
523
  name: An optional new name for the workflow. If provided, updates the workflow's name.
466
524
  hidden: An optional boolean indicating whether the workflow should be hidden.
467
525
  request_body: Optional data to include in the request body when updating the workflow.
468
-
526
+
469
527
  Returns:
470
528
  The updated workflow as a JSON-decoded Python object.
471
529
  """
472
530
  if workflowId is None:
473
531
  raise ValueError("Missing required parameter 'workflowId'")
474
532
  url = f"{self.base_url}/workflows/{workflowId}"
475
- query_params = {k: v for k, v in [('name', name), ('hidden', hidden)] if v is not None}
533
+ query_params = {
534
+ k: v for k, v in [("name", name), ("hidden", hidden)] if v is not None
535
+ }
476
536
  response = self._put(url, data=request_body, params=query_params)
477
537
  response.raise_for_status()
478
538
  return response.json()
479
539
 
480
- def get_customfields(self, ) -> Any:
540
+ def get_customfields(
541
+ self,
542
+ ) -> Any:
481
543
  """
482
544
  Retrieves all custom fields from the API and returns them as a parsed JSON object.
483
-
545
+
484
546
  Args:
485
547
  None: This function takes no arguments
486
-
548
+
487
549
  Returns:
488
550
  The JSON-decoded response content containing the list of custom fields, typically as a Python dict or list, depending on the API response structure.
489
551
  """
@@ -493,10 +555,19 @@ class WrikeApp(APIApplication):
493
555
  response.raise_for_status()
494
556
  return response.json()
495
557
 
496
- def post_customfields(self, title, type, spaceId=None, sharing=None, shareds=None, settings=None, request_body=None) -> Any:
558
+ def post_customfields(
559
+ self,
560
+ title,
561
+ type,
562
+ spaceId=None,
563
+ sharing=None,
564
+ shareds=None,
565
+ settings=None,
566
+ request_body=None,
567
+ ) -> Any:
497
568
  """
498
569
  Creates a custom field by sending a POST request with the specified parameters to the customfields endpoint and returns the created field's data.
499
-
570
+
500
571
  Args:
501
572
  title: str. The name of the custom field to be created. Required.
502
573
  type: str. The type of the custom field to be created. Required.
@@ -505,7 +576,7 @@ class WrikeApp(APIApplication):
505
576
  shareds: Optional[str]. Specifies users or groups the custom field is shared with.
506
577
  settings: Optional[str]. Additional settings for the custom field in string or JSON format.
507
578
  request_body: Optional[Any]. The request body payload to include in the POST request.
508
-
579
+
509
580
  Returns:
510
581
  Any. The JSON response data representing the created custom field.
511
582
  """
@@ -514,7 +585,18 @@ class WrikeApp(APIApplication):
514
585
  if type is None:
515
586
  raise ValueError("Missing required parameter 'type'")
516
587
  url = f"{self.base_url}/customfields"
517
- query_params = {k: v for k, v in [('title', title), ('type', type), ('spaceId', spaceId), ('sharing', sharing), ('shareds', shareds), ('settings', settings)] if v is not None}
588
+ query_params = {
589
+ k: v
590
+ for k, v in [
591
+ ("title", title),
592
+ ("type", type),
593
+ ("spaceId", spaceId),
594
+ ("sharing", sharing),
595
+ ("shareds", shareds),
596
+ ("settings", settings),
597
+ ]
598
+ if v is not None
599
+ }
518
600
  response = self._post(url, data=request_body, params=query_params)
519
601
  response.raise_for_status()
520
602
  return response.json()
@@ -522,10 +604,10 @@ class WrikeApp(APIApplication):
522
604
  def get_customfields_by_customfieldid(self, customFieldId) -> Any:
523
605
  """
524
606
  Retrieves details for a custom field by its unique identifier from the API.
525
-
607
+
526
608
  Args:
527
609
  customFieldId: The unique identifier of the custom field to retrieve.
528
-
610
+
529
611
  Returns:
530
612
  A JSON-decoded response containing the custom field details.
531
613
  """
@@ -537,10 +619,23 @@ class WrikeApp(APIApplication):
537
619
  response.raise_for_status()
538
620
  return response.json()
539
621
 
540
- def put_customfields_by_customfieldid(self, customFieldId, title=None, type=None, changeScope=None, spaceId=None, sharing=None, addShareds=None, removeShareds=None, settings=None, addMirrors=None, removeMirrors=None) -> Any:
622
+ def put_customfields_by_customfieldid(
623
+ self,
624
+ customFieldId,
625
+ title=None,
626
+ type=None,
627
+ changeScope=None,
628
+ spaceId=None,
629
+ sharing=None,
630
+ addShareds=None,
631
+ removeShareds=None,
632
+ settings=None,
633
+ addMirrors=None,
634
+ removeMirrors=None,
635
+ ) -> Any:
541
636
  """
542
637
  Updates a custom field specified by its ID with the provided parameters using an HTTP PUT request.
543
-
638
+
544
639
  Args:
545
640
  customFieldId: The unique identifier of the custom field to update.
546
641
  title: Optional new title for the custom field (default is None).
@@ -553,14 +648,29 @@ class WrikeApp(APIApplication):
553
648
  settings: Optional dictionary with additional settings for the custom field (default is None).
554
649
  addMirrors: Optional list of entities to add as mirrors (default is None).
555
650
  removeMirrors: Optional list of entities to remove as mirrors (default is None).
556
-
651
+
557
652
  Returns:
558
653
  The server response as a JSON-decoded object containing the updated custom field data.
559
654
  """
560
655
  if customFieldId is None:
561
656
  raise ValueError("Missing required parameter 'customFieldId'")
562
657
  url = f"{self.base_url}/customfields/{customFieldId}"
563
- query_params = {k: v for k, v in [('title', title), ('type', type), ('changeScope', changeScope), ('spaceId', spaceId), ('sharing', sharing), ('addShareds', addShareds), ('removeShareds', removeShareds), ('settings', settings), ('addMirrors', addMirrors), ('removeMirrors', removeMirrors)] if v is not None}
658
+ query_params = {
659
+ k: v
660
+ for k, v in [
661
+ ("title", title),
662
+ ("type", type),
663
+ ("changeScope", changeScope),
664
+ ("spaceId", spaceId),
665
+ ("sharing", sharing),
666
+ ("addShareds", addShareds),
667
+ ("removeShareds", removeShareds),
668
+ ("settings", settings),
669
+ ("addMirrors", addMirrors),
670
+ ("removeMirrors", removeMirrors),
671
+ ]
672
+ if v is not None
673
+ }
564
674
  response = self._put(url, data={}, params=query_params)
565
675
  response.raise_for_status()
566
676
  return response.json()
@@ -568,10 +678,10 @@ class WrikeApp(APIApplication):
568
678
  def delete_customfields_by_customfieldid(self, customFieldId) -> Any:
569
679
  """
570
680
  Deletes a custom field resource identified by its custom field ID.
571
-
681
+
572
682
  Args:
573
683
  customFieldId: The unique identifier of the custom field to delete.
574
-
684
+
575
685
  Returns:
576
686
  The server response as a deserialized JSON object, typically containing the result of the delete operation.
577
687
  """
@@ -583,10 +693,26 @@ class WrikeApp(APIApplication):
583
693
  response.raise_for_status()
584
694
  return response.json()
585
695
 
586
- def get_folders(self, permalink=None, descendants=None, metadata=None, customFields=None, updatedDate=None, withInvitations=None, project=None, deleted=None, contractTypes=None, plainTextCustomFields=None, customItemTypes=None, pageSize=None, nextPageToken=None, fields=None) -> Any:
696
+ def get_folders(
697
+ self,
698
+ permalink=None,
699
+ descendants=None,
700
+ metadata=None,
701
+ customFields=None,
702
+ updatedDate=None,
703
+ withInvitations=None,
704
+ project=None,
705
+ deleted=None,
706
+ contractTypes=None,
707
+ plainTextCustomFields=None,
708
+ customItemTypes=None,
709
+ pageSize=None,
710
+ nextPageToken=None,
711
+ fields=None,
712
+ ) -> Any:
587
713
  """
588
714
  Retrieves a list of folders from the API, supporting extensive filtering, pagination, and field selection.
589
-
715
+
590
716
  Args:
591
717
  permalink: str or None. Filter results by folder permalink.
592
718
  descendants: bool or None. If True, include descendant folders in the results.
@@ -602,20 +728,55 @@ class WrikeApp(APIApplication):
602
728
  pageSize: int or None. Maximum number of results to return per page.
603
729
  nextPageToken: str or None. Token to retrieve the next page of results.
604
730
  fields: list or None. Specify which fields to include in the response.
605
-
731
+
606
732
  Returns:
607
733
  dict. The JSON-decoded response from the API containing folder data and related metadata.
608
734
  """
609
735
  url = f"{self.base_url}/folders"
610
- query_params = {k: v for k, v in [('permalink', permalink), ('descendants', descendants), ('metadata', metadata), ('customFields', customFields), ('updatedDate', updatedDate), ('withInvitations', withInvitations), ('project', project), ('deleted', deleted), ('contractTypes', contractTypes), ('plainTextCustomFields', plainTextCustomFields), ('customItemTypes', customItemTypes), ('pageSize', pageSize), ('nextPageToken', nextPageToken), ('fields', fields)] if v is not None}
736
+ query_params = {
737
+ k: v
738
+ for k, v in [
739
+ ("permalink", permalink),
740
+ ("descendants", descendants),
741
+ ("metadata", metadata),
742
+ ("customFields", customFields),
743
+ ("updatedDate", updatedDate),
744
+ ("withInvitations", withInvitations),
745
+ ("project", project),
746
+ ("deleted", deleted),
747
+ ("contractTypes", contractTypes),
748
+ ("plainTextCustomFields", plainTextCustomFields),
749
+ ("customItemTypes", customItemTypes),
750
+ ("pageSize", pageSize),
751
+ ("nextPageToken", nextPageToken),
752
+ ("fields", fields),
753
+ ]
754
+ if v is not None
755
+ }
611
756
  response = self._get(url, params=query_params)
612
757
  response.raise_for_status()
613
758
  return response.json()
614
759
 
615
- def get_folders_by_folderid_folders(self, folderId, permalink=None, descendants=None, metadata=None, customFields=None, updatedDate=None, withInvitations=None, project=None, contractTypes=None, plainTextCustomFields=None, customItemTypes=None, pageSize=None, nextPageToken=None, fields=None) -> Any:
760
+ def get_folders_by_folderid_folders(
761
+ self,
762
+ folderId,
763
+ permalink=None,
764
+ descendants=None,
765
+ metadata=None,
766
+ customFields=None,
767
+ updatedDate=None,
768
+ withInvitations=None,
769
+ project=None,
770
+ contractTypes=None,
771
+ plainTextCustomFields=None,
772
+ customItemTypes=None,
773
+ pageSize=None,
774
+ nextPageToken=None,
775
+ fields=None,
776
+ ) -> Any:
616
777
  """
617
778
  Retrieves subfolders of a specified folder, applying optional filters and pagination parameters.
618
-
779
+
619
780
  Args:
620
781
  folderId: str. The unique identifier of the parent folder whose subfolders are to be retrieved. Required.
621
782
  permalink: str, optional. Filter results to subfolders with the specified permalink.
@@ -631,22 +792,55 @@ class WrikeApp(APIApplication):
631
792
  pageSize: int, optional. Maximum number of subfolders to return per request, for pagination.
632
793
  nextPageToken: str, optional. Token for retrieving the next page of results.
633
794
  fields: str or list, optional. Specify fields to include in the response for each folder.
634
-
795
+
635
796
  Returns:
636
797
  dict. A JSON object containing the list of subfolders matching the criteria, along with pagination tokens and any requested metadata.
637
798
  """
638
799
  if folderId is None:
639
800
  raise ValueError("Missing required parameter 'folderId'")
640
801
  url = f"{self.base_url}/folders/{folderId}/folders"
641
- query_params = {k: v for k, v in [('permalink', permalink), ('descendants', descendants), ('metadata', metadata), ('customFields', customFields), ('updatedDate', updatedDate), ('withInvitations', withInvitations), ('project', project), ('contractTypes', contractTypes), ('plainTextCustomFields', plainTextCustomFields), ('customItemTypes', customItemTypes), ('pageSize', pageSize), ('nextPageToken', nextPageToken), ('fields', fields)] if v is not None}
802
+ query_params = {
803
+ k: v
804
+ for k, v in [
805
+ ("permalink", permalink),
806
+ ("descendants", descendants),
807
+ ("metadata", metadata),
808
+ ("customFields", customFields),
809
+ ("updatedDate", updatedDate),
810
+ ("withInvitations", withInvitations),
811
+ ("project", project),
812
+ ("contractTypes", contractTypes),
813
+ ("plainTextCustomFields", plainTextCustomFields),
814
+ ("customItemTypes", customItemTypes),
815
+ ("pageSize", pageSize),
816
+ ("nextPageToken", nextPageToken),
817
+ ("fields", fields),
818
+ ]
819
+ if v is not None
820
+ }
642
821
  response = self._get(url, params=query_params)
643
822
  response.raise_for_status()
644
823
  return response.json()
645
824
 
646
- def post_folders_by_folderid_folders(self, folderId, title, description=None, shareds=None, metadata=None, customFields=None, customColumns=None, project=None, userAccessRoles=None, withInvitations=None, customItemTypeId=None, plainTextCustomFields=None, fields=None) -> Any:
825
+ def post_folders_by_folderid_folders(
826
+ self,
827
+ folderId,
828
+ title,
829
+ description=None,
830
+ shareds=None,
831
+ metadata=None,
832
+ customFields=None,
833
+ customColumns=None,
834
+ project=None,
835
+ userAccessRoles=None,
836
+ withInvitations=None,
837
+ customItemTypeId=None,
838
+ plainTextCustomFields=None,
839
+ fields=None,
840
+ ) -> Any:
647
841
  """
648
842
  Creates a new subfolder within a specified folder by folder ID, with configurable attributes such as title, description, sharing, metadata, and permissions.
649
-
843
+
650
844
  Args:
651
845
  folderId: str. The ID of the parent folder in which to create the new subfolder. Required.
652
846
  title: str. The title of the new subfolder. Required.
@@ -661,7 +855,7 @@ class WrikeApp(APIApplication):
661
855
  customItemTypeId: str or None. Optional custom item type identifier for the subfolder.
662
856
  plainTextCustomFields: dict or None. Optional plain text custom fields to set for the subfolder.
663
857
  fields: list or None. Optional list of specific fields to include in the response.
664
-
858
+
665
859
  Returns:
666
860
  dict. The newly created subfolder object as returned by the API.
667
861
  """
@@ -670,18 +864,18 @@ class WrikeApp(APIApplication):
670
864
  if title is None:
671
865
  raise ValueError("Missing required parameter 'title'")
672
866
  request_body = {
673
- 'title': title,
674
- 'description': description,
675
- 'shareds': shareds,
676
- 'metadata': metadata,
677
- 'customFields': customFields,
678
- 'customColumns': customColumns,
679
- 'project': project,
680
- 'userAccessRoles': userAccessRoles,
681
- 'withInvitations': withInvitations,
682
- 'customItemTypeId': customItemTypeId,
683
- 'plainTextCustomFields': plainTextCustomFields,
684
- 'fields': fields,
867
+ "title": title,
868
+ "description": description,
869
+ "shareds": shareds,
870
+ "metadata": metadata,
871
+ "customFields": customFields,
872
+ "customColumns": customColumns,
873
+ "project": project,
874
+ "userAccessRoles": userAccessRoles,
875
+ "withInvitations": withInvitations,
876
+ "customItemTypeId": customItemTypeId,
877
+ "plainTextCustomFields": plainTextCustomFields,
878
+ "fields": fields,
685
879
  }
686
880
  request_body = {k: v for k, v in request_body.items() if v is not None}
687
881
  url = f"{self.base_url}/folders/{folderId}/folders"
@@ -693,10 +887,10 @@ class WrikeApp(APIApplication):
693
887
  def delete_folders_by_folderid(self, folderId) -> Any:
694
888
  """
695
889
  Deletes a folder resource identified by its folder ID via an HTTP DELETE request.
696
-
890
+
697
891
  Args:
698
892
  folderId: The unique identifier of the folder to delete. Must not be None.
699
-
893
+
700
894
  Returns:
701
895
  The parsed JSON response from the server if the deletion is successful.
702
896
  """
@@ -708,10 +902,31 @@ class WrikeApp(APIApplication):
708
902
  response.raise_for_status()
709
903
  return response.json()
710
904
 
711
- def put_folders_by_folderid(self, folderId, title=None, description=None, addParents=None, removeParents=None, addShareds=None, removeShareds=None, metadata=None, restore=None, customFields=None, customColumns=None, clearCustomColumns=None, project=None, addAccessRoles=None, removeAccessRoles=None, withInvitations=None, convertToCustomItemType=None, plainTextCustomFields=None, fields=None) -> Any:
905
+ def put_folders_by_folderid(
906
+ self,
907
+ folderId,
908
+ title=None,
909
+ description=None,
910
+ addParents=None,
911
+ removeParents=None,
912
+ addShareds=None,
913
+ removeShareds=None,
914
+ metadata=None,
915
+ restore=None,
916
+ customFields=None,
917
+ customColumns=None,
918
+ clearCustomColumns=None,
919
+ project=None,
920
+ addAccessRoles=None,
921
+ removeAccessRoles=None,
922
+ withInvitations=None,
923
+ convertToCustomItemType=None,
924
+ plainTextCustomFields=None,
925
+ fields=None,
926
+ ) -> Any:
712
927
  """
713
928
  Updates a folder's properties and relationships by folder ID using a PUT request.
714
-
929
+
715
930
  Args:
716
931
  folderId: str. The unique identifier of the folder to update. Required.
717
932
  title: str, optional. The new title for the folder.
@@ -732,31 +947,31 @@ class WrikeApp(APIApplication):
732
947
  convertToCustomItemType: str, optional. Converts the folder to a specific custom item type.
733
948
  plainTextCustomFields: dict, optional. Plain text fields to update.
734
949
  fields: str or list, optional. Specific fields to include in the response.
735
-
950
+
736
951
  Returns:
737
952
  dict. The JSON response containing updated folder information from the API.
738
953
  """
739
954
  if folderId is None:
740
955
  raise ValueError("Missing required parameter 'folderId'")
741
956
  request_body = {
742
- 'title': title,
743
- 'description': description,
744
- 'addParents': addParents,
745
- 'removeParents': removeParents,
746
- 'addShareds': addShareds,
747
- 'removeShareds': removeShareds,
748
- 'metadata': metadata,
749
- 'restore': restore,
750
- 'customFields': customFields,
751
- 'customColumns': customColumns,
752
- 'clearCustomColumns': clearCustomColumns,
753
- 'project': project,
754
- 'addAccessRoles': addAccessRoles,
755
- 'removeAccessRoles': removeAccessRoles,
756
- 'withInvitations': withInvitations,
757
- 'convertToCustomItemType': convertToCustomItemType,
758
- 'plainTextCustomFields': plainTextCustomFields,
759
- 'fields': fields,
957
+ "title": title,
958
+ "description": description,
959
+ "addParents": addParents,
960
+ "removeParents": removeParents,
961
+ "addShareds": addShareds,
962
+ "removeShareds": removeShareds,
963
+ "metadata": metadata,
964
+ "restore": restore,
965
+ "customFields": customFields,
966
+ "customColumns": customColumns,
967
+ "clearCustomColumns": clearCustomColumns,
968
+ "project": project,
969
+ "addAccessRoles": addAccessRoles,
970
+ "removeAccessRoles": removeAccessRoles,
971
+ "withInvitations": withInvitations,
972
+ "convertToCustomItemType": convertToCustomItemType,
973
+ "plainTextCustomFields": plainTextCustomFields,
974
+ "fields": fields,
760
975
  }
761
976
  request_body = {k: v for k, v in request_body.items() if v is not None}
762
977
  url = f"{self.base_url}/folders/{folderId}"
@@ -765,10 +980,42 @@ class WrikeApp(APIApplication):
765
980
  response.raise_for_status()
766
981
  return response.json()
767
982
 
768
- def get_tasks(self, descendants=None, title=None, status=None, importance=None, startDate=None, dueDate=None, scheduledDate=None, createdDate=None, updatedDate=None, completedDate=None, authors=None, responsibles=None, responsiblePlaceholders=None, permalink=None, type=None, limit=None, sortField=None, sortOrder=None, subTasks=None, pageSize=None, nextPageToken=None, metadata=None, customField=None, customFields=None, customStatuses=None, withInvitations=None, billingTypes=None, plainTextCustomFields=None, customItemTypes=None, fields=None) -> Any:
983
+ def get_tasks(
984
+ self,
985
+ descendants=None,
986
+ title=None,
987
+ status=None,
988
+ importance=None,
989
+ startDate=None,
990
+ dueDate=None,
991
+ scheduledDate=None,
992
+ createdDate=None,
993
+ updatedDate=None,
994
+ completedDate=None,
995
+ authors=None,
996
+ responsibles=None,
997
+ responsiblePlaceholders=None,
998
+ permalink=None,
999
+ type=None,
1000
+ limit=None,
1001
+ sortField=None,
1002
+ sortOrder=None,
1003
+ subTasks=None,
1004
+ pageSize=None,
1005
+ nextPageToken=None,
1006
+ metadata=None,
1007
+ customField=None,
1008
+ customFields=None,
1009
+ customStatuses=None,
1010
+ withInvitations=None,
1011
+ billingTypes=None,
1012
+ plainTextCustomFields=None,
1013
+ customItemTypes=None,
1014
+ fields=None,
1015
+ ) -> Any:
769
1016
  """
770
1017
  Retrieves tasks from the API with optional filtering, sorting, pagination, and field selection parameters.
771
-
1018
+
772
1019
  Args:
773
1020
  descendants: Optional; filter tasks by descendant items or folders.
774
1021
  title: Optional; filter tasks by title.
@@ -800,12 +1047,47 @@ class WrikeApp(APIApplication):
800
1047
  plainTextCustomFields: Optional; specify if custom fields should be plain text.
801
1048
  customItemTypes: Optional; filter by custom item types.
802
1049
  fields: Optional; select specific fields to include in the result.
803
-
1050
+
804
1051
  Returns:
805
1052
  The JSON-decoded API response containing a list of tasks and related metadata.
806
1053
  """
807
1054
  url = f"{self.base_url}/tasks"
808
- query_params = {k: v for k, v in [('descendants', descendants), ('title', title), ('status', status), ('importance', importance), ('startDate', startDate), ('dueDate', dueDate), ('scheduledDate', scheduledDate), ('createdDate', createdDate), ('updatedDate', updatedDate), ('completedDate', completedDate), ('authors', authors), ('responsibles', responsibles), ('responsiblePlaceholders', responsiblePlaceholders), ('permalink', permalink), ('type', type), ('limit', limit), ('sortField', sortField), ('sortOrder', sortOrder), ('subTasks', subTasks), ('pageSize', pageSize), ('nextPageToken', nextPageToken), ('metadata', metadata), ('customField', customField), ('customFields', customFields), ('customStatuses', customStatuses), ('withInvitations', withInvitations), ('billingTypes', billingTypes), ('plainTextCustomFields', plainTextCustomFields), ('customItemTypes', customItemTypes), ('fields', fields)] if v is not None}
1055
+ query_params = {
1056
+ k: v
1057
+ for k, v in [
1058
+ ("descendants", descendants),
1059
+ ("title", title),
1060
+ ("status", status),
1061
+ ("importance", importance),
1062
+ ("startDate", startDate),
1063
+ ("dueDate", dueDate),
1064
+ ("scheduledDate", scheduledDate),
1065
+ ("createdDate", createdDate),
1066
+ ("updatedDate", updatedDate),
1067
+ ("completedDate", completedDate),
1068
+ ("authors", authors),
1069
+ ("responsibles", responsibles),
1070
+ ("responsiblePlaceholders", responsiblePlaceholders),
1071
+ ("permalink", permalink),
1072
+ ("type", type),
1073
+ ("limit", limit),
1074
+ ("sortField", sortField),
1075
+ ("sortOrder", sortOrder),
1076
+ ("subTasks", subTasks),
1077
+ ("pageSize", pageSize),
1078
+ ("nextPageToken", nextPageToken),
1079
+ ("metadata", metadata),
1080
+ ("customField", customField),
1081
+ ("customFields", customFields),
1082
+ ("customStatuses", customStatuses),
1083
+ ("withInvitations", withInvitations),
1084
+ ("billingTypes", billingTypes),
1085
+ ("plainTextCustomFields", plainTextCustomFields),
1086
+ ("customItemTypes", customItemTypes),
1087
+ ("fields", fields),
1088
+ ]
1089
+ if v is not None
1090
+ }
809
1091
  response = self._get(url, params=query_params)
810
1092
  response.raise_for_status()
811
1093
  return response.json()
@@ -813,26 +1095,58 @@ class WrikeApp(APIApplication):
813
1095
  def get_tasks_by_taskid(self, taskId, fields=None) -> Any:
814
1096
  """
815
1097
  Retrieves a task by its ID from the remote service, optionally returning only specified fields.
816
-
1098
+
817
1099
  Args:
818
1100
  taskId: The unique identifier of the task to retrieve.
819
1101
  fields: Optional. A comma-separated string specifying which fields to include in the response. If None, all available fields are returned.
820
-
1102
+
821
1103
  Returns:
822
1104
  The JSON-decoded response data containing task details, as returned by the remote API.
823
1105
  """
824
1106
  if taskId is None:
825
1107
  raise ValueError("Missing required parameter 'taskId'")
826
1108
  url = f"{self.base_url}/tasks/{taskId}"
827
- query_params = {k: v for k, v in [('fields', fields)] if v is not None}
1109
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
828
1110
  response = self._get(url, params=query_params)
829
1111
  response.raise_for_status()
830
1112
  return response.json()
831
1113
 
832
- def put_tasks_by_taskid(self, taskId, title=None, description=None, status=None, importance=None, dates=None, addParents=None, removeParents=None, addShareds=None, removeShareds=None, addResponsibles=None, removeResponsibles=None, addResponsiblePlaceholders=None, removeResponsiblePlaceholders=None, addFollowers=None, follow=None, priorityBefore=None, priorityAfter=None, addSuperTasks=None, removeSuperTasks=None, metadata=None, customFields=None, customStatus=None, restore=None, effortAllocation=None, billingType=None, withInvitations=None, convertToCustomItemType=None, plainTextCustomFields=None, fields=None) -> Any:
1114
+ def put_tasks_by_taskid(
1115
+ self,
1116
+ taskId,
1117
+ title=None,
1118
+ description=None,
1119
+ status=None,
1120
+ importance=None,
1121
+ dates=None,
1122
+ addParents=None,
1123
+ removeParents=None,
1124
+ addShareds=None,
1125
+ removeShareds=None,
1126
+ addResponsibles=None,
1127
+ removeResponsibles=None,
1128
+ addResponsiblePlaceholders=None,
1129
+ removeResponsiblePlaceholders=None,
1130
+ addFollowers=None,
1131
+ follow=None,
1132
+ priorityBefore=None,
1133
+ priorityAfter=None,
1134
+ addSuperTasks=None,
1135
+ removeSuperTasks=None,
1136
+ metadata=None,
1137
+ customFields=None,
1138
+ customStatus=None,
1139
+ restore=None,
1140
+ effortAllocation=None,
1141
+ billingType=None,
1142
+ withInvitations=None,
1143
+ convertToCustomItemType=None,
1144
+ plainTextCustomFields=None,
1145
+ fields=None,
1146
+ ) -> Any:
833
1147
  """
834
1148
  Updates the properties and relationships of a task specified by its ID, applying the given changes and returning the updated task data as a JSON object.
835
-
1149
+
836
1150
  Args:
837
1151
  taskId: str. The unique identifier of the task to update. Must not be None.
838
1152
  title: Optional[str]. The new title for the task.
@@ -864,42 +1178,42 @@ class WrikeApp(APIApplication):
864
1178
  convertToCustomItemType: Optional[str]. Identifier to convert the task to a custom item type.
865
1179
  plainTextCustomFields: Optional[dict]. Plain text values for custom fields.
866
1180
  fields: Optional[list]. List of fields to include in the response.
867
-
1181
+
868
1182
  Returns:
869
1183
  dict. The JSON response containing updated task details as returned by the server.
870
1184
  """
871
1185
  if taskId is None:
872
1186
  raise ValueError("Missing required parameter 'taskId'")
873
1187
  request_body = {
874
- 'title': title,
875
- 'description': description,
876
- 'status': status,
877
- 'importance': importance,
878
- 'dates': dates,
879
- 'addParents': addParents,
880
- 'removeParents': removeParents,
881
- 'addShareds': addShareds,
882
- 'removeShareds': removeShareds,
883
- 'addResponsibles': addResponsibles,
884
- 'removeResponsibles': removeResponsibles,
885
- 'addResponsiblePlaceholders': addResponsiblePlaceholders,
886
- 'removeResponsiblePlaceholders': removeResponsiblePlaceholders,
887
- 'addFollowers': addFollowers,
888
- 'follow': follow,
889
- 'priorityBefore': priorityBefore,
890
- 'priorityAfter': priorityAfter,
891
- 'addSuperTasks': addSuperTasks,
892
- 'removeSuperTasks': removeSuperTasks,
893
- 'metadata': metadata,
894
- 'customFields': customFields,
895
- 'customStatus': customStatus,
896
- 'restore': restore,
897
- 'effortAllocation': effortAllocation,
898
- 'billingType': billingType,
899
- 'withInvitations': withInvitations,
900
- 'convertToCustomItemType': convertToCustomItemType,
901
- 'plainTextCustomFields': plainTextCustomFields,
902
- 'fields': fields,
1188
+ "title": title,
1189
+ "description": description,
1190
+ "status": status,
1191
+ "importance": importance,
1192
+ "dates": dates,
1193
+ "addParents": addParents,
1194
+ "removeParents": removeParents,
1195
+ "addShareds": addShareds,
1196
+ "removeShareds": removeShareds,
1197
+ "addResponsibles": addResponsibles,
1198
+ "removeResponsibles": removeResponsibles,
1199
+ "addResponsiblePlaceholders": addResponsiblePlaceholders,
1200
+ "removeResponsiblePlaceholders": removeResponsiblePlaceholders,
1201
+ "addFollowers": addFollowers,
1202
+ "follow": follow,
1203
+ "priorityBefore": priorityBefore,
1204
+ "priorityAfter": priorityAfter,
1205
+ "addSuperTasks": addSuperTasks,
1206
+ "removeSuperTasks": removeSuperTasks,
1207
+ "metadata": metadata,
1208
+ "customFields": customFields,
1209
+ "customStatus": customStatus,
1210
+ "restore": restore,
1211
+ "effortAllocation": effortAllocation,
1212
+ "billingType": billingType,
1213
+ "withInvitations": withInvitations,
1214
+ "convertToCustomItemType": convertToCustomItemType,
1215
+ "plainTextCustomFields": plainTextCustomFields,
1216
+ "fields": fields,
903
1217
  }
904
1218
  request_body = {k: v for k, v in request_body.items() if v is not None}
905
1219
  url = f"{self.base_url}/tasks/{taskId}"
@@ -911,10 +1225,10 @@ class WrikeApp(APIApplication):
911
1225
  def delete_tasks_by_taskid(self, taskId) -> Any:
912
1226
  """
913
1227
  Deletes a task identified by the given task ID via an HTTP DELETE request and returns the response as a JSON object.
914
-
1228
+
915
1229
  Args:
916
1230
  taskId: The unique identifier of the task to be deleted. Must not be None.
917
-
1231
+
918
1232
  Returns:
919
1233
  A JSON object containing the API response to the delete operation.
920
1234
  """
@@ -926,10 +1240,36 @@ class WrikeApp(APIApplication):
926
1240
  response.raise_for_status()
927
1241
  return response.json()
928
1242
 
929
- def post_folders_by_folderid_tasks(self, folderId, title, description=None, status=None, importance=None, dates=None, shareds=None, parents=None, responsibles=None, responsiblePlaceholders=None, followers=None, follow=None, priorityBefore=None, priorityAfter=None, superTasks=None, metadata=None, customFields=None, customStatus=None, effortAllocation=None, billingType=None, withInvitations=None, customItemTypeId=None, plainTextCustomFields=None, fields=None) -> Any:
1243
+ def post_folders_by_folderid_tasks(
1244
+ self,
1245
+ folderId,
1246
+ title,
1247
+ description=None,
1248
+ status=None,
1249
+ importance=None,
1250
+ dates=None,
1251
+ shareds=None,
1252
+ parents=None,
1253
+ responsibles=None,
1254
+ responsiblePlaceholders=None,
1255
+ followers=None,
1256
+ follow=None,
1257
+ priorityBefore=None,
1258
+ priorityAfter=None,
1259
+ superTasks=None,
1260
+ metadata=None,
1261
+ customFields=None,
1262
+ customStatus=None,
1263
+ effortAllocation=None,
1264
+ billingType=None,
1265
+ withInvitations=None,
1266
+ customItemTypeId=None,
1267
+ plainTextCustomFields=None,
1268
+ fields=None,
1269
+ ) -> Any:
930
1270
  """
931
1271
  Creates a new task within a specified folder by folder ID, with configurable attributes such as title, description, status, importance, dates, assigned users, metadata, custom fields, and other options.
932
-
1272
+
933
1273
  Args:
934
1274
  folderId: str or int. The unique identifier of the folder in which to create the new task. Required.
935
1275
  title: str. The title of the task to be created. Required.
@@ -955,7 +1295,7 @@ class WrikeApp(APIApplication):
955
1295
  customItemTypeId: str or int, optional. Custom item type identifier.
956
1296
  plainTextCustomFields: dict or list, optional. Custom fields in plain text format.
957
1297
  fields: list or str, optional. Specifies which fields should be included in the API response.
958
-
1298
+
959
1299
  Returns:
960
1300
  dict. The JSON response from the server containing details of the newly created task.
961
1301
  """
@@ -964,29 +1304,29 @@ class WrikeApp(APIApplication):
964
1304
  if title is None:
965
1305
  raise ValueError("Missing required parameter 'title'")
966
1306
  request_body = {
967
- 'title': title,
968
- 'description': description,
969
- 'status': status,
970
- 'importance': importance,
971
- 'dates': dates,
972
- 'shareds': shareds,
973
- 'parents': parents,
974
- 'responsibles': responsibles,
975
- 'responsiblePlaceholders': responsiblePlaceholders,
976
- 'followers': followers,
977
- 'follow': follow,
978
- 'priorityBefore': priorityBefore,
979
- 'priorityAfter': priorityAfter,
980
- 'superTasks': superTasks,
981
- 'metadata': metadata,
982
- 'customFields': customFields,
983
- 'customStatus': customStatus,
984
- 'effortAllocation': effortAllocation,
985
- 'billingType': billingType,
986
- 'withInvitations': withInvitations,
987
- 'customItemTypeId': customItemTypeId,
988
- 'plainTextCustomFields': plainTextCustomFields,
989
- 'fields': fields,
1307
+ "title": title,
1308
+ "description": description,
1309
+ "status": status,
1310
+ "importance": importance,
1311
+ "dates": dates,
1312
+ "shareds": shareds,
1313
+ "parents": parents,
1314
+ "responsibles": responsibles,
1315
+ "responsiblePlaceholders": responsiblePlaceholders,
1316
+ "followers": followers,
1317
+ "follow": follow,
1318
+ "priorityBefore": priorityBefore,
1319
+ "priorityAfter": priorityAfter,
1320
+ "superTasks": superTasks,
1321
+ "metadata": metadata,
1322
+ "customFields": customFields,
1323
+ "customStatus": customStatus,
1324
+ "effortAllocation": effortAllocation,
1325
+ "billingType": billingType,
1326
+ "withInvitations": withInvitations,
1327
+ "customItemTypeId": customItemTypeId,
1328
+ "plainTextCustomFields": plainTextCustomFields,
1329
+ "fields": fields,
990
1330
  }
991
1331
  request_body = {k: v for k, v in request_body.items() if v is not None}
992
1332
  url = f"{self.base_url}/folders/{folderId}/tasks"
@@ -998,10 +1338,10 @@ class WrikeApp(APIApplication):
998
1338
  def list_tools(self):
999
1339
  """
1000
1340
  Returns a list of references to tool-related instance methods for managing contacts, users, groups, invitations, accounts, workflows, custom fields, folders, and tasks.
1001
-
1341
+
1002
1342
  Args:
1003
1343
  None: This method does not take any arguments.
1004
-
1344
+
1005
1345
  Returns:
1006
1346
  list: A list of method references corresponding to various instance-level API operations for managing organizational entities such as contacts, users, groups, invitations, accounts, workflows, custom fields, folders, and tasks.
1007
1347
  """
@@ -1040,5 +1380,5 @@ class WrikeApp(APIApplication):
1040
1380
  self.get_tasks_by_taskid,
1041
1381
  self.put_tasks_by_taskid,
1042
1382
  self.delete_tasks_by_taskid,
1043
- self.post_folders_by_folderid_tasks
1383
+ self.post_folders_by_folderid_tasks,
1044
1384
  ]