universal-mcp 0.1.7rc2__py3-none-any.whl → 0.1.8__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 (61) hide show
  1. universal_mcp/__init__.py +0 -2
  2. universal_mcp/analytics.py +75 -0
  3. universal_mcp/applications/ahrefs/README.md +76 -0
  4. universal_mcp/applications/ahrefs/app.py +2291 -0
  5. universal_mcp/applications/application.py +95 -5
  6. universal_mcp/applications/calendly/README.md +78 -0
  7. universal_mcp/applications/calendly/__init__.py +0 -0
  8. universal_mcp/applications/calendly/app.py +1195 -0
  9. universal_mcp/applications/coda/README.md +133 -0
  10. universal_mcp/applications/coda/__init__.py +0 -0
  11. universal_mcp/applications/coda/app.py +3671 -0
  12. universal_mcp/applications/e2b/app.py +14 -35
  13. universal_mcp/applications/figma/README.md +74 -0
  14. universal_mcp/applications/figma/__init__.py +0 -0
  15. universal_mcp/applications/figma/app.py +1261 -0
  16. universal_mcp/applications/firecrawl/app.py +29 -32
  17. universal_mcp/applications/github/app.py +127 -85
  18. universal_mcp/applications/google_calendar/app.py +62 -138
  19. universal_mcp/applications/google_docs/app.py +47 -52
  20. universal_mcp/applications/google_drive/app.py +119 -113
  21. universal_mcp/applications/google_mail/app.py +124 -50
  22. universal_mcp/applications/google_sheet/app.py +89 -91
  23. universal_mcp/applications/markitdown/app.py +9 -8
  24. universal_mcp/applications/notion/app.py +254 -134
  25. universal_mcp/applications/perplexity/app.py +13 -45
  26. universal_mcp/applications/reddit/app.py +94 -85
  27. universal_mcp/applications/resend/app.py +12 -23
  28. universal_mcp/applications/{serp → serpapi}/app.py +14 -33
  29. universal_mcp/applications/tavily/app.py +11 -28
  30. universal_mcp/applications/wrike/README.md +71 -0
  31. universal_mcp/applications/wrike/__init__.py +0 -0
  32. universal_mcp/applications/wrike/app.py +1372 -0
  33. universal_mcp/applications/youtube/README.md +82 -0
  34. universal_mcp/applications/youtube/__init__.py +0 -0
  35. universal_mcp/applications/youtube/app.py +1428 -0
  36. universal_mcp/applications/zenquotes/app.py +12 -2
  37. universal_mcp/exceptions.py +9 -2
  38. universal_mcp/integrations/__init__.py +24 -1
  39. universal_mcp/integrations/agentr.py +27 -4
  40. universal_mcp/integrations/integration.py +143 -30
  41. universal_mcp/logger.py +3 -56
  42. universal_mcp/servers/__init__.py +6 -14
  43. universal_mcp/servers/server.py +201 -146
  44. universal_mcp/stores/__init__.py +7 -2
  45. universal_mcp/stores/store.py +103 -40
  46. universal_mcp/tools/__init__.py +3 -0
  47. universal_mcp/tools/adapters.py +43 -0
  48. universal_mcp/tools/func_metadata.py +213 -0
  49. universal_mcp/tools/tools.py +342 -0
  50. universal_mcp/utils/docgen.py +325 -119
  51. universal_mcp/utils/docstring_parser.py +179 -0
  52. universal_mcp/utils/dump_app_tools.py +33 -23
  53. universal_mcp/utils/installation.py +199 -8
  54. universal_mcp/utils/openapi.py +229 -46
  55. {universal_mcp-0.1.7rc2.dist-info → universal_mcp-0.1.8.dist-info}/METADATA +9 -5
  56. universal_mcp-0.1.8.dist-info/RECORD +81 -0
  57. universal_mcp-0.1.7rc2.dist-info/RECORD +0 -58
  58. /universal_mcp/{utils/bridge.py → applications/ahrefs/__init__.py} +0 -0
  59. /universal_mcp/applications/{serp → serpapi}/README.md +0 -0
  60. {universal_mcp-0.1.7rc2.dist-info → universal_mcp-0.1.8.dist-info}/WHEEL +0 -0
  61. {universal_mcp-0.1.7rc2.dist-info → universal_mcp-0.1.8.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,1261 @@
1
+ from typing import Any
2
+
3
+ from universal_mcp.applications import APIApplication
4
+ from universal_mcp.integrations import Integration
5
+
6
+
7
+ class FigmaApp(APIApplication):
8
+ def __init__(self, integration: Integration = None, **kwargs) -> None:
9
+ super().__init__(name="figma", integration=integration, **kwargs)
10
+ self.base_url = "https://api.figma.com"
11
+
12
+ def get_file(
13
+ self,
14
+ file_key,
15
+ version=None,
16
+ ids=None,
17
+ depth=None,
18
+ geometry=None,
19
+ plugin_data=None,
20
+ branch_data=None,
21
+ ) -> Any:
22
+ """
23
+ Retrieves file metadata and content from the API using the specified file key and optional query parameters.
24
+
25
+ Args:
26
+ file_key: str. The unique identifier for the file to retrieve. Required.
27
+ version: Optional[str]. The version of the file to retrieve. If not specified, the latest version is returned.
28
+ ids: Optional[str or list]. Specific node IDs within the file to retrieve.
29
+ depth: Optional[int]. The depth of the node tree to fetch for the file.
30
+ geometry: Optional[str]. The geometry format to use when retrieving the file.
31
+ plugin_data: Optional[str]. Plugin data to include in the response, if applicable.
32
+ branch_data: Optional[str]. Branch data to include in the response, if applicable.
33
+
34
+ Returns:
35
+ dict. The JSON-decoded response containing file metadata and content.
36
+
37
+ Raises:
38
+ ValueError: Raised if 'file_key' is not provided.
39
+ requests.HTTPError: Raised if the API request fails (non-2xx response).
40
+
41
+ Tags:
42
+ get, file, api, metadata, content, important
43
+ """
44
+ if file_key is None:
45
+ raise ValueError("Missing required parameter 'file_key'")
46
+ url = f"{self.base_url}/v1/files/{file_key}"
47
+ query_params = {
48
+ k: v
49
+ for k, v in [
50
+ ("version", version),
51
+ ("ids", ids),
52
+ ("depth", depth),
53
+ ("geometry", geometry),
54
+ ("plugin_data", plugin_data),
55
+ ("branch_data", branch_data),
56
+ ]
57
+ if v is not None
58
+ }
59
+ response = self._get(url, params=query_params)
60
+ response.raise_for_status()
61
+ return response.json()
62
+
63
+ def get_file_nodes(
64
+ self, file_key, ids, version=None, depth=None, geometry=None, plugin_data=None
65
+ ) -> Any:
66
+ """
67
+ Fetches node data for specified IDs from a file, supporting optional filters such as version, depth, geometry, and plugin data.
68
+
69
+ Args:
70
+ file_key: str. The unique key identifying the file to query. Required.
71
+ ids: str or list. The node ID(s) to retrieve from the file. Required.
72
+ version: str or None. Optional file version to query. Defaults to the latest if not specified.
73
+ depth: int or None. Optional depth for retrieving nested node data.
74
+ geometry: str or None. Optional geometry specifier to filter node data.
75
+ plugin_data: str or None. Optional plugin data to include in the response.
76
+
77
+ Returns:
78
+ dict. The JSON-decoded response containing node data for the requested IDs.
79
+
80
+ Raises:
81
+ ValueError: Raised if 'file_key' or 'ids' is not provided.
82
+
83
+ Tags:
84
+ get, fetch, node-data, file, api
85
+ """
86
+ if file_key is None:
87
+ raise ValueError("Missing required parameter 'file_key'")
88
+ if ids is None:
89
+ raise ValueError("Missing required parameter 'ids'")
90
+ url = f"{self.base_url}/v1/files/{file_key}/nodes"
91
+ query_params = {
92
+ k: v
93
+ for k, v in [
94
+ ("ids", ids),
95
+ ("version", version),
96
+ ("depth", depth),
97
+ ("geometry", geometry),
98
+ ("plugin_data", plugin_data),
99
+ ]
100
+ if v is not None
101
+ }
102
+ response = self._get(url, params=query_params)
103
+ response.raise_for_status()
104
+ return response.json()
105
+
106
+ def get_images(
107
+ self,
108
+ file_key,
109
+ ids,
110
+ version=None,
111
+ scale=None,
112
+ format=None,
113
+ svg_outline_text=None,
114
+ svg_include_id=None,
115
+ svg_include_node_id=None,
116
+ svg_simplify_stroke=None,
117
+ contents_only=None,
118
+ use_absolute_bounds=None,
119
+ ) -> Any:
120
+ """
121
+ Retrieves image assets from a remote service for specified node IDs within a given file, with optional image format and export options.
122
+
123
+ Args:
124
+ file_key: str. Unique key identifying the target file. Required.
125
+ ids: str. Comma-separated list of node IDs to export as images. Required.
126
+ version: str, optional. Specific file version to export from.
127
+ scale: float, optional. Image scaling factor; must be between 0.01 and 4.
128
+ format: str, optional. Output image format (e.g., 'png', 'jpg', 'svg').
129
+ svg_outline_text: bool, optional. If True, outlines text in SVG exports.
130
+ svg_include_id: bool, optional. If True, includes node IDs in SVG elements.
131
+ svg_include_node_id: bool, optional. If True, includes node IDs as attributes in SVG.
132
+ svg_simplify_stroke: bool, optional. If True, simplifies SVG strokes.
133
+ contents_only: bool, optional. If True, exports only node contents without background.
134
+ use_absolute_bounds: bool, optional. If True, uses absolute bounding box for export.
135
+
136
+ Returns:
137
+ dict. Parsed JSON response containing image export links and metadata.
138
+
139
+ Raises:
140
+ ValueError: Raised if either 'file_key' or 'ids' is not provided.
141
+ requests.HTTPError: Raised if the HTTP request for image assets fails.
142
+
143
+ Tags:
144
+ get, images, export, api-call, batch, important
145
+ """
146
+ if file_key is None:
147
+ raise ValueError("Missing required parameter 'file_key'")
148
+ if ids is None:
149
+ raise ValueError("Missing required parameter 'ids'")
150
+ url = f"{self.base_url}/v1/images/{file_key}"
151
+ query_params = {
152
+ k: v
153
+ for k, v in [
154
+ ("ids", ids),
155
+ ("version", version),
156
+ ("scale", scale),
157
+ ("format", format),
158
+ ("svg_outline_text", svg_outline_text),
159
+ ("svg_include_id", svg_include_id),
160
+ ("svg_include_node_id", svg_include_node_id),
161
+ ("svg_simplify_stroke", svg_simplify_stroke),
162
+ ("contents_only", contents_only),
163
+ ("use_absolute_bounds", use_absolute_bounds),
164
+ ]
165
+ if v is not None
166
+ }
167
+ response = self._get(url, params=query_params)
168
+ response.raise_for_status()
169
+ return response.json()
170
+
171
+ def get_image_fills(self, file_key) -> Any:
172
+ """
173
+ Retrieves image fill data for a given file key from the API.
174
+
175
+ Args:
176
+ file_key: The unique identifier of the file whose image fills are to be retrieved.
177
+
178
+ Returns:
179
+ A dictionary or list containing the image fill data as returned by the API.
180
+
181
+ Raises:
182
+ ValueError: If 'file_key' is None.
183
+ HTTPError: If the HTTP request to the API fails with an error status.
184
+
185
+ Tags:
186
+ get, images, api
187
+ """
188
+ if file_key is None:
189
+ raise ValueError("Missing required parameter 'file_key'")
190
+ url = f"{self.base_url}/v1/files/{file_key}/images"
191
+ query_params = {}
192
+ response = self._get(url, params=query_params)
193
+ response.raise_for_status()
194
+ return response.json()
195
+
196
+ def get_team_projects(self, team_id) -> Any:
197
+ """
198
+ Retrieves the list of projects associated with a specified team.
199
+
200
+ Args:
201
+ team_id: The unique identifier of the team whose projects are to be fetched.
202
+
203
+ Returns:
204
+ A deserialized JSON object containing the projects for the given team.
205
+
206
+ Raises:
207
+ ValueError: If 'team_id' is None.
208
+ requests.HTTPError: If the HTTP request to fetch team projects fails.
209
+
210
+ Tags:
211
+ get, list, team-projects, management, important
212
+ """
213
+ if team_id is None:
214
+ raise ValueError("Missing required parameter 'team_id'")
215
+ url = f"{self.base_url}/v1/teams/{team_id}/projects"
216
+ query_params = {}
217
+ response = self._get(url, params=query_params)
218
+ response.raise_for_status()
219
+ return response.json()
220
+
221
+ def get_project_files(self, project_id, branch_data=None) -> Any:
222
+ """
223
+ Retrieves the list of files associated with a specified project, optionally filtered by branch data.
224
+
225
+ Args:
226
+ project_id: The unique identifier for the project whose files are to be retrieved.
227
+ branch_data: Optional branch identifier or data used to filter project files. Defaults to None.
228
+
229
+ Returns:
230
+ A JSON-decoded object containing the project's file information as returned by the API.
231
+
232
+ Raises:
233
+ ValueError: If the required parameter 'project_id' is not provided.
234
+ requests.HTTPError: If the HTTP request to retrieve the project files fails.
235
+
236
+ Tags:
237
+ get, project, files, api, important
238
+ """
239
+ if project_id is None:
240
+ raise ValueError("Missing required parameter 'project_id'")
241
+ url = f"{self.base_url}/v1/projects/{project_id}/files"
242
+ query_params = {
243
+ k: v for k, v in [("branch_data", branch_data)] if v is not None
244
+ }
245
+ response = self._get(url, params=query_params)
246
+ response.raise_for_status()
247
+ return response.json()
248
+
249
+ def get_file_versions(
250
+ self, file_key, page_size=None, before=None, after=None
251
+ ) -> Any:
252
+ """
253
+ Retrieves a paginated list of version history for a specified file.
254
+
255
+ Args:
256
+ file_key: The unique identifier of the file for which to fetch version history.
257
+ page_size: Optional; The maximum number of versions to return per page.
258
+ before: Optional; A version identifier. Only versions created before this version will be returned.
259
+ after: Optional; A version identifier. Only versions created after this version will be returned.
260
+
261
+ Returns:
262
+ A JSON-decoded object containing the list of file versions and pagination information.
263
+
264
+ Raises:
265
+ ValueError: If 'file_key' is None.
266
+ HTTPError: If the HTTP request to fetch the file versions fails.
267
+
268
+ Tags:
269
+ list, file-management, version-history, api
270
+ """
271
+ if file_key is None:
272
+ raise ValueError("Missing required parameter 'file_key'")
273
+ url = f"{self.base_url}/v1/files/{file_key}/versions"
274
+ query_params = {
275
+ k: v
276
+ for k, v in [("page_size", page_size), ("before", before), ("after", after)]
277
+ if v is not None
278
+ }
279
+ response = self._get(url, params=query_params)
280
+ response.raise_for_status()
281
+ return response.json()
282
+
283
+ def get_comments(self, file_key, as_md=None) -> Any:
284
+ """
285
+ Retrieves comments for a specified file, optionally formatting the output as Markdown.
286
+
287
+ Args:
288
+ file_key: The unique identifier of the file to fetch comments for.
289
+ as_md: Optional; if specified, comments are returned as Markdown. Default is None.
290
+
291
+ Returns:
292
+ A JSON-compatible object containing the file's comments.
293
+
294
+ Raises:
295
+ ValueError: Raised if the required parameter 'file_key' is not provided.
296
+ HTTPError: Raised if the HTTP request for fetching comments fails.
297
+
298
+ Tags:
299
+ get, comments, file, api, important
300
+ """
301
+ if file_key is None:
302
+ raise ValueError("Missing required parameter 'file_key'")
303
+ url = f"{self.base_url}/v1/files/{file_key}/comments"
304
+ query_params = {k: v for k, v in [("as_md", as_md)] if v is not None}
305
+ response = self._get(url, params=query_params)
306
+ response.raise_for_status()
307
+ return response.json()
308
+
309
+ def post_comment(self, file_key, message, comment_id=None, client_meta=None) -> Any:
310
+ """
311
+ Posts a comment to a specified file.
312
+
313
+ Args:
314
+ file_key: String identifier of the file to which the comment will be posted.
315
+ message: String content of the comment to be posted.
316
+ comment_id: Optional string identifier for the comment, used for threading or replying to existing comments.
317
+ client_meta: Optional dictionary containing client-specific metadata to be associated with the comment.
318
+
319
+ Returns:
320
+ Dictionary containing the response data of the created comment from the API.
321
+
322
+ Raises:
323
+ ValueError: Raised when required parameters 'file_key' or 'message' are None.
324
+ HTTPError: Raised when the API request fails, as indicated by response.raise_for_status().
325
+
326
+ Tags:
327
+ post, comment, file, api, communication, important
328
+ """
329
+ if file_key is None:
330
+ raise ValueError("Missing required parameter 'file_key'")
331
+ if message is None:
332
+ raise ValueError("Missing required parameter 'message'")
333
+ request_body = {
334
+ "message": message,
335
+ "comment_id": comment_id,
336
+ "client_meta": client_meta,
337
+ }
338
+ request_body = {k: v for k, v in request_body.items() if v is not None}
339
+ url = f"{self.base_url}/v1/files/{file_key}/comments"
340
+ query_params = {}
341
+ response = self._post(url, data=request_body, params=query_params)
342
+ response.raise_for_status()
343
+ return response.json()
344
+
345
+ def delete_comment(self, file_key, comment_id) -> Any:
346
+ """
347
+ Deletes a specific comment from a file identified by its key and comment ID.
348
+
349
+ Args:
350
+ file_key: The unique identifier of the file containing the comment to be deleted. Must not be None.
351
+ comment_id: The unique identifier of the comment to delete. Must not be None.
352
+
353
+ Returns:
354
+ The server response as a JSON object containing details of the deletion or confirmation.
355
+
356
+ Raises:
357
+ ValueError: If 'file_key' or 'comment_id' is None.
358
+ requests.HTTPError: If the HTTP request to delete the comment fails with a non-success status code.
359
+
360
+ Tags:
361
+ delete, comment, file-management, api
362
+ """
363
+ if file_key is None:
364
+ raise ValueError("Missing required parameter 'file_key'")
365
+ if comment_id is None:
366
+ raise ValueError("Missing required parameter 'comment_id'")
367
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}"
368
+ query_params = {}
369
+ response = self._delete(url, params=query_params)
370
+ response.raise_for_status()
371
+ return response.json()
372
+
373
+ def get_comment_reactions(self, file_key, comment_id, cursor=None) -> Any:
374
+ """
375
+ Retrieves the reactions associated with a specific comment in a file.
376
+
377
+ Args:
378
+ file_key: str. The unique identifier of the file containing the comment.
379
+ comment_id: str. The unique identifier of the comment whose reactions are to be retrieved.
380
+ cursor: Optional[str]. A pagination cursor for fetching subsequent pages of reactions. Defaults to None.
381
+
382
+ Returns:
383
+ dict. A JSON-decoded dictionary containing the comment reactions data from the API response.
384
+
385
+ Raises:
386
+ ValueError: Raised if 'file_key' or 'comment_id' is None.
387
+ requests.HTTPError: Raised if the HTTP request to the API fails or returns an error status code.
388
+
389
+ Tags:
390
+ get, list, reactions, comments, file, api, important
391
+ """
392
+ if file_key is None:
393
+ raise ValueError("Missing required parameter 'file_key'")
394
+ if comment_id is None:
395
+ raise ValueError("Missing required parameter 'comment_id'")
396
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
397
+ query_params = {k: v for k, v in [("cursor", cursor)] if v is not None}
398
+ response = self._get(url, params=query_params)
399
+ response.raise_for_status()
400
+ return response.json()
401
+
402
+ def post_comment_reaction(self, file_key, comment_id, emoji) -> Any:
403
+ """
404
+ Posts a reaction emoji to a specific comment on a file.
405
+
406
+ Args:
407
+ file_key: str. Identifier for the file containing the comment.
408
+ comment_id: str. Identifier of the comment to react to.
409
+ emoji: str. The emoji to be used as the reaction.
410
+
411
+ Returns:
412
+ dict. The JSON-decoded response from the server after posting the reaction.
413
+
414
+ Raises:
415
+ ValueError: Raised if any of the parameters 'file_key', 'comment_id', or 'emoji' are None.
416
+ requests.HTTPError: Raised if the HTTP request to post the reaction fails.
417
+
418
+ Tags:
419
+ post, comment, reaction, emoji, async_job, ai
420
+ """
421
+ if file_key is None:
422
+ raise ValueError("Missing required parameter 'file_key'")
423
+ if comment_id is None:
424
+ raise ValueError("Missing required parameter 'comment_id'")
425
+ if emoji is None:
426
+ raise ValueError("Missing required parameter 'emoji'")
427
+ request_body = {
428
+ "emoji": emoji,
429
+ }
430
+ request_body = {k: v for k, v in request_body.items() if v is not None}
431
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
432
+ query_params = {}
433
+ response = self._post(url, data=request_body, params=query_params)
434
+ response.raise_for_status()
435
+ return response.json()
436
+
437
+ def delete_comment_reaction(self, file_key, comment_id, emoji) -> Any:
438
+ """
439
+ Removes a specific emoji reaction from a comment in a file.
440
+
441
+ Args:
442
+ file_key: The unique identifier of the file containing the comment.
443
+ comment_id: The unique identifier of the comment whose reaction should be deleted.
444
+ emoji: The emoji reaction to be removed from the comment.
445
+
446
+ Returns:
447
+ The parsed JSON response from the API after deleting the reaction.
448
+
449
+ Raises:
450
+ ValueError: Raised if 'file_key', 'comment_id', or 'emoji' is None.
451
+ requests.HTTPError: Raised if the HTTP request to delete the reaction fails.
452
+
453
+ Tags:
454
+ delete, comment-reaction, management, api
455
+ """
456
+ if file_key is None:
457
+ raise ValueError("Missing required parameter 'file_key'")
458
+ if comment_id is None:
459
+ raise ValueError("Missing required parameter 'comment_id'")
460
+ if emoji is None:
461
+ raise ValueError("Missing required parameter 'emoji'")
462
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
463
+ query_params = {k: v for k, v in [("emoji", emoji)] if v is not None}
464
+ response = self._delete(url, params=query_params)
465
+ response.raise_for_status()
466
+ return response.json()
467
+
468
+ def get_me(
469
+ self,
470
+ ) -> Any:
471
+ """
472
+ Retrieves information about the authenticated user from the API.
473
+
474
+ Args:
475
+ None: This function takes no arguments
476
+
477
+ Returns:
478
+ A dictionary containing the user's information as returned by the API.
479
+
480
+ Raises:
481
+ HTTPError: If the HTTP request to the API fails or returns a non-successful status code.
482
+
483
+ Tags:
484
+ get, user, profile, api, important
485
+ """
486
+ url = f"{self.base_url}/v1/me"
487
+ query_params = {}
488
+ response = self._get(url, params=query_params)
489
+ response.raise_for_status()
490
+ return response.json()
491
+
492
+ def get_team_components(
493
+ self, team_id, page_size=None, after=None, before=None
494
+ ) -> Any:
495
+ """
496
+ Retrieves a paginated list of components associated with a specified team.
497
+
498
+ Args:
499
+ team_id: str. The unique identifier of the team whose components are to be retrieved.
500
+ page_size: Optional[int]. The maximum number of components to return per page.
501
+ after: Optional[str]. A cursor for pagination to fetch results after this value.
502
+ before: Optional[str]. A cursor for pagination to fetch results before this value.
503
+
504
+ Returns:
505
+ dict. A JSON-decoded dictionary containing the team components and pagination details.
506
+
507
+ Raises:
508
+ ValueError: Raised if 'team_id' is not provided.
509
+ requests.exceptions.HTTPError: Raised if the HTTP request to fetch components fails.
510
+
511
+ Tags:
512
+ get, list, components, team, api, pagination
513
+ """
514
+ if team_id is None:
515
+ raise ValueError("Missing required parameter 'team_id'")
516
+ url = f"{self.base_url}/v1/teams/{team_id}/components"
517
+ query_params = {
518
+ k: v
519
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
520
+ if v is not None
521
+ }
522
+ response = self._get(url, params=query_params)
523
+ response.raise_for_status()
524
+ return response.json()
525
+
526
+ def get_file_components(self, file_key) -> Any:
527
+ """
528
+ Retrieves the component information for a specified file from the API.
529
+
530
+ Args:
531
+ file_key: The unique identifier of the file for which to fetch component details.
532
+
533
+ Returns:
534
+ A JSON-serializable object containing the components of the specified file.
535
+
536
+ Raises:
537
+ ValueError: If 'file_key' is None.
538
+ requests.exceptions.HTTPError: If the HTTP request fails or returns an unsuccessful status code.
539
+
540
+ Tags:
541
+ get, file, components, api
542
+ """
543
+ if file_key is None:
544
+ raise ValueError("Missing required parameter 'file_key'")
545
+ url = f"{self.base_url}/v1/files/{file_key}/components"
546
+ query_params = {}
547
+ response = self._get(url, params=query_params)
548
+ response.raise_for_status()
549
+ return response.json()
550
+
551
+ def get_component(self, key) -> Any:
552
+ """
553
+ Retrieves a component's details by its key from the API.
554
+
555
+ Args:
556
+ key: The unique identifier for the component to retrieve.
557
+
558
+ Returns:
559
+ A dictionary containing the component's details as returned by the API.
560
+
561
+ Raises:
562
+ ValueError: Raised if the 'key' parameter is None.
563
+ requests.HTTPError: Raised if the HTTP request fails or the response status indicates an error.
564
+
565
+ Tags:
566
+ get, component, api, management
567
+ """
568
+ if key is None:
569
+ raise ValueError("Missing required parameter 'key'")
570
+ url = f"{self.base_url}/v1/components/{key}"
571
+ query_params = {}
572
+ response = self._get(url, params=query_params)
573
+ response.raise_for_status()
574
+ return response.json()
575
+
576
+ def get_team_component_sets(
577
+ self, team_id, page_size=None, after=None, before=None
578
+ ) -> Any:
579
+ """
580
+ Retrieves a paginated list of component sets for a specified team.
581
+
582
+ Args:
583
+ team_id: str. The unique identifier of the team whose component sets are to be retrieved.
584
+ page_size: Optional[int]. The maximum number of results to return per page.
585
+ after: Optional[str]. A cursor for pagination to retrieve results after the specified object.
586
+ before: Optional[str]. A cursor for pagination to retrieve results before the specified object.
587
+
588
+ Returns:
589
+ dict. The JSON response containing the list of component sets and any associated pagination metadata.
590
+
591
+ Raises:
592
+ ValueError: If 'team_id' is None.
593
+ HTTPError: If the HTTP request to the API fails or returns an unsuccessful status code.
594
+
595
+ Tags:
596
+ list, component-sets, team, api, async-job
597
+ """
598
+ if team_id is None:
599
+ raise ValueError("Missing required parameter 'team_id'")
600
+ url = f"{self.base_url}/v1/teams/{team_id}/component_sets"
601
+ query_params = {
602
+ k: v
603
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
604
+ if v is not None
605
+ }
606
+ response = self._get(url, params=query_params)
607
+ response.raise_for_status()
608
+ return response.json()
609
+
610
+ def get_file_component_sets(self, file_key) -> Any:
611
+ """
612
+ Retrieves the list of component sets associated with a specific file key.
613
+
614
+ Args:
615
+ file_key: The unique identifier of the file whose component sets are to be fetched.
616
+
617
+ Returns:
618
+ A JSON-compatible object containing the component sets data for the specified file.
619
+
620
+ Raises:
621
+ ValueError: Raised when the required parameter 'file_key' is None.
622
+ requests.HTTPError: Raised if the HTTP request to the remote server fails or returns an unsuccessful status code.
623
+
624
+ Tags:
625
+ get, list, component-sets, file, api
626
+ """
627
+ if file_key is None:
628
+ raise ValueError("Missing required parameter 'file_key'")
629
+ url = f"{self.base_url}/v1/files/{file_key}/component_sets"
630
+ query_params = {}
631
+ response = self._get(url, params=query_params)
632
+ response.raise_for_status()
633
+ return response.json()
634
+
635
+ def get_component_set(self, key) -> Any:
636
+ """
637
+ Retrieves a component set resource by its key from the server.
638
+
639
+ Args:
640
+ key: The unique identifier (string or compatible) of the component set to retrieve. Must not be None.
641
+
642
+ Returns:
643
+ A JSON-decoded object containing the component set data as returned by the server.
644
+
645
+ Raises:
646
+ ValueError: If the 'key' parameter is None.
647
+ requests.HTTPError: If the HTTP request fails or returns an unsuccessful status code.
648
+
649
+ Tags:
650
+ get, component-set, retrieve, ai
651
+ """
652
+ if key is None:
653
+ raise ValueError("Missing required parameter 'key'")
654
+ url = f"{self.base_url}/v1/component_sets/{key}"
655
+ query_params = {}
656
+ response = self._get(url, params=query_params)
657
+ response.raise_for_status()
658
+ return response.json()
659
+
660
+ def get_team_styles(self, team_id, page_size=None, after=None, before=None) -> Any:
661
+ """
662
+ Retrieves a list of styles for a specified team, with optional pagination controls.
663
+
664
+ Args:
665
+ team_id: str. The unique identifier of the team whose styles are to be retrieved.
666
+ page_size: Optional[int]. The maximum number of style records to return per page.
667
+ after: Optional[str]. A cursor for pagination to retrieve records after a specific point.
668
+ before: Optional[str]. A cursor for pagination to retrieve records before a specific point.
669
+
670
+ Returns:
671
+ dict. The JSON response containing the team's styles and pagination information.
672
+
673
+ Raises:
674
+ ValueError: If 'team_id' is not provided.
675
+ requests.HTTPError: If the HTTP request fails or returns an error status code.
676
+
677
+ Tags:
678
+ get, list, team, styles, pagination, api
679
+ """
680
+ if team_id is None:
681
+ raise ValueError("Missing required parameter 'team_id'")
682
+ url = f"{self.base_url}/v1/teams/{team_id}/styles"
683
+ query_params = {
684
+ k: v
685
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
686
+ if v is not None
687
+ }
688
+ response = self._get(url, params=query_params)
689
+ response.raise_for_status()
690
+ return response.json()
691
+
692
+ def get_file_styles(self, file_key) -> Any:
693
+ """
694
+ Retrieves the style definitions for a specified file from the API.
695
+
696
+ Args:
697
+ file_key: The unique identifier of the file whose styles are to be fetched.
698
+
699
+ Returns:
700
+ A JSON-serializable object containing the style information of the requested file.
701
+
702
+ Raises:
703
+ ValueError: If 'file_key' is None.
704
+ requests.HTTPError: If the HTTP request to the API fails or returns an error status.
705
+
706
+ Tags:
707
+ get, file, styles, api, management
708
+ """
709
+ if file_key is None:
710
+ raise ValueError("Missing required parameter 'file_key'")
711
+ url = f"{self.base_url}/v1/files/{file_key}/styles"
712
+ query_params = {}
713
+ response = self._get(url, params=query_params)
714
+ response.raise_for_status()
715
+ return response.json()
716
+
717
+ def get_style(self, key) -> Any:
718
+ """
719
+ Retrieves a style resource identified by the given key from the API.
720
+
721
+ Args:
722
+ key: The unique identifier of the style to retrieve. Must not be None.
723
+
724
+ Returns:
725
+ A dictionary representing the style resource as returned by the API.
726
+
727
+ Raises:
728
+ ValueError: If the 'key' parameter is None.
729
+ requests.HTTPError: If the HTTP request to the API fails (non-success status code).
730
+
731
+ Tags:
732
+ get, style, api, management, important
733
+ """
734
+ if key is None:
735
+ raise ValueError("Missing required parameter 'key'")
736
+ url = f"{self.base_url}/v1/styles/{key}"
737
+ query_params = {}
738
+ response = self._get(url, params=query_params)
739
+ response.raise_for_status()
740
+ return response.json()
741
+
742
+ def post_webhook(
743
+ self, event_type, team_id, endpoint, passcode, status=None, description=None
744
+ ) -> Any:
745
+ """
746
+ Registers a new webhook for a specified event type and team.
747
+
748
+ Args:
749
+ event_type: str. The type of event that will trigger the webhook. Required.
750
+ team_id: str. The unique identifier of the team to associate with the webhook. Required.
751
+ endpoint: str. The URL endpoint where the webhook payloads will be sent. Required.
752
+ passcode: str. A secret passcode used to secure webhook communication. Required.
753
+ status: Optional[str]. The status of the webhook (e.g., 'active', 'inactive'). Defaults to None.
754
+ description: Optional[str]. A description of the webhook's purpose. Defaults to None.
755
+
756
+ Returns:
757
+ dict. The JSON response from the webhook creation API containing details of the registered webhook.
758
+
759
+ Raises:
760
+ ValueError: If any of the required parameters ('event_type', 'team_id', 'endpoint', or 'passcode') are missing.
761
+ HTTPError: If the HTTP request to register the webhook fails (non-2xx status code).
762
+
763
+ Tags:
764
+ post, webhook, registration, api
765
+ """
766
+ if event_type is None:
767
+ raise ValueError("Missing required parameter 'event_type'")
768
+ if team_id is None:
769
+ raise ValueError("Missing required parameter 'team_id'")
770
+ if endpoint is None:
771
+ raise ValueError("Missing required parameter 'endpoint'")
772
+ if passcode is None:
773
+ raise ValueError("Missing required parameter 'passcode'")
774
+ request_body = {
775
+ "event_type": event_type,
776
+ "team_id": team_id,
777
+ "endpoint": endpoint,
778
+ "passcode": passcode,
779
+ "status": status,
780
+ "description": description,
781
+ }
782
+ request_body = {k: v for k, v in request_body.items() if v is not None}
783
+ url = f"{self.base_url}/v2/webhooks"
784
+ query_params = {}
785
+ response = self._post(url, data=request_body, params=query_params)
786
+ response.raise_for_status()
787
+ return response.json()
788
+
789
+ def get_webhook(self, webhook_id) -> Any:
790
+ """
791
+ Retrieves the details of a specific webhook by its unique identifier.
792
+
793
+ Args:
794
+ webhook_id: The unique identifier of the webhook to retrieve. Must not be None.
795
+
796
+ Returns:
797
+ A dictionary containing the webhook details as returned by the API.
798
+
799
+ Raises:
800
+ ValueError: If 'webhook_id' is None.
801
+ requests.HTTPError: If the HTTP request to the API fails (non-2xx response).
802
+
803
+ Tags:
804
+ get, webhook, api, important
805
+ """
806
+ if webhook_id is None:
807
+ raise ValueError("Missing required parameter 'webhook_id'")
808
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
809
+ query_params = {}
810
+ response = self._get(url, params=query_params)
811
+ response.raise_for_status()
812
+ return response.json()
813
+
814
+ def put_webhook(
815
+ self, webhook_id, event_type, endpoint, passcode, status=None, description=None
816
+ ) -> Any:
817
+ """
818
+ Update an existing webhook's configuration with new settings such as event type, endpoint, passcode, status, or description.
819
+
820
+ Args:
821
+ webhook_id: The unique identifier of the webhook to update.
822
+ event_type: The type of event that triggers the webhook.
823
+ endpoint: The destination URL that will receive webhook payloads.
824
+ passcode: The security passcode for webhook authentication.
825
+ status: Optional; the activation status of the webhook (e.g., enabled, disabled).
826
+ description: Optional; a human-readable description of the webhook.
827
+
828
+ Returns:
829
+ A dictionary containing the JSON response from the server after updating the webhook.
830
+
831
+ Raises:
832
+ ValueError: If any of 'webhook_id', 'event_type', 'endpoint', or 'passcode' is None.
833
+ requests.HTTPError: If the server responds with an HTTP error status code.
834
+
835
+ Tags:
836
+ update, webhook, management, api
837
+ """
838
+ if webhook_id is None:
839
+ raise ValueError("Missing required parameter 'webhook_id'")
840
+ if event_type is None:
841
+ raise ValueError("Missing required parameter 'event_type'")
842
+ if endpoint is None:
843
+ raise ValueError("Missing required parameter 'endpoint'")
844
+ if passcode is None:
845
+ raise ValueError("Missing required parameter 'passcode'")
846
+ request_body = {
847
+ "event_type": event_type,
848
+ "endpoint": endpoint,
849
+ "passcode": passcode,
850
+ "status": status,
851
+ "description": description,
852
+ }
853
+ request_body = {k: v for k, v in request_body.items() if v is not None}
854
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
855
+ query_params = {}
856
+ response = self._put(url, data=request_body, params=query_params)
857
+ response.raise_for_status()
858
+ return response.json()
859
+
860
+ def delete_webhook(self, webhook_id) -> Any:
861
+ """
862
+ Deletes a webhook with the specified webhook ID.
863
+
864
+ Args:
865
+ webhook_id: str. The unique identifier of the webhook to delete.
866
+
867
+ Returns:
868
+ dict. The JSON response from the server after successful deletion.
869
+
870
+ Raises:
871
+ ValueError: If 'webhook_id' is None.
872
+ HTTPError: If the HTTP request to delete the webhook fails.
873
+
874
+ Tags:
875
+ delete, webhook, management, api
876
+ """
877
+ if webhook_id is None:
878
+ raise ValueError("Missing required parameter 'webhook_id'")
879
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
880
+ query_params = {}
881
+ response = self._delete(url, params=query_params)
882
+ response.raise_for_status()
883
+ return response.json()
884
+
885
+ def get_team_webhooks(self, team_id) -> Any:
886
+ """
887
+ Retrieves the list of webhooks configured for a given team.
888
+
889
+ Args:
890
+ team_id: The unique identifier of the team whose webhooks are to be fetched.
891
+
892
+ Returns:
893
+ A JSON-decoded object containing the team's webhook configurations.
894
+
895
+ Raises:
896
+ ValueError: If 'team_id' is None.
897
+ requests.HTTPError: If the HTTP request to fetch webhooks fails.
898
+
899
+ Tags:
900
+ get, webhooks, team, api, management
901
+ """
902
+ if team_id is None:
903
+ raise ValueError("Missing required parameter 'team_id'")
904
+ url = f"{self.base_url}/v2/teams/{team_id}/webhooks"
905
+ query_params = {}
906
+ response = self._get(url, params=query_params)
907
+ response.raise_for_status()
908
+ return response.json()
909
+
910
+ def get_webhook_requests(self, webhook_id) -> Any:
911
+ """
912
+ Retrieves the list of requests for a specified webhook.
913
+
914
+ Args:
915
+ webhook_id: The unique identifier of the webhook for which to retrieve requests.
916
+
917
+ Returns:
918
+ A JSON-decoded object containing the list of requests associated with the webhook.
919
+
920
+ Raises:
921
+ ValueError: If 'webhook_id' is None.
922
+ requests.HTTPError: If the HTTP request to the webhook endpoint fails.
923
+
924
+ Tags:
925
+ get, webhook, requests, api
926
+ """
927
+ if webhook_id is None:
928
+ raise ValueError("Missing required parameter 'webhook_id'")
929
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}/requests"
930
+ query_params = {}
931
+ response = self._get(url, params=query_params)
932
+ response.raise_for_status()
933
+ return response.json()
934
+
935
+ def get_activity_logs(
936
+ self, events=None, start_time=None, end_time=None, limit=None, order=None
937
+ ) -> Any:
938
+ """
939
+ Retrieves activity logs from the API with optional filters for events, time range, limit, and order.
940
+
941
+ Args:
942
+ events: Optional; a filter specifying which event types to include in the logs.
943
+ start_time: Optional; the start of the time range (ISO 8601 format) for fetching logs.
944
+ end_time: Optional; the end of the time range (ISO 8601 format) for fetching logs.
945
+ limit: Optional; the maximum number of log records to retrieve.
946
+ order: Optional; the order to sort the logs, such as 'asc' or 'desc'.
947
+
948
+ Returns:
949
+ A JSON-decoded object containing the retrieved activity logs.
950
+
951
+ Raises:
952
+ requests.HTTPError: If the HTTP request to the API fails or returns an error status code.
953
+
954
+ Tags:
955
+ get, list, logs, activity, filter, api
956
+ """
957
+ url = f"{self.base_url}/v1/activity_logs"
958
+ query_params = {
959
+ k: v
960
+ for k, v in [
961
+ ("events", events),
962
+ ("start_time", start_time),
963
+ ("end_time", end_time),
964
+ ("limit", limit),
965
+ ("order", order),
966
+ ]
967
+ if v is not None
968
+ }
969
+ response = self._get(url, params=query_params)
970
+ response.raise_for_status()
971
+ return response.json()
972
+
973
+ def get_payments(
974
+ self,
975
+ plugin_payment_token=None,
976
+ user_id=None,
977
+ community_file_id=None,
978
+ plugin_id=None,
979
+ widget_id=None,
980
+ ) -> Any:
981
+ """
982
+ Retrieves a list of payments based on the provided filter criteria.
983
+
984
+ Args:
985
+ plugin_payment_token: Optional; unique token identifying the plugin payment. Used to filter results to payments associated with this token.
986
+ user_id: Optional; unique user identifier. Limits results to payments related to this user.
987
+ community_file_id: Optional; unique community file identifier. Filters payments associated with this file.
988
+ plugin_id: Optional; unique plugin identifier. Filters payments related to this plugin.
989
+ widget_id: Optional; unique widget identifier. Restricts results to payments linked to this widget.
990
+
991
+ Returns:
992
+ A JSON-compatible object containing the list of payments matching the specified filters.
993
+
994
+ Raises:
995
+ HTTPError: If the HTTP request to the payments endpoint fails (e.g., server error, authentication failure, or invalid request).
996
+
997
+ Tags:
998
+ get, payments, list, filter, api
999
+ """
1000
+ url = f"{self.base_url}/v1/payments"
1001
+ query_params = {
1002
+ k: v
1003
+ for k, v in [
1004
+ ("plugin_payment_token", plugin_payment_token),
1005
+ ("user_id", user_id),
1006
+ ("community_file_id", community_file_id),
1007
+ ("plugin_id", plugin_id),
1008
+ ("widget_id", widget_id),
1009
+ ]
1010
+ if v is not None
1011
+ }
1012
+ response = self._get(url, params=query_params)
1013
+ response.raise_for_status()
1014
+ return response.json()
1015
+
1016
+ def get_local_variables(self, file_key) -> Any:
1017
+ """
1018
+ Retrieves the local variables associated with a specific file identified by file_key.
1019
+
1020
+ Args:
1021
+ file_key: The unique identifier of the file whose local variables are to be retrieved.
1022
+
1023
+ Returns:
1024
+ A JSON-compatible object containing the local variables for the specified file.
1025
+
1026
+ Raises:
1027
+ ValueError: Raised if the file_key parameter is None, indicating a missing required parameter.
1028
+ HTTPError: Raised if the HTTP request to fetch local variables fails due to a non-successful response status.
1029
+
1030
+ Tags:
1031
+ get, variables, file, api
1032
+ """
1033
+ if file_key is None:
1034
+ raise ValueError("Missing required parameter 'file_key'")
1035
+ url = f"{self.base_url}/v1/files/{file_key}/variables/local"
1036
+ query_params = {}
1037
+ response = self._get(url, params=query_params)
1038
+ response.raise_for_status()
1039
+ return response.json()
1040
+
1041
+ def get_published_variables(self, file_key) -> Any:
1042
+ """
1043
+ Retrieves the published variables associated with a specified file key from the server.
1044
+
1045
+ Args:
1046
+ file_key: The unique identifier of the file whose published variables are to be fetched.
1047
+
1048
+ Returns:
1049
+ A JSON-deserialized object containing the published variables for the specified file.
1050
+
1051
+ Raises:
1052
+ ValueError: Raised if 'file_key' is None.
1053
+ requests.HTTPError: Raised if the HTTP request to fetch the published variables fails with a non-success status code.
1054
+
1055
+ Tags:
1056
+ get, variables, file-management, api
1057
+ """
1058
+ if file_key is None:
1059
+ raise ValueError("Missing required parameter 'file_key'")
1060
+ url = f"{self.base_url}/v1/files/{file_key}/variables/published"
1061
+ query_params = {}
1062
+ response = self._get(url, params=query_params)
1063
+ response.raise_for_status()
1064
+ return response.json()
1065
+
1066
+ def post_variables(
1067
+ self,
1068
+ file_key,
1069
+ variableCollections=None,
1070
+ variableModes=None,
1071
+ variables=None,
1072
+ variableModeValues=None,
1073
+ ) -> Any:
1074
+ """
1075
+ Posts or updates variable data for a specified file by sending a POST request to the variables endpoint.
1076
+
1077
+ Args:
1078
+ file_key: The unique identifier of the file for which variables are being set or modified. Must not be None.
1079
+ variableCollections: Optional; a collection or list of variable groups to include in the request body.
1080
+ variableModes: Optional; a set or list describing variable modes to be associated with the file.
1081
+ variables: Optional; a dictionary or list containing individual variable definitions to include.
1082
+ variableModeValues: Optional; a mapping of variable modes to their corresponding values.
1083
+
1084
+ Returns:
1085
+ The JSON-decoded response from the variables API, typically containing the status or result of the operation.
1086
+
1087
+ Raises:
1088
+ ValueError: If 'file_key' is None.
1089
+ requests.HTTPError: If the HTTP request to the server fails or the response indicates an error status.
1090
+
1091
+ Tags:
1092
+ post, variables, management, api
1093
+ """
1094
+ if file_key is None:
1095
+ raise ValueError("Missing required parameter 'file_key'")
1096
+ request_body = {
1097
+ "variableCollections": variableCollections,
1098
+ "variableModes": variableModes,
1099
+ "variables": variables,
1100
+ "variableModeValues": variableModeValues,
1101
+ }
1102
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1103
+ url = f"{self.base_url}/v1/files/{file_key}/variables"
1104
+ query_params = {}
1105
+ response = self._post(url, data=request_body, params=query_params)
1106
+ response.raise_for_status()
1107
+ return response.json()
1108
+
1109
+ def get_dev_resources(self, file_key, node_ids=None) -> Any:
1110
+ """
1111
+ Retrieves development resources for a specific file.
1112
+
1113
+ Args:
1114
+ file_key: String identifier for the file to retrieve development resources from.
1115
+ node_ids: Optional list of node identifiers to filter the development resources by.
1116
+
1117
+ Returns:
1118
+ JSON object containing the development resources for the specified file.
1119
+
1120
+ Raises:
1121
+ ValueError: Raised when the required 'file_key' parameter is None.
1122
+ HTTPError: Raised when the API request fails (via raise_for_status()).
1123
+
1124
+ Tags:
1125
+ retrieve, get, file, resources, development, api
1126
+ """
1127
+ if file_key is None:
1128
+ raise ValueError("Missing required parameter 'file_key'")
1129
+ url = f"{self.base_url}/v1/files/{file_key}/dev_resources"
1130
+ query_params = {k: v for k, v in [("node_ids", node_ids)] if v is not None}
1131
+ response = self._get(url, params=query_params)
1132
+ response.raise_for_status()
1133
+ return response.json()
1134
+
1135
+ def post_dev_resources(self, dev_resources) -> Any:
1136
+ """
1137
+ Submits developer resources to the API and returns the parsed JSON response.
1138
+
1139
+ Args:
1140
+ dev_resources: The developer resources to be submitted to the API. Must not be None.
1141
+
1142
+ Returns:
1143
+ dict: The JSON-decoded response from the API after submitting the developer resources.
1144
+
1145
+ Raises:
1146
+ ValueError: Raised when the required parameter 'dev_resources' is None.
1147
+ requests.HTTPError: Raised if the API request results in an HTTP error status.
1148
+
1149
+ Tags:
1150
+ post, dev-resources, api, http
1151
+ """
1152
+ if dev_resources is None:
1153
+ raise ValueError("Missing required parameter 'dev_resources'")
1154
+ request_body = {
1155
+ "dev_resources": dev_resources,
1156
+ }
1157
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1158
+ url = f"{self.base_url}/v1/dev_resources"
1159
+ query_params = {}
1160
+ response = self._post(url, data=request_body, params=query_params)
1161
+ response.raise_for_status()
1162
+ return response.json()
1163
+
1164
+ def put_dev_resources(self, dev_resources) -> Any:
1165
+ """
1166
+ Updates the development resources by sending a PUT request to the dev_resources endpoint.
1167
+
1168
+ Args:
1169
+ dev_resources: The development resources data to be updated. This must not be None.
1170
+
1171
+ Returns:
1172
+ The parsed JSON response from the server as a dictionary or relevant data structure.
1173
+
1174
+ Raises:
1175
+ ValueError: If the 'dev_resources' parameter is None.
1176
+ requests.HTTPError: If the HTTP request fails or returns a non-success status code.
1177
+
1178
+ Tags:
1179
+ put, dev-resources, update, api
1180
+ """
1181
+ if dev_resources is None:
1182
+ raise ValueError("Missing required parameter 'dev_resources'")
1183
+ request_body = {
1184
+ "dev_resources": dev_resources,
1185
+ }
1186
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1187
+ url = f"{self.base_url}/v1/dev_resources"
1188
+ query_params = {}
1189
+ response = self._put(url, data=request_body, params=query_params)
1190
+ response.raise_for_status()
1191
+ return response.json()
1192
+
1193
+ def delete_dev_resource(self, file_key, dev_resource_id) -> Any:
1194
+ """
1195
+ Deletes a specific development resource associated with a file.
1196
+
1197
+ Args:
1198
+ file_key: The unique identifier for the file containing the development resource.
1199
+ dev_resource_id: The unique identifier of the development resource to delete.
1200
+
1201
+ Returns:
1202
+ The parsed JSON response from the API after successful deletion of the development resource.
1203
+
1204
+ Raises:
1205
+ ValueError: Raised if either 'file_key' or 'dev_resource_id' is None.
1206
+ requests.HTTPError: Raised if the HTTP request to delete the development resource fails.
1207
+
1208
+ Tags:
1209
+ delete, dev-resource, management, api
1210
+ """
1211
+ if file_key is None:
1212
+ raise ValueError("Missing required parameter 'file_key'")
1213
+ if dev_resource_id is None:
1214
+ raise ValueError("Missing required parameter 'dev_resource_id'")
1215
+ url = f"{self.base_url}/v1/files/{file_key}/dev_resources/{dev_resource_id}"
1216
+ query_params = {}
1217
+ response = self._delete(url, params=query_params)
1218
+ response.raise_for_status()
1219
+ return response.json()
1220
+
1221
+ def list_tools(self):
1222
+ return [
1223
+ self.get_file,
1224
+ self.get_file_nodes,
1225
+ self.get_images,
1226
+ self.get_image_fills,
1227
+ self.get_team_projects,
1228
+ self.get_project_files,
1229
+ self.get_file_versions,
1230
+ self.get_comments,
1231
+ self.post_comment,
1232
+ self.delete_comment,
1233
+ self.get_comment_reactions,
1234
+ self.post_comment_reaction,
1235
+ self.delete_comment_reaction,
1236
+ self.get_me,
1237
+ self.get_team_components,
1238
+ self.get_file_components,
1239
+ self.get_component,
1240
+ self.get_team_component_sets,
1241
+ self.get_file_component_sets,
1242
+ self.get_component_set,
1243
+ self.get_team_styles,
1244
+ self.get_file_styles,
1245
+ self.get_style,
1246
+ self.post_webhook,
1247
+ self.get_webhook,
1248
+ self.put_webhook,
1249
+ self.delete_webhook,
1250
+ self.get_team_webhooks,
1251
+ self.get_webhook_requests,
1252
+ self.get_activity_logs,
1253
+ self.get_payments,
1254
+ self.get_local_variables,
1255
+ self.get_published_variables,
1256
+ self.post_variables,
1257
+ self.get_dev_resources,
1258
+ self.post_dev_resources,
1259
+ self.put_dev_resources,
1260
+ self.delete_dev_resource,
1261
+ ]