universal-mcp-applications 0.1.33__py3-none-any.whl → 0.1.39rc8__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.

Potentially problematic release.


This version of universal-mcp-applications might be problematic. Click here for more details.

Files changed (113) hide show
  1. universal_mcp/applications/ahrefs/app.py +92 -238
  2. universal_mcp/applications/airtable/app.py +23 -122
  3. universal_mcp/applications/apollo/app.py +122 -475
  4. universal_mcp/applications/asana/app.py +605 -1755
  5. universal_mcp/applications/aws_s3/app.py +36 -103
  6. universal_mcp/applications/bill/app.py +644 -2055
  7. universal_mcp/applications/box/app.py +1246 -4159
  8. universal_mcp/applications/braze/app.py +410 -1476
  9. universal_mcp/applications/browser_use/README.md +15 -1
  10. universal_mcp/applications/browser_use/__init__.py +1 -0
  11. universal_mcp/applications/browser_use/app.py +86 -24
  12. universal_mcp/applications/cal_com_v2/app.py +207 -625
  13. universal_mcp/applications/calendly/app.py +103 -242
  14. universal_mcp/applications/canva/app.py +75 -140
  15. universal_mcp/applications/clickup/app.py +331 -798
  16. universal_mcp/applications/coda/app.py +240 -520
  17. universal_mcp/applications/confluence/app.py +497 -1285
  18. universal_mcp/applications/contentful/app.py +36 -151
  19. universal_mcp/applications/crustdata/app.py +42 -121
  20. universal_mcp/applications/dialpad/app.py +451 -924
  21. universal_mcp/applications/digitalocean/app.py +2071 -6082
  22. universal_mcp/applications/domain_checker/app.py +3 -54
  23. universal_mcp/applications/e2b/app.py +14 -64
  24. universal_mcp/applications/elevenlabs/app.py +9 -47
  25. universal_mcp/applications/exa/README.md +8 -4
  26. universal_mcp/applications/exa/app.py +408 -186
  27. universal_mcp/applications/falai/app.py +24 -101
  28. universal_mcp/applications/figma/app.py +91 -175
  29. universal_mcp/applications/file_system/app.py +2 -13
  30. universal_mcp/applications/firecrawl/app.py +186 -163
  31. universal_mcp/applications/fireflies/app.py +59 -281
  32. universal_mcp/applications/fpl/app.py +92 -529
  33. universal_mcp/applications/fpl/utils/fixtures.py +15 -49
  34. universal_mcp/applications/fpl/utils/helper.py +25 -89
  35. universal_mcp/applications/fpl/utils/league_utils.py +20 -64
  36. universal_mcp/applications/ghost_content/app.py +66 -175
  37. universal_mcp/applications/github/app.py +28 -65
  38. universal_mcp/applications/gong/app.py +140 -300
  39. universal_mcp/applications/google_calendar/app.py +26 -78
  40. universal_mcp/applications/google_docs/app.py +98 -202
  41. universal_mcp/applications/google_drive/app.py +194 -793
  42. universal_mcp/applications/google_gemini/app.py +27 -62
  43. universal_mcp/applications/google_mail/README.md +1 -0
  44. universal_mcp/applications/google_mail/app.py +93 -214
  45. universal_mcp/applications/google_searchconsole/app.py +25 -58
  46. universal_mcp/applications/google_sheet/app.py +171 -624
  47. universal_mcp/applications/google_sheet/helper.py +26 -53
  48. universal_mcp/applications/hashnode/app.py +57 -269
  49. universal_mcp/applications/heygen/app.py +77 -155
  50. universal_mcp/applications/http_tools/app.py +10 -32
  51. universal_mcp/applications/hubspot/README.md +1 -1
  52. universal_mcp/applications/hubspot/app.py +7508 -99
  53. universal_mcp/applications/jira/app.py +2419 -8334
  54. universal_mcp/applications/klaviyo/app.py +737 -1619
  55. universal_mcp/applications/linkedin/README.md +5 -0
  56. universal_mcp/applications/linkedin/app.py +332 -227
  57. universal_mcp/applications/mailchimp/app.py +696 -1851
  58. universal_mcp/applications/markitdown/app.py +8 -20
  59. universal_mcp/applications/miro/app.py +333 -815
  60. universal_mcp/applications/ms_teams/app.py +85 -207
  61. universal_mcp/applications/neon/app.py +144 -250
  62. universal_mcp/applications/notion/app.py +36 -51
  63. universal_mcp/applications/onedrive/app.py +26 -48
  64. universal_mcp/applications/openai/app.py +42 -165
  65. universal_mcp/applications/outlook/README.md +22 -9
  66. universal_mcp/applications/outlook/app.py +403 -141
  67. universal_mcp/applications/perplexity/README.md +2 -1
  68. universal_mcp/applications/perplexity/app.py +162 -20
  69. universal_mcp/applications/pipedrive/app.py +1021 -3331
  70. universal_mcp/applications/posthog/app.py +272 -541
  71. universal_mcp/applications/reddit/app.py +61 -160
  72. universal_mcp/applications/resend/app.py +41 -107
  73. universal_mcp/applications/retell/app.py +23 -50
  74. universal_mcp/applications/rocketlane/app.py +250 -963
  75. universal_mcp/applications/scraper/app.py +67 -125
  76. universal_mcp/applications/semanticscholar/app.py +36 -78
  77. universal_mcp/applications/semrush/app.py +43 -77
  78. universal_mcp/applications/sendgrid/app.py +826 -1576
  79. universal_mcp/applications/sentry/app.py +444 -1079
  80. universal_mcp/applications/serpapi/app.py +40 -143
  81. universal_mcp/applications/sharepoint/app.py +27 -49
  82. universal_mcp/applications/shopify/app.py +1743 -4479
  83. universal_mcp/applications/shortcut/app.py +272 -534
  84. universal_mcp/applications/slack/app.py +41 -123
  85. universal_mcp/applications/spotify/app.py +206 -405
  86. universal_mcp/applications/supabase/app.py +174 -283
  87. universal_mcp/applications/tavily/app.py +2 -2
  88. universal_mcp/applications/trello/app.py +853 -2816
  89. universal_mcp/applications/twilio/app.py +14 -50
  90. universal_mcp/applications/twitter/api_segments/compliance_api.py +4 -14
  91. universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +6 -18
  92. universal_mcp/applications/twitter/api_segments/likes_api.py +1 -3
  93. universal_mcp/applications/twitter/api_segments/lists_api.py +5 -15
  94. universal_mcp/applications/twitter/api_segments/trends_api.py +1 -3
  95. universal_mcp/applications/twitter/api_segments/tweets_api.py +9 -31
  96. universal_mcp/applications/twitter/api_segments/usage_api.py +1 -5
  97. universal_mcp/applications/twitter/api_segments/users_api.py +14 -42
  98. universal_mcp/applications/whatsapp/app.py +35 -186
  99. universal_mcp/applications/whatsapp/audio.py +2 -6
  100. universal_mcp/applications/whatsapp/whatsapp.py +17 -51
  101. universal_mcp/applications/whatsapp_business/app.py +86 -299
  102. universal_mcp/applications/wrike/app.py +80 -153
  103. universal_mcp/applications/yahoo_finance/app.py +19 -65
  104. universal_mcp/applications/youtube/app.py +120 -306
  105. universal_mcp/applications/zenquotes/app.py +3 -3
  106. {universal_mcp_applications-0.1.33.dist-info → universal_mcp_applications-0.1.39rc8.dist-info}/METADATA +4 -2
  107. {universal_mcp_applications-0.1.33.dist-info → universal_mcp_applications-0.1.39rc8.dist-info}/RECORD +109 -113
  108. {universal_mcp_applications-0.1.33.dist-info → universal_mcp_applications-0.1.39rc8.dist-info}/WHEEL +1 -1
  109. universal_mcp/applications/hubspot/api_segments/__init__.py +0 -0
  110. universal_mcp/applications/hubspot/api_segments/api_segment_base.py +0 -54
  111. universal_mcp/applications/hubspot/api_segments/crm_api.py +0 -7337
  112. universal_mcp/applications/hubspot/api_segments/marketing_api.py +0 -1467
  113. {universal_mcp_applications-0.1.33.dist-info → universal_mcp_applications-0.1.39rc8.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,4 @@
1
1
  from typing import Any
2
-
3
2
  from universal_mcp.applications.application import APIApplication
4
3
  from universal_mcp.integrations import Integration
5
4
 
@@ -11,20 +10,10 @@ class HeygenApp(APIApplication):
11
10
 
12
11
  def _get_headers(self) -> dict[str, Any]:
13
12
  credentials = self.integration.get_credentials()
14
- api_key = (
15
- credentials.get("api_key")
16
- or credentials.get("API_KEY")
17
- or credentials.get("apiKey")
18
- )
19
- return {
20
- "x-api-key": f"{api_key}",
21
- "Content-Type": "application/json",
22
- "Accept": "application/json",
23
- }
13
+ api_key = credentials.get("api_key") or credentials.get("API_KEY") or credentials.get("apiKey")
14
+ return {"x-api-key": f"{api_key}", "Content-Type": "application/json", "Accept": "application/json"}
24
15
 
25
- def get_v1_voice_list(
26
- self,
27
- ) -> Any:
16
+ async def get_v1_voice_list(self) -> Any:
28
17
  """
29
18
  Retrieves the list of available voices from the v1 voice API endpoint.
30
19
 
@@ -42,13 +31,11 @@ class HeygenApp(APIApplication):
42
31
  """
43
32
  url = f"{self.base_url}/v1/voice.list"
44
33
  query_params = {}
45
- response = self._get(url, params=query_params)
34
+ response = await self._aget(url, params=query_params)
46
35
  response.raise_for_status()
47
36
  return response.json()
48
37
 
49
- def get_v1_avatar_list(
50
- self,
51
- ) -> Any:
38
+ async def get_v1_avatar_list(self) -> Any:
52
39
  """
53
40
  Retrieves a list of available avatars from the v1 API endpoint.
54
41
 
@@ -66,13 +53,11 @@ class HeygenApp(APIApplication):
66
53
  """
67
54
  url = f"{self.base_url}/v1/avatar.list"
68
55
  query_params = {}
69
- response = self._get(url, params=query_params)
56
+ response = await self._aget(url, params=query_params)
70
57
  response.raise_for_status()
71
58
  return response.json()
72
59
 
73
- def get_v2_voices(
74
- self,
75
- ) -> Any:
60
+ async def get_v2_voices(self) -> Any:
76
61
  """
77
62
  Retrieves the list of available v2 voices from the API endpoint.
78
63
 
@@ -90,13 +75,11 @@ class HeygenApp(APIApplication):
90
75
  """
91
76
  url = f"{self.base_url}/v2/voices"
92
77
  query_params = {}
93
- response = self._get(url, params=query_params)
78
+ response = await self._aget(url, params=query_params)
94
79
  response.raise_for_status()
95
80
  return response.json()
96
81
 
97
- def get_v2_avatars(
98
- self,
99
- ) -> Any:
82
+ async def get_v2_avatars(self) -> Any:
100
83
  """
101
84
  Retrieves a list of avatar objects from the /v2/avatars API endpoint.
102
85
 
@@ -114,13 +97,11 @@ class HeygenApp(APIApplication):
114
97
  """
115
98
  url = f"{self.base_url}/v2/avatars"
116
99
  query_params = {}
117
- response = self._get(url, params=query_params)
100
+ response = await self._aget(url, params=query_params)
118
101
  response.raise_for_status()
119
102
  return response.json()
120
103
 
121
- def get_v1_video_list(
122
- self,
123
- ) -> Any:
104
+ async def get_v1_video_list(self) -> Any:
124
105
  """
125
106
  Retrieves a list of videos from the v1 API endpoint.
126
107
 
@@ -138,19 +119,11 @@ class HeygenApp(APIApplication):
138
119
  """
139
120
  url = f"{self.base_url}/v1/video.list"
140
121
  query_params = {}
141
- response = self._get(url, params=query_params)
122
+ response = await self._aget(url, params=query_params)
142
123
  response.raise_for_status()
143
124
  return response.json()
144
125
 
145
- def post_v2_video_generate(
146
- self,
147
- video_inputs,
148
- title=None,
149
- test=None,
150
- callback_id=None,
151
- dimension=None,
152
- aspect_ratio=None,
153
- ) -> Any:
126
+ async def post_v2_video_generate(self, video_inputs, title=None, test=None, callback_id=None, dimension=None, aspect_ratio=None) -> Any:
154
127
  """
155
128
  Submits a request to generate a video using specified input parameters via the v2 video generate API endpoint.
156
129
 
@@ -185,11 +158,11 @@ class HeygenApp(APIApplication):
185
158
  request_body = {k: v for k, v in request_body.items() if v is not None}
186
159
  url = f"{self.base_url}/v2/video/generate"
187
160
  query_params = {}
188
- response = self._post(url, data=request_body, params=query_params)
161
+ response = await self._apost(url, data=request_body, params=query_params)
189
162
  response.raise_for_status()
190
163
  return response.json()
191
164
 
192
- def delete_v1_video(self, video_id=None) -> Any:
165
+ async def delete_v1_video(self, video_id=None) -> Any:
193
166
  """
194
167
  Deletes a video using the v1 API endpoint with the specified video ID.
195
168
 
@@ -207,13 +180,11 @@ class HeygenApp(APIApplication):
207
180
  """
208
181
  url = f"{self.base_url}/v1/video.delete"
209
182
  query_params = {k: v for k, v in [("video_id", video_id)] if v is not None}
210
- response = self._delete(url, params=query_params)
183
+ response = await self._adelete(url, params=query_params)
211
184
  response.raise_for_status()
212
185
  return response.json()
213
186
 
214
- def get_v2_templates(
215
- self,
216
- ) -> Any:
187
+ async def get_v2_templates(self) -> Any:
217
188
  """
218
189
  Retrieves the list of v2 templates from the API endpoint.
219
190
 
@@ -231,11 +202,11 @@ class HeygenApp(APIApplication):
231
202
  """
232
203
  url = f"{self.base_url}/v2/templates"
233
204
  query_params = {}
234
- response = self._get(url, params=query_params)
205
+ response = await self._aget(url, params=query_params)
235
206
  response.raise_for_status()
236
207
  return response.json()
237
208
 
238
- def get_v2_template_by_id(self, id) -> Any:
209
+ async def get_v2_template_by_id(self, id) -> Any:
239
210
  """
240
211
  Retrieves a v2 template resource by its unique identifier.
241
212
 
@@ -256,13 +227,11 @@ class HeygenApp(APIApplication):
256
227
  raise ValueError("Missing required parameter 'id'")
257
228
  url = f"{self.base_url}/v2/template/{id}"
258
229
  query_params = {}
259
- response = self._get(url, params=query_params)
230
+ response = await self._aget(url, params=query_params)
260
231
  response.raise_for_status()
261
232
  return response.json()
262
233
 
263
- def post_v2_template_generate_by_id(
264
- self, id, title, variables, test=None, caption=None, dimension=None
265
- ) -> Any:
234
+ async def post_v2_template_generate_by_id(self, id, title, variables, test=None, caption=None, dimension=None) -> Any:
266
235
  """
267
236
  Generates content from a template specified by ID using the provided title and variables, and returns the generation result.
268
237
 
@@ -290,23 +259,15 @@ class HeygenApp(APIApplication):
290
259
  raise ValueError("Missing required parameter 'title'")
291
260
  if variables is None:
292
261
  raise ValueError("Missing required parameter 'variables'")
293
- request_body = {
294
- "title": title,
295
- "variables": variables,
296
- "test": test,
297
- "caption": caption,
298
- "dimension": dimension,
299
- }
262
+ request_body = {"title": title, "variables": variables, "test": test, "caption": caption, "dimension": dimension}
300
263
  request_body = {k: v for k, v in request_body.items() if v is not None}
301
264
  url = f"{self.base_url}/v2/template/{id}/generate"
302
265
  query_params = {}
303
- response = self._post(url, data=request_body, params=query_params)
266
+ response = await self._apost(url, data=request_body, params=query_params)
304
267
  response.raise_for_status()
305
268
  return response.json()
306
269
 
307
- def get_v2_video_translate_target_languages(
308
- self,
309
- ) -> Any:
270
+ async def get_v2_video_translate_target_languages(self) -> Any:
310
271
  """
311
272
  Retrieves the list of supported target languages for video translation via the v2 API.
312
273
 
@@ -324,18 +285,11 @@ class HeygenApp(APIApplication):
324
285
  """
325
286
  url = f"{self.base_url}/v2/video_translate/target_languages"
326
287
  query_params = {}
327
- response = self._get(url, params=query_params)
288
+ response = await self._aget(url, params=query_params)
328
289
  response.raise_for_status()
329
290
  return response.json()
330
291
 
331
- def post_v2_video_translate(
332
- self,
333
- video_url,
334
- output_language,
335
- title=None,
336
- translate_audio_only=None,
337
- speaker_num=None,
338
- ) -> Any:
292
+ async def post_v2_video_translate(self, video_url, output_language, title=None, translate_audio_only=None, speaker_num=None) -> Any:
339
293
  """
340
294
  Submits a video translation request and returns the API response as JSON.
341
295
 
@@ -370,11 +324,11 @@ class HeygenApp(APIApplication):
370
324
  request_body = {k: v for k, v in request_body.items() if v is not None}
371
325
  url = f"{self.base_url}/v2/video_translate"
372
326
  query_params = {}
373
- response = self._post(url, data=request_body, params=query_params)
327
+ response = await self._apost(url, data=request_body, params=query_params)
374
328
  response.raise_for_status()
375
329
  return response.json()
376
330
 
377
- def get_v2_video_translate_status_by_id(self, id) -> Any:
331
+ async def get_v2_video_translate_status_by_id(self, id) -> Any:
378
332
  """
379
333
  Retrieves the status of a video translation job by its unique identifier.
380
334
 
@@ -395,11 +349,11 @@ class HeygenApp(APIApplication):
395
349
  raise ValueError("Missing required parameter 'id'")
396
350
  url = f"{self.base_url}/v2/video_translate/{id}"
397
351
  query_params = {}
398
- response = self._get(url, params=query_params)
352
+ response = await self._aget(url, params=query_params)
399
353
  response.raise_for_status()
400
354
  return response.json()
401
355
 
402
- def post_streaming_new(self, quality=None) -> Any:
356
+ async def post_streaming_new(self, quality=None) -> Any:
403
357
  """
404
358
  Initiates a new streaming session with optional quality parameter and returns the server's JSON response.
405
359
 
@@ -415,19 +369,15 @@ class HeygenApp(APIApplication):
415
369
  Tags:
416
370
  post, streaming, async-job, start, api
417
371
  """
418
- request_body = {
419
- "quality": quality,
420
- }
372
+ request_body = {"quality": quality}
421
373
  request_body = {k: v for k, v in request_body.items() if v is not None}
422
374
  url = f"{self.base_url}/v1/streaming.new"
423
375
  query_params = {}
424
- response = self._post(url, data=request_body, params=query_params)
376
+ response = await self._apost(url, data=request_body, params=query_params)
425
377
  response.raise_for_status()
426
378
  return response.json()
427
379
 
428
- def get_streaming_list(
429
- self,
430
- ) -> Any:
380
+ async def get_streaming_list(self) -> Any:
431
381
  """
432
382
  Retrieves the list of available streaming resources from the remote API.
433
383
 
@@ -445,11 +395,11 @@ class HeygenApp(APIApplication):
445
395
  """
446
396
  url = f"{self.base_url}/v1/streaming.list"
447
397
  query_params = {}
448
- response = self._get(url, params=query_params)
398
+ response = await self._aget(url, params=query_params)
449
399
  response.raise_for_status()
450
400
  return response.json()
451
401
 
452
- def post_streaming_ice(self, session_id, candidate) -> Any:
402
+ async def post_streaming_ice(self, session_id, candidate) -> Any:
453
403
  """
454
404
  Sends an ICE candidate for a streaming session to the server and returns the JSON response.
455
405
 
@@ -471,18 +421,15 @@ class HeygenApp(APIApplication):
471
421
  raise ValueError("Missing required parameter 'session_id'")
472
422
  if candidate is None:
473
423
  raise ValueError("Missing required parameter 'candidate'")
474
- request_body = {
475
- "session_id": session_id,
476
- "candidate": candidate,
477
- }
424
+ request_body = {"session_id": session_id, "candidate": candidate}
478
425
  request_body = {k: v for k, v in request_body.items() if v is not None}
479
426
  url = f"{self.base_url}/v1/streaming.ice"
480
427
  query_params = {}
481
- response = self._post(url, data=request_body, params=query_params)
428
+ response = await self._apost(url, data=request_body, params=query_params)
482
429
  response.raise_for_status()
483
430
  return response.json()
484
431
 
485
- def post_streaming_task(self, session_id, text) -> Any:
432
+ async def post_streaming_task(self, session_id, text) -> Any:
486
433
  """
487
434
  Submits a streaming task for the specified session and text input, returning the response from the remote API.
488
435
 
@@ -504,18 +451,15 @@ class HeygenApp(APIApplication):
504
451
  raise ValueError("Missing required parameter 'session_id'")
505
452
  if text is None:
506
453
  raise ValueError("Missing required parameter 'text'")
507
- request_body = {
508
- "session_id": session_id,
509
- "text": text,
510
- }
454
+ request_body = {"session_id": session_id, "text": text}
511
455
  request_body = {k: v for k, v in request_body.items() if v is not None}
512
456
  url = f"{self.base_url}/v1/streaming.task"
513
457
  query_params = {}
514
- response = self._post(url, data=request_body, params=query_params)
458
+ response = await self._apost(url, data=request_body, params=query_params)
515
459
  response.raise_for_status()
516
460
  return response.json()
517
461
 
518
- def post_streaming_stop(self, session_id) -> Any:
462
+ async def post_streaming_stop(self, session_id) -> Any:
519
463
  """
520
464
  Stops an ongoing streaming session by sending a stop request for the specified session ID.
521
465
 
@@ -534,17 +478,15 @@ class HeygenApp(APIApplication):
534
478
  """
535
479
  if session_id is None:
536
480
  raise ValueError("Missing required parameter 'session_id'")
537
- request_body = {
538
- "session_id": session_id,
539
- }
481
+ request_body = {"session_id": session_id}
540
482
  request_body = {k: v for k, v in request_body.items() if v is not None}
541
483
  url = f"{self.base_url}/v1/streaming.stop"
542
484
  query_params = {}
543
- response = self._post(url, data=request_body, params=query_params)
485
+ response = await self._apost(url, data=request_body, params=query_params)
544
486
  response.raise_for_status()
545
487
  return response.json()
546
488
 
547
- def post_streaming_interrupt(self, session_id) -> Any:
489
+ async def post_streaming_interrupt(self, session_id) -> Any:
548
490
  """
549
491
  Sends a request to interrupt an active streaming session identified by the given session ID.
550
492
 
@@ -563,17 +505,15 @@ class HeygenApp(APIApplication):
563
505
  """
564
506
  if session_id is None:
565
507
  raise ValueError("Missing required parameter 'session_id'")
566
- request_body = {
567
- "session_id": session_id,
568
- }
508
+ request_body = {"session_id": session_id}
569
509
  request_body = {k: v for k, v in request_body.items() if v is not None}
570
510
  url = f"{self.base_url}/v1/streaming.interrupt"
571
511
  query_params = {}
572
- response = self._post(url, data=request_body, params=query_params)
512
+ response = await self._apost(url, data=request_body, params=query_params)
573
513
  response.raise_for_status()
574
514
  return response.json()
575
515
 
576
- def post_streaming_create_token(self, expiry=None) -> Any:
516
+ async def post_streaming_create_token(self, expiry=None) -> Any:
577
517
  """
578
518
  Creates a new streaming token with an optional expiry time by sending a POST request to the streaming token API endpoint.
579
519
 
@@ -589,19 +529,15 @@ class HeygenApp(APIApplication):
589
529
  Tags:
590
530
  create, streaming, token, api
591
531
  """
592
- request_body = {
593
- "expiry": expiry,
594
- }
532
+ request_body = {"expiry": expiry}
595
533
  request_body = {k: v for k, v in request_body.items() if v is not None}
596
534
  url = f"{self.base_url}/v1/streaming.create_token"
597
535
  query_params = {}
598
- response = self._post(url, data=request_body, params=query_params)
536
+ response = await self._apost(url, data=request_body, params=query_params)
599
537
  response.raise_for_status()
600
538
  return response.json()
601
539
 
602
- def get_streaming_avatar_list(
603
- self,
604
- ) -> Any:
540
+ async def get_streaming_avatar_list(self) -> Any:
605
541
  """
606
542
  Retrieves a list of available streaming avatars from the API endpoint.
607
543
 
@@ -619,13 +555,11 @@ class HeygenApp(APIApplication):
619
555
  """
620
556
  url = f"{self.base_url}/v1/streaming/avatar.list"
621
557
  query_params = {}
622
- response = self._get(url, params=query_params)
558
+ response = await self._aget(url, params=query_params)
623
559
  response.raise_for_status()
624
560
  return response.json()
625
561
 
626
- def get_v1_webhook_list(
627
- self,
628
- ) -> Any:
562
+ async def get_v1_webhook_list(self) -> Any:
629
563
  """
630
564
  Retrieves a list of all registered webhooks via the v1 API endpoint.
631
565
 
@@ -643,11 +577,11 @@ class HeygenApp(APIApplication):
643
577
  """
644
578
  url = f"{self.base_url}/v1/webhook/webhook.list"
645
579
  query_params = {}
646
- response = self._get(url, params=query_params)
580
+ response = await self._aget(url, params=query_params)
647
581
  response.raise_for_status()
648
582
  return response.json()
649
583
 
650
- def post_v1_webhook_endpoint_add(self, url, events) -> Any:
584
+ async def post_v1_webhook_endpoint_add(self, url, events) -> Any:
651
585
  """
652
586
  Registers a new webhook endpoint with the specified URL and events.
653
587
 
@@ -669,18 +603,15 @@ class HeygenApp(APIApplication):
669
603
  raise ValueError("Missing required parameter 'url'")
670
604
  if events is None:
671
605
  raise ValueError("Missing required parameter 'events'")
672
- request_body = {
673
- "url": url,
674
- "events": events,
675
- }
606
+ request_body = {"url": url, "events": events}
676
607
  request_body = {k: v for k, v in request_body.items() if v is not None}
677
608
  url = f"{self.base_url}/v1/webhook/endpoint.add"
678
609
  query_params = {}
679
- response = self._post(url, data=request_body, params=query_params)
610
+ response = await self._apost(url, data=request_body, params=query_params)
680
611
  response.raise_for_status()
681
612
  return response.json()
682
613
 
683
- def delete_v1_webhook_endpoint_by_id(self, endpoint_id) -> Any:
614
+ async def delete_v1_webhook_endpoint_by_id(self, endpoint_id) -> Any:
684
615
  """
685
616
  Deletes a webhook endpoint identified by its ID via a DELETE request to the v1 API.
686
617
 
@@ -701,13 +632,11 @@ class HeygenApp(APIApplication):
701
632
  raise ValueError("Missing required parameter 'endpoint_id'")
702
633
  url = f"{self.base_url}/v1/webhook/endpoint.delete/{endpoint_id}"
703
634
  query_params = {}
704
- response = self._delete(url, params=query_params)
635
+ response = await self._adelete(url, params=query_params)
705
636
  response.raise_for_status()
706
637
  return response.json()
707
638
 
708
- def get_v1_webhook_endpoint_list(
709
- self,
710
- ) -> Any:
639
+ async def get_v1_webhook_endpoint_list(self) -> Any:
711
640
  """
712
641
  Retrieves a list of webhook endpoints from the v1 API.
713
642
 
@@ -725,13 +654,11 @@ class HeygenApp(APIApplication):
725
654
  """
726
655
  url = f"{self.base_url}/v1/webhook/endpoint.list"
727
656
  query_params = {}
728
- response = self._get(url, params=query_params)
657
+ response = await self._aget(url, params=query_params)
729
658
  response.raise_for_status()
730
659
  return response.json()
731
660
 
732
- def get_v1_talking_photo_list(
733
- self,
734
- ) -> Any:
661
+ async def get_v1_talking_photo_list(self) -> Any:
735
662
  """
736
663
  Retrieves the list of talking photos from the v1 API endpoint.
737
664
 
@@ -749,11 +676,11 @@ class HeygenApp(APIApplication):
749
676
  """
750
677
  url = f"{self.base_url}/v1/talking_photo.list"
751
678
  query_params = {}
752
- response = self._get(url, params=query_params)
679
+ response = await self._aget(url, params=query_params)
753
680
  response.raise_for_status()
754
681
  return response.json()
755
682
 
756
- def delete_v2_talking_photo_by_id(self, id) -> Any:
683
+ async def delete_v2_talking_photo_by_id(self, id) -> Any:
757
684
  """
758
685
  Deletes a v2 talking photo resource identified by its unique ID.
759
686
 
@@ -774,11 +701,11 @@ class HeygenApp(APIApplication):
774
701
  raise ValueError("Missing required parameter 'id'")
775
702
  url = f"{self.base_url}/v2/talking_photo/{id}"
776
703
  query_params = {}
777
- response = self._delete(url, params=query_params)
704
+ response = await self._adelete(url, params=query_params)
778
705
  response.raise_for_status()
779
706
  return response.json()
780
707
 
781
- def post_personalized_video_add_contact(self, project_id, variables_list) -> Any:
708
+ async def post_personalized_video_add_contact(self, project_id, variables_list) -> Any:
782
709
  """
783
710
  Adds a new contact to a personalized video project by sending the contact variables to the server.
784
711
 
@@ -800,18 +727,15 @@ class HeygenApp(APIApplication):
800
727
  raise ValueError("Missing required parameter 'project_id'")
801
728
  if variables_list is None:
802
729
  raise ValueError("Missing required parameter 'variables_list'")
803
- request_body = {
804
- "project_id": project_id,
805
- "variables_list": variables_list,
806
- }
730
+ request_body = {"project_id": project_id, "variables_list": variables_list}
807
731
  request_body = {k: v for k, v in request_body.items() if v is not None}
808
732
  url = f"{self.base_url}/v1/personalized_video/add_contact"
809
733
  query_params = {}
810
- response = self._post(url, data=request_body, params=query_params)
734
+ response = await self._apost(url, data=request_body, params=query_params)
811
735
  response.raise_for_status()
812
736
  return response.json()
813
737
 
814
- def get_personalized_video_audience_detail(self, id=None) -> Any:
738
+ async def get_personalized_video_audience_detail(self, id=None) -> Any:
815
739
  """
816
740
  Retrieves detailed information about a personalized video audience by ID.
817
741
 
@@ -829,11 +753,11 @@ class HeygenApp(APIApplication):
829
753
  """
830
754
  url = f"{self.base_url}/v1/personalized_video/audience/detail"
831
755
  query_params = {k: v for k, v in [("id", id)] if v is not None}
832
- response = self._get(url, params=query_params)
756
+ response = await self._aget(url, params=query_params)
833
757
  response.raise_for_status()
834
758
  return response.json()
835
759
 
836
- def get_personalized_video_project_detail(self, id=None) -> Any:
760
+ async def get_personalized_video_project_detail(self, id=None) -> Any:
837
761
  """
838
762
  Retrieves the details of a personalized video project by its unique identifier.
839
763
 
@@ -851,13 +775,11 @@ class HeygenApp(APIApplication):
851
775
  """
852
776
  url = f"{self.base_url}/v1/personalized_video/project/detail"
853
777
  query_params = {k: v for k, v in [("id", id)] if v is not None}
854
- response = self._get(url, params=query_params)
778
+ response = await self._aget(url, params=query_params)
855
779
  response.raise_for_status()
856
780
  return response.json()
857
781
 
858
- def get_v2_user_remaining_quota(
859
- self,
860
- ) -> Any:
782
+ async def get_v2_user_remaining_quota(self) -> Any:
861
783
  """
862
784
  Retrieves the current remaining quota information for the user from the v2 API endpoint.
863
785
 
@@ -875,11 +797,11 @@ class HeygenApp(APIApplication):
875
797
  """
876
798
  url = f"{self.base_url}/v2/user/remaining_quota"
877
799
  query_params = {}
878
- response = self._get(url, params=query_params)
800
+ response = await self._aget(url, params=query_params)
879
801
  response.raise_for_status()
880
802
  return response.json()
881
803
 
882
- def post_v1_asset_upload(self, request_body=None) -> Any:
804
+ async def post_v1_asset_upload(self, request_body=None) -> Any:
883
805
  """
884
806
  Uploads an asset to the server using a POST request to the '/v1/asset' endpoint.
885
807
 
@@ -897,11 +819,11 @@ class HeygenApp(APIApplication):
897
819
  """
898
820
  url = f"{self.base_url}/v1/asset"
899
821
  query_params = {}
900
- response = self._post(url, data=request_body, params=query_params)
822
+ response = await self._apost(url, data=request_body, params=query_params)
901
823
  response.raise_for_status()
902
824
  return response.json()
903
825
 
904
- def get_v1_video_status(self, video_id=None) -> Any:
826
+ async def get_v1_video_status(self, video_id=None) -> Any:
905
827
  """
906
828
  Retrieves the status of a video by making a GET request to the v1 video_status endpoint.
907
829
 
@@ -919,7 +841,7 @@ class HeygenApp(APIApplication):
919
841
  """
920
842
  url = f"{self.base_url}/v1/video_status.get"
921
843
  query_params = {k: v for k, v in [("video_id", video_id)] if v is not None}
922
- response = self._get(url, params=query_params)
844
+ response = await self._aget(url, params=query_params)
923
845
  response.raise_for_status()
924
846
  return response.json()
925
847
 
@@ -24,18 +24,10 @@ class HttpToolsApp(APIApplication):
24
24
  try:
25
25
  return response.json()
26
26
  except Exception:
27
- logger.warning(
28
- f"Response is not JSON, returning text. Content-Type: {response.headers.get('content-type')}"
29
- )
30
- return {
31
- "text": response.text,
32
- "status_code": response.status_code,
33
- "headers": dict(response.headers),
34
- }
35
-
36
- def http_get(
37
- self, url: str, headers: dict | None = None, query_params: dict | None = None
38
- ):
27
+ logger.warning(f"Response is not JSON, returning text. Content-Type: {response.headers.get('content-type')}")
28
+ return {"text": response.text, "status_code": response.status_code, "headers": dict(response.headers)}
29
+
30
+ async def http_get(self, url: str, headers: dict | None = None, query_params: dict | None = None):
39
31
  """
40
32
  Executes an HTTP GET request to a given URL with optional headers and query parameters. It handles HTTP errors by raising an exception and processes the response, returning parsed JSON or a dictionary with the raw text and status details if JSON is unavailable.
41
33
 
@@ -49,16 +41,12 @@ class HttpToolsApp(APIApplication):
49
41
  Tags:
50
42
  get, important
51
43
  """
52
- logger.debug(
53
- f"GET request to {url} with headers {headers} and query params {query_params}"
54
- )
44
+ logger.debug(f"GET request to {url} with headers {headers} and query params {query_params}")
55
45
  response = httpx.get(url, params=query_params, headers=headers)
56
46
  response.raise_for_status()
57
47
  return self._handle_response(response)
58
48
 
59
- def http_post(
60
- self, url: str, headers: dict | None = None, body: dict | None = None
61
- ):
49
+ async def http_post(self, url: str, headers: dict | None = None, body: dict | None = None):
62
50
  """
63
51
  Sends an HTTP POST request to a URL with an optional JSON body and headers. It returns the parsed JSON response or raw text if parsing fails and raises an exception for HTTP errors. It is used for creating new resources, unlike http_get which retrieves data.
64
52
 
@@ -77,7 +65,7 @@ class HttpToolsApp(APIApplication):
77
65
  response.raise_for_status()
78
66
  return self._handle_response(response)
79
67
 
80
- def http_put(self, url: str, headers: dict | None = None, body: dict | None = None):
68
+ async def http_put(self, url: str, headers: dict | None = None, body: dict | None = None):
81
69
  """
82
70
  Performs an HTTP PUT request to update or replace a resource at a specified URL. It accepts an optional JSON body and headers, raises an exception for error responses, and returns the parsed JSON response or a dictionary with the raw text and status details.
83
71
 
@@ -96,9 +84,7 @@ class HttpToolsApp(APIApplication):
96
84
  response.raise_for_status()
97
85
  return self._handle_response(response)
98
86
 
99
- def http_delete(
100
- self, url: str, headers: dict | None = None, body: dict | None = None
101
- ):
87
+ async def http_delete(self, url: str, headers: dict | None = None, body: dict | None = None):
102
88
  """
103
89
  Sends an HTTP DELETE request to a URL with optional headers and a JSON body. Raises an exception for HTTP error statuses and returns the parsed JSON response. If the response isn't JSON, it returns the text content, status code, and headers.
104
90
 
@@ -117,9 +103,7 @@ class HttpToolsApp(APIApplication):
117
103
  response.raise_for_status()
118
104
  return self._handle_response(response)
119
105
 
120
- def http_patch(
121
- self, url: str, headers: dict | None = None, body: dict | None = None
122
- ):
106
+ async def http_patch(self, url: str, headers: dict | None = None, body: dict | None = None):
123
107
  """
124
108
  Sends an HTTP PATCH request to apply partial modifications to a resource at a given URL. It accepts optional headers and a JSON body. It returns the parsed JSON response, or the raw text with status details if the response is not valid JSON.
125
109
 
@@ -144,10 +128,4 @@ class HttpToolsApp(APIApplication):
144
128
  Tags:
145
129
  list, important
146
130
  """
147
- return [
148
- self.http_get,
149
- self.http_post,
150
- self.http_put,
151
- self.http_delete,
152
- self.http_patch,
153
- ]
131
+ return [self.http_get, self.http_post, self.http_put, self.http_delete, self.http_patch]