universal-mcp-applications 0.1.30__py3-none-any.whl → 0.1.36rc1__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 (105) hide show
  1. universal_mcp/applications/ahrefs/app.py +52 -198
  2. universal_mcp/applications/airtable/app.py +23 -122
  3. universal_mcp/applications/apollo/app.py +111 -464
  4. universal_mcp/applications/asana/app.py +417 -1567
  5. universal_mcp/applications/aws_s3/app.py +33 -100
  6. universal_mcp/applications/bill/app.py +546 -1957
  7. universal_mcp/applications/box/app.py +1068 -3981
  8. universal_mcp/applications/braze/app.py +364 -1430
  9. universal_mcp/applications/browser_use/app.py +2 -8
  10. universal_mcp/applications/cal_com_v2/app.py +207 -625
  11. universal_mcp/applications/calendly/app.py +61 -200
  12. universal_mcp/applications/canva/app.py +45 -110
  13. universal_mcp/applications/clickup/app.py +207 -674
  14. universal_mcp/applications/coda/app.py +146 -426
  15. universal_mcp/applications/confluence/app.py +310 -1098
  16. universal_mcp/applications/contentful/app.py +36 -151
  17. universal_mcp/applications/crustdata/app.py +28 -107
  18. universal_mcp/applications/dialpad/app.py +283 -756
  19. universal_mcp/applications/digitalocean/app.py +1766 -5777
  20. universal_mcp/applications/domain_checker/app.py +3 -54
  21. universal_mcp/applications/e2b/app.py +14 -64
  22. universal_mcp/applications/elevenlabs/app.py +9 -47
  23. universal_mcp/applications/exa/app.py +6 -17
  24. universal_mcp/applications/falai/app.py +23 -100
  25. universal_mcp/applications/figma/app.py +53 -137
  26. universal_mcp/applications/file_system/app.py +2 -13
  27. universal_mcp/applications/firecrawl/app.py +51 -152
  28. universal_mcp/applications/fireflies/app.py +59 -281
  29. universal_mcp/applications/fpl/app.py +91 -528
  30. universal_mcp/applications/fpl/utils/fixtures.py +15 -49
  31. universal_mcp/applications/fpl/utils/helper.py +25 -89
  32. universal_mcp/applications/fpl/utils/league_utils.py +20 -64
  33. universal_mcp/applications/ghost_content/app.py +52 -161
  34. universal_mcp/applications/github/app.py +19 -56
  35. universal_mcp/applications/gong/app.py +88 -248
  36. universal_mcp/applications/google_calendar/app.py +16 -68
  37. universal_mcp/applications/google_docs/app.py +88 -188
  38. universal_mcp/applications/google_drive/app.py +140 -462
  39. universal_mcp/applications/google_gemini/app.py +12 -64
  40. universal_mcp/applications/google_mail/app.py +28 -157
  41. universal_mcp/applications/google_searchconsole/app.py +15 -48
  42. universal_mcp/applications/google_sheet/app.py +101 -578
  43. universal_mcp/applications/google_sheet/helper.py +10 -37
  44. universal_mcp/applications/hashnode/app.py +57 -269
  45. universal_mcp/applications/heygen/app.py +44 -122
  46. universal_mcp/applications/http_tools/app.py +10 -32
  47. universal_mcp/applications/hubspot/api_segments/crm_api.py +460 -1573
  48. universal_mcp/applications/hubspot/api_segments/marketing_api.py +74 -262
  49. universal_mcp/applications/hubspot/app.py +23 -87
  50. universal_mcp/applications/jira/app.py +2071 -7986
  51. universal_mcp/applications/klaviyo/app.py +494 -1376
  52. universal_mcp/applications/linkedin/README.md +9 -2
  53. universal_mcp/applications/linkedin/app.py +392 -212
  54. universal_mcp/applications/mailchimp/app.py +450 -1605
  55. universal_mcp/applications/markitdown/app.py +8 -20
  56. universal_mcp/applications/miro/app.py +217 -699
  57. universal_mcp/applications/ms_teams/app.py +64 -186
  58. universal_mcp/applications/neon/app.py +86 -192
  59. universal_mcp/applications/notion/app.py +21 -36
  60. universal_mcp/applications/onedrive/app.py +14 -36
  61. universal_mcp/applications/openai/app.py +42 -165
  62. universal_mcp/applications/outlook/app.py +16 -76
  63. universal_mcp/applications/perplexity/app.py +4 -19
  64. universal_mcp/applications/pipedrive/app.py +832 -3142
  65. universal_mcp/applications/posthog/app.py +163 -432
  66. universal_mcp/applications/reddit/app.py +40 -139
  67. universal_mcp/applications/resend/app.py +41 -107
  68. universal_mcp/applications/retell/app.py +14 -41
  69. universal_mcp/applications/rocketlane/app.py +221 -934
  70. universal_mcp/applications/scraper/README.md +7 -4
  71. universal_mcp/applications/scraper/app.py +216 -102
  72. universal_mcp/applications/semanticscholar/app.py +22 -64
  73. universal_mcp/applications/semrush/app.py +43 -77
  74. universal_mcp/applications/sendgrid/app.py +512 -1262
  75. universal_mcp/applications/sentry/app.py +271 -906
  76. universal_mcp/applications/serpapi/app.py +40 -143
  77. universal_mcp/applications/sharepoint/app.py +15 -37
  78. universal_mcp/applications/shopify/app.py +1551 -4287
  79. universal_mcp/applications/shortcut/app.py +155 -417
  80. universal_mcp/applications/slack/app.py +50 -101
  81. universal_mcp/applications/spotify/app.py +126 -325
  82. universal_mcp/applications/supabase/app.py +104 -213
  83. universal_mcp/applications/tavily/app.py +1 -1
  84. universal_mcp/applications/trello/app.py +693 -2656
  85. universal_mcp/applications/twilio/app.py +14 -50
  86. universal_mcp/applications/twitter/api_segments/compliance_api.py +4 -14
  87. universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +6 -18
  88. universal_mcp/applications/twitter/api_segments/likes_api.py +1 -3
  89. universal_mcp/applications/twitter/api_segments/lists_api.py +5 -15
  90. universal_mcp/applications/twitter/api_segments/trends_api.py +1 -3
  91. universal_mcp/applications/twitter/api_segments/tweets_api.py +9 -31
  92. universal_mcp/applications/twitter/api_segments/usage_api.py +1 -5
  93. universal_mcp/applications/twitter/api_segments/users_api.py +14 -42
  94. universal_mcp/applications/whatsapp/app.py +35 -186
  95. universal_mcp/applications/whatsapp/audio.py +2 -6
  96. universal_mcp/applications/whatsapp/whatsapp.py +17 -51
  97. universal_mcp/applications/whatsapp_business/app.py +70 -283
  98. universal_mcp/applications/wrike/app.py +45 -118
  99. universal_mcp/applications/yahoo_finance/app.py +19 -65
  100. universal_mcp/applications/youtube/app.py +75 -261
  101. universal_mcp/applications/zenquotes/app.py +2 -2
  102. {universal_mcp_applications-0.1.30.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/METADATA +2 -2
  103. {universal_mcp_applications-0.1.30.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/RECORD +105 -105
  104. {universal_mcp_applications-0.1.30.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/WHEEL +0 -0
  105. {universal_mcp_applications-0.1.30.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,4 @@
1
1
  from typing import Any
2
-
3
2
  from .api_segment_base import APISegmentBase
4
3
 
5
4
 
@@ -7,7 +6,7 @@ class MarketingApi(APISegmentBase):
7
6
  def __init__(self, main_app_client: Any):
8
7
  super().__init__(main_app_client)
9
8
 
10
- def get_marketing_campaigns(
9
+ async def get_marketing_campaigns(
11
10
  self,
12
11
  sort: str | None = None,
13
12
  after: str | None = None,
@@ -38,19 +37,13 @@ class MarketingApi(APISegmentBase):
38
37
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns"
39
38
  query_params = {
40
39
  k: v
41
- for k, v in [
42
- ("sort", sort),
43
- ("after", after),
44
- ("limit", limit),
45
- ("name", name),
46
- ("properties", properties),
47
- ]
40
+ for k, v in [("sort", sort), ("after", after), ("limit", limit), ("name", name), ("properties", properties)]
48
41
  if v is not None
49
42
  }
50
43
  response = self._get(url, params=query_params)
51
44
  return self._handle_response(response)
52
45
 
53
- def create_marketing_campaigns(self, properties: dict[str, str]) -> dict[str, Any]:
46
+ async def create_marketing_campaigns(self, properties: dict[str, str]) -> dict[str, Any]:
54
47
  """
55
48
 
56
49
  Creates a new marketing campaign using the provided JSON data and returns a status message upon successful creation.
@@ -69,25 +62,14 @@ class MarketingApi(APISegmentBase):
69
62
  """
70
63
  request_body_data = None
71
64
  request_body_data = {"properties": properties}
72
- request_body_data = {
73
- k: v for k, v in request_body_data.items() if v is not None
74
- }
65
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
75
66
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns"
76
67
  query_params = {}
77
- response = self._post(
78
- url,
79
- data=request_body_data,
80
- params=query_params,
81
- content_type="application/json",
82
- )
68
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
83
69
  return self._handle_response(response)
84
70
 
85
- def batch_read_campaigns_post(
86
- self,
87
- inputs: list[dict[str, Any]],
88
- startDate: str | None = None,
89
- endDate: str | None = None,
90
- properties: list[str] | None = None,
71
+ async def batch_read_campaigns_post(
72
+ self, inputs: list[dict[str, Any]], startDate: str | None = None, endDate: str | None = None, properties: list[str] | None = None
91
73
  ) -> dict[str, Any]:
92
74
  """
93
75
 
@@ -110,28 +92,13 @@ class MarketingApi(APISegmentBase):
110
92
  """
111
93
  request_body_data = None
112
94
  request_body_data = {"inputs": inputs}
113
- request_body_data = {
114
- k: v for k, v in request_body_data.items() if v is not None
115
- }
95
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
116
96
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/batch/read"
117
- query_params = {
118
- k: v
119
- for k, v in [
120
- ("startDate", startDate),
121
- ("endDate", endDate),
122
- ("properties", properties),
123
- ]
124
- if v is not None
125
- }
126
- response = self._post(
127
- url,
128
- data=request_body_data,
129
- params=query_params,
130
- content_type="application/json",
131
- )
97
+ query_params = {k: v for k, v in [("startDate", startDate), ("endDate", endDate), ("properties", properties)] if v is not None}
98
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
132
99
  return self._handle_response(response)
133
100
 
134
- def update_campaigns_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
101
+ async def update_campaigns_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
135
102
  """
136
103
 
137
104
  Updates multiple marketing campaigns in a batch using the POST method, requiring a JSON body and authentication via OAuth2 or private apps with "marketing.campaigns.read" permissions.
@@ -150,25 +117,13 @@ class MarketingApi(APISegmentBase):
150
117
  """
151
118
  request_body_data = None
152
119
  request_body_data = {"inputs": inputs}
153
- request_body_data = {
154
- k: v for k, v in request_body_data.items() if v is not None
155
- }
120
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
156
121
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/batch/update"
157
122
  query_params = {}
158
- response = self._post(
159
- url,
160
- data=request_body_data,
161
- params=query_params,
162
- content_type="application/json",
163
- )
123
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
164
124
  return self._handle_response(response)
165
125
 
166
- def get_campaign_metrics(
167
- self,
168
- campaignGuid: str,
169
- startDate: str | None = None,
170
- endDate: str | None = None,
171
- ) -> dict[str, Any]:
126
+ async def get_campaign_metrics(self, campaignGuid: str, startDate: str | None = None, endDate: str | None = None) -> dict[str, Any]:
172
127
  """
173
128
 
174
129
  Retrieves campaign metrics for a specified campaign GUID, optionally filtering by start and end dates.
@@ -190,15 +145,11 @@ class MarketingApi(APISegmentBase):
190
145
  if campaignGuid is None:
191
146
  raise ValueError("Missing required parameter 'campaignGuid'.")
192
147
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}/reports/metrics"
193
- query_params = {
194
- k: v
195
- for k, v in [("startDate", startDate), ("endDate", endDate)]
196
- if v is not None
197
- }
148
+ query_params = {k: v for k, v in [("startDate", startDate), ("endDate", endDate)] if v is not None}
198
149
  response = self._get(url, params=query_params)
199
150
  return self._handle_response(response)
200
151
 
201
- def get_campaign_asset_by_type(
152
+ async def get_campaign_asset_by_type(
202
153
  self,
203
154
  campaignGuid: str,
204
155
  assetType: str,
@@ -234,19 +185,12 @@ class MarketingApi(APISegmentBase):
234
185
  raise ValueError("Missing required parameter 'assetType'.")
235
186
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}"
236
187
  query_params = {
237
- k: v
238
- for k, v in [
239
- ("after", after),
240
- ("limit", limit),
241
- ("startDate", startDate),
242
- ("endDate", endDate),
243
- ]
244
- if v is not None
188
+ k: v for k, v in [("after", after), ("limit", limit), ("startDate", startDate), ("endDate", endDate)] if v is not None
245
189
  }
246
190
  response = self._get(url, params=query_params)
247
191
  return self._handle_response(response)
248
192
 
249
- def archive_campaigns_batch(self, inputs: list[dict[str, Any]]) -> Any:
193
+ async def archive_campaigns_batch(self, inputs: list[dict[str, Any]]) -> Any:
250
194
  """
251
195
 
252
196
  Archives a batch of marketing campaigns using the HubSpot API, requiring a JSON request body and returning a 204 status upon successful completion.
@@ -265,22 +209,13 @@ class MarketingApi(APISegmentBase):
265
209
  """
266
210
  request_body_data = None
267
211
  request_body_data = {"inputs": inputs}
268
- request_body_data = {
269
- k: v for k, v in request_body_data.items() if v is not None
270
- }
212
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
271
213
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/batch/archive"
272
214
  query_params = {}
273
- response = self._post(
274
- url,
275
- data=request_body_data,
276
- params=query_params,
277
- content_type="application/json",
278
- )
215
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
279
216
  return self._handle_response(response)
280
217
 
281
- def update_campaign_asset(
282
- self, campaignGuid: str, assetType: str, assetId: str
283
- ) -> Any:
218
+ async def update_campaign_asset(self, campaignGuid: str, assetType: str, assetId: str) -> Any:
284
219
  """
285
220
 
286
221
  Updates a specific asset of a given type within a marketing campaign identified by campaignGuid.
@@ -308,17 +243,10 @@ class MarketingApi(APISegmentBase):
308
243
  request_body_data = None
309
244
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}"
310
245
  query_params = {}
311
- response = self._put(
312
- url,
313
- data=request_body_data,
314
- params=query_params,
315
- content_type="application/json",
316
- )
246
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
317
247
  return self._handle_response(response)
318
248
 
319
- def delete_campaign_asset_by_id(
320
- self, campaignGuid: str, assetType: str, assetId: str
321
- ) -> Any:
249
+ async def delete_campaign_asset_by_id(self, campaignGuid: str, assetType: str, assetId: str) -> Any:
322
250
  """
323
251
 
324
252
  Deletes a specific asset from a marketing campaign using the provided campaign GUID, asset type, and asset ID.
@@ -348,12 +276,8 @@ class MarketingApi(APISegmentBase):
348
276
  response = self._delete(url, params=query_params)
349
277
  return self._handle_response(response)
350
278
 
351
- def get_campaign_revenue_report(
352
- self,
353
- campaignGuid: str,
354
- attributionModel: str | None = None,
355
- startDate: str | None = None,
356
- endDate: str | None = None,
279
+ async def get_campaign_revenue_report(
280
+ self, campaignGuid: str, attributionModel: str | None = None, startDate: str | None = None, endDate: str | None = None
357
281
  ) -> dict[str, Any]:
358
282
  """
359
283
 
@@ -378,18 +302,12 @@ class MarketingApi(APISegmentBase):
378
302
  raise ValueError("Missing required parameter 'campaignGuid'.")
379
303
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}/reports/revenue"
380
304
  query_params = {
381
- k: v
382
- for k, v in [
383
- ("attributionModel", attributionModel),
384
- ("startDate", startDate),
385
- ("endDate", endDate),
386
- ]
387
- if v is not None
305
+ k: v for k, v in [("attributionModel", attributionModel), ("startDate", startDate), ("endDate", endDate)] if v is not None
388
306
  }
389
307
  response = self._get(url, params=query_params)
390
308
  return self._handle_response(response)
391
309
 
392
- def create_campaigns_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
310
+ async def create_campaigns_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
393
311
  """
394
312
 
395
313
  Creates multiple marketing campaigns in a single operation using the "POST" method, accepting a JSON body with campaign details and returning a status message upon successful creation.
@@ -408,20 +326,13 @@ class MarketingApi(APISegmentBase):
408
326
  """
409
327
  request_body_data = None
410
328
  request_body_data = {"inputs": inputs}
411
- request_body_data = {
412
- k: v for k, v in request_body_data.items() if v is not None
413
- }
329
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
414
330
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/batch/create"
415
331
  query_params = {}
416
- response = self._post(
417
- url,
418
- data=request_body_data,
419
- params=query_params,
420
- content_type="application/json",
421
- )
332
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
422
333
  return self._handle_response(response)
423
334
 
424
- def get_campaign_budget_totals(self, campaignGuid: str) -> dict[str, Any]:
335
+ async def get_campaign_budget_totals(self, campaignGuid: str) -> dict[str, Any]:
425
336
  """
426
337
 
427
338
  Retrieves the total budget details for a marketing campaign using the campaign's GUID.
@@ -445,12 +356,8 @@ class MarketingApi(APISegmentBase):
445
356
  response = self._get(url, params=query_params)
446
357
  return self._handle_response(response)
447
358
 
448
- def get_campaign_by_guid(
449
- self,
450
- campaignGuid: str,
451
- startDate: str | None = None,
452
- endDate: str | None = None,
453
- properties: list[str] | None = None,
359
+ async def get_campaign_by_guid(
360
+ self, campaignGuid: str, startDate: str | None = None, endDate: str | None = None, properties: list[str] | None = None
454
361
  ) -> dict[str, Any]:
455
362
  """
456
363
 
@@ -474,19 +381,11 @@ class MarketingApi(APISegmentBase):
474
381
  if campaignGuid is None:
475
382
  raise ValueError("Missing required parameter 'campaignGuid'.")
476
383
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}"
477
- query_params = {
478
- k: v
479
- for k, v in [
480
- ("startDate", startDate),
481
- ("endDate", endDate),
482
- ("properties", properties),
483
- ]
484
- if v is not None
485
- }
384
+ query_params = {k: v for k, v in [("startDate", startDate), ("endDate", endDate), ("properties", properties)] if v is not None}
486
385
  response = self._get(url, params=query_params)
487
386
  return self._handle_response(response)
488
387
 
489
- def delete_campaign_by_guid(self, campaignGuid: str) -> Any:
388
+ async def delete_campaign_by_guid(self, campaignGuid: str) -> Any:
490
389
  """
491
390
 
492
391
  Deletes a marketing campaign using the provided campaign GUID and returns a 204 No Content response.
@@ -510,9 +409,7 @@ class MarketingApi(APISegmentBase):
510
409
  response = self._delete(url, params=query_params)
511
410
  return self._handle_response(response)
512
411
 
513
- def patch_campaign_by_guid(
514
- self, campaignGuid: str, properties: dict[str, str]
515
- ) -> dict[str, Any]:
412
+ async def patch_campaign_by_guid(self, campaignGuid: str, properties: dict[str, str]) -> dict[str, Any]:
516
413
  """
517
414
 
518
415
  Updates specified properties of a marketing campaign identified by the campaignGuid using a JSON patch document.
@@ -534,15 +431,13 @@ class MarketingApi(APISegmentBase):
534
431
  raise ValueError("Missing required parameter 'campaignGuid'.")
535
432
  request_body_data = None
536
433
  request_body_data = {"properties": properties}
537
- request_body_data = {
538
- k: v for k, v in request_body_data.items() if v is not None
539
- }
434
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
540
435
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}"
541
436
  query_params = {}
542
437
  response = self._patch(url, data=request_body_data, params=query_params)
543
438
  return self._handle_response(response)
544
439
 
545
- def get_campaign_contacts_report_by_type(
440
+ async def get_campaign_contacts_report_by_type(
546
441
  self,
547
442
  campaignGuid: str,
548
443
  contactType: str,
@@ -578,19 +473,12 @@ class MarketingApi(APISegmentBase):
578
473
  raise ValueError("Missing required parameter 'contactType'.")
579
474
  url = f"{self.main_app_client.base_url}/marketing/v3/campaigns/{campaignGuid}/reports/contacts/{contactType}"
580
475
  query_params = {
581
- k: v
582
- for k, v in [
583
- ("startDate", startDate),
584
- ("endDate", endDate),
585
- ("limit", limit),
586
- ("after", after),
587
- ]
588
- if v is not None
476
+ k: v for k, v in [("startDate", startDate), ("endDate", endDate), ("limit", limit), ("after", after)] if v is not None
589
477
  }
590
478
  response = self._get(url, params=query_params)
591
479
  return self._handle_response(response)
592
480
 
593
- def list_email_statistics(
481
+ async def list_email_statistics(
594
482
  self,
595
483
  startTimestamp: str | None = None,
596
484
  endTimestamp: str | None = None,
@@ -619,20 +507,13 @@ class MarketingApi(APISegmentBase):
619
507
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/statistics/list"
620
508
  query_params = {
621
509
  k: v
622
- for k, v in [
623
- ("startTimestamp", startTimestamp),
624
- ("endTimestamp", endTimestamp),
625
- ("emailIds", emailIds),
626
- ("property", property),
627
- ]
510
+ for k, v in [("startTimestamp", startTimestamp), ("endTimestamp", endTimestamp), ("emailIds", emailIds), ("property", property)]
628
511
  if v is not None
629
512
  }
630
513
  response = self._get(url, params=query_params)
631
514
  return self._handle_response(response)
632
515
 
633
- def create_ab_test_email_variation(
634
- self, variationName: str, contentId: str
635
- ) -> dict[str, Any]:
516
+ async def create_ab_test_email_variation(self, variationName: str, contentId: str) -> dict[str, Any]:
636
517
  """
637
518
 
638
519
  Creates a variation for an A/B test email using the POST method and returns a successful creation status.
@@ -652,20 +533,13 @@ class MarketingApi(APISegmentBase):
652
533
  """
653
534
  request_body_data = None
654
535
  request_body_data = {"variationName": variationName, "contentId": contentId}
655
- request_body_data = {
656
- k: v for k, v in request_body_data.items() if v is not None
657
- }
536
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
658
537
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/ab-test/create-variation"
659
538
  query_params = {}
660
- response = self._post(
661
- url,
662
- data=request_body_data,
663
- params=query_params,
664
- content_type="application/json",
665
- )
539
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
666
540
  return self._handle_response(response)
667
541
 
668
- def get_email_statistics_histogram(
542
+ async def get_email_statistics_histogram(
669
543
  self,
670
544
  interval: str | None = None,
671
545
  startTimestamp: str | None = None,
@@ -691,23 +565,16 @@ class MarketingApi(APISegmentBase):
691
565
  Tags:
692
566
  Statistics
693
567
  """
694
- url = (
695
- f"{self.main_app_client.base_url}/marketing/v3/emails/statistics/histogram"
696
- )
568
+ url = f"{self.main_app_client.base_url}/marketing/v3/emails/statistics/histogram"
697
569
  query_params = {
698
570
  k: v
699
- for k, v in [
700
- ("interval", interval),
701
- ("startTimestamp", startTimestamp),
702
- ("endTimestamp", endTimestamp),
703
- ("emailIds", emailIds),
704
- ]
571
+ for k, v in [("interval", interval), ("startTimestamp", startTimestamp), ("endTimestamp", endTimestamp), ("emailIds", emailIds)]
705
572
  if v is not None
706
573
  }
707
574
  response = self._get(url, params=query_params)
708
575
  return self._handle_response(response)
709
576
 
710
- def get_email_ab_test_variation(self, emailId: str) -> dict[str, Any]:
577
+ async def get_email_ab_test_variation(self, emailId: str) -> dict[str, Any]:
711
578
  """
712
579
 
713
580
  Retrieves the variation for an A/B test associated with a specific email by its ID using the GET method.
@@ -731,7 +598,7 @@ class MarketingApi(APISegmentBase):
731
598
  response = self._get(url, params=query_params)
732
599
  return self._handle_response(response)
733
600
 
734
- def reset_email_draft_by_id(self, emailId: str) -> Any:
601
+ async def reset_email_draft_by_id(self, emailId: str) -> Any:
735
602
  """
736
603
 
737
604
  Resets the draft status of an email using the specified email ID.
@@ -751,21 +618,12 @@ class MarketingApi(APISegmentBase):
751
618
  if emailId is None:
752
619
  raise ValueError("Missing required parameter 'emailId'.")
753
620
  request_body_data = None
754
- url = (
755
- f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/draft/reset"
756
- )
621
+ url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/draft/reset"
757
622
  query_params = {}
758
- response = self._post(
759
- url,
760
- data=request_body_data,
761
- params=query_params,
762
- content_type="application/json",
763
- )
623
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
764
624
  return self._handle_response(response)
765
625
 
766
- def restore_email_revision_to_draft(
767
- self, emailId: str, revisionId: str
768
- ) -> dict[str, Any]:
626
+ async def restore_email_revision_to_draft(self, emailId: str, revisionId: str) -> dict[str, Any]:
769
627
  """
770
628
 
771
629
  Restores a specified email revision to draft status by email ID and revision ID.
@@ -790,15 +648,10 @@ class MarketingApi(APISegmentBase):
790
648
  request_body_data = None
791
649
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore-to-draft"
792
650
  query_params = {}
793
- response = self._post(
794
- url,
795
- data=request_body_data,
796
- params=query_params,
797
- content_type="application/json",
798
- )
651
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
799
652
  return self._handle_response(response)
800
653
 
801
- def get_email_draft_by_id(self, emailId: str) -> dict[str, Any]:
654
+ async def get_email_draft_by_id(self, emailId: str) -> dict[str, Any]:
802
655
  """
803
656
 
804
657
  Retrieves the draft of an email with the specified `{emailId}` using the marketing API.
@@ -822,7 +675,7 @@ class MarketingApi(APISegmentBase):
822
675
  response = self._get(url, params=query_params)
823
676
  return self._handle_response(response)
824
677
 
825
- def update_email_draft_by_id(
678
+ async def update_email_draft_by_id(
826
679
  self,
827
680
  emailId: str,
828
681
  rssData: dict[str, Any] | None = None,
@@ -925,20 +778,14 @@ class MarketingApi(APISegmentBase):
925
778
  "subcategory": subcategory,
926
779
  "sendOnPublish": sendOnPublish,
927
780
  }
928
- request_body_data = {
929
- k: v for k, v in request_body_data.items() if v is not None
930
- }
781
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
931
782
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/draft"
932
783
  query_params = {}
933
784
  response = self._patch(url, data=request_body_data, params=query_params)
934
785
  return self._handle_response(response)
935
786
 
936
- def get_email_revisions(
937
- self,
938
- emailId: str,
939
- after: str | None = None,
940
- before: str | None = None,
941
- limit: int | None = None,
787
+ async def get_email_revisions(
788
+ self, emailId: str, after: str | None = None, before: str | None = None, limit: int | None = None
942
789
  ) -> dict[str, Any]:
943
790
  """
944
791
 
@@ -962,15 +809,11 @@ class MarketingApi(APISegmentBase):
962
809
  if emailId is None:
963
810
  raise ValueError("Missing required parameter 'emailId'.")
964
811
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/revisions"
965
- query_params = {
966
- k: v
967
- for k, v in [("after", after), ("before", before), ("limit", limit)]
968
- if v is not None
969
- }
812
+ query_params = {k: v for k, v in [("after", after), ("before", before), ("limit", limit)] if v is not None}
970
813
  response = self._get(url, params=query_params)
971
814
  return self._handle_response(response)
972
815
 
973
- def get_email_revision_by_id(self, emailId: str, revisionId: str) -> dict[str, Any]:
816
+ async def get_email_revision_by_id(self, emailId: str, revisionId: str) -> dict[str, Any]:
974
817
  """
975
818
 
976
819
  Retrieves a specific revision of an email identified by the provided email ID and revision ID using the GET method.
@@ -997,7 +840,7 @@ class MarketingApi(APISegmentBase):
997
840
  response = self._get(url, params=query_params)
998
841
  return self._handle_response(response)
999
842
 
1000
- def clone_email(self, id: str, cloneName: str | None = None) -> dict[str, Any]:
843
+ async def clone_email(self, id: str, cloneName: str | None = None) -> dict[str, Any]:
1001
844
  """
1002
845
 
1003
846
  Clones a marketing email using the POST method at the "/marketing/v3/emails/clone" endpoint, creating a duplicate email with the same properties as the original but with a unique ID.
@@ -1017,20 +860,13 @@ class MarketingApi(APISegmentBase):
1017
860
  """
1018
861
  request_body_data = None
1019
862
  request_body_data = {"cloneName": cloneName, "id": id}
1020
- request_body_data = {
1021
- k: v for k, v in request_body_data.items() if v is not None
1022
- }
863
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1023
864
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/clone"
1024
865
  query_params = {}
1025
- response = self._post(
1026
- url,
1027
- data=request_body_data,
1028
- params=query_params,
1029
- content_type="application/json",
1030
- )
866
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1031
867
  return self._handle_response(response)
1032
868
 
1033
- def list_marketing_emails(
869
+ async def list_marketing_emails(
1034
870
  self,
1035
871
  createdAt: str | None = None,
1036
872
  createdAfter: str | None = None,
@@ -1100,7 +936,7 @@ class MarketingApi(APISegmentBase):
1100
936
  response = self._get(url, params=query_params)
1101
937
  return self._handle_response(response)
1102
938
 
1103
- def create_email_marketing_campaign(
939
+ async def create_email_marketing_campaign(
1104
940
  self,
1105
941
  name: str,
1106
942
  feedbackSurveyId: str | None = None,
@@ -1202,20 +1038,13 @@ class MarketingApi(APISegmentBase):
1202
1038
  "subcategory": subcategory,
1203
1039
  "sendOnPublish": sendOnPublish,
1204
1040
  }
1205
- request_body_data = {
1206
- k: v for k, v in request_body_data.items() if v is not None
1207
- }
1041
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1208
1042
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/"
1209
1043
  query_params = {}
1210
- response = self._post(
1211
- url,
1212
- data=request_body_data,
1213
- params=query_params,
1214
- content_type="application/json",
1215
- )
1044
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1216
1045
  return self._handle_response(response)
1217
1046
 
1218
- def restore_email_revision(self, emailId: str, revisionId: str) -> Any:
1047
+ async def restore_email_revision(self, emailId: str, revisionId: str) -> Any:
1219
1048
  """
1220
1049
 
1221
1050
  Restores a specific email revision using the provided email ID and revision ID via the POST method.
@@ -1240,20 +1069,11 @@ class MarketingApi(APISegmentBase):
1240
1069
  request_body_data = None
1241
1070
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore"
1242
1071
  query_params = {}
1243
- response = self._post(
1244
- url,
1245
- data=request_body_data,
1246
- params=query_params,
1247
- content_type="application/json",
1248
- )
1072
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1249
1073
  return self._handle_response(response)
1250
1074
 
1251
- def get_email_by_id_marketing(
1252
- self,
1253
- emailId: str,
1254
- includeStats: bool | None = None,
1255
- includedProperties: list[str] | None = None,
1256
- archived: bool | None = None,
1075
+ async def get_email_by_id_marketing(
1076
+ self, emailId: str, includeStats: bool | None = None, includedProperties: list[str] | None = None, archived: bool | None = None
1257
1077
  ) -> dict[str, Any]:
1258
1078
  """
1259
1079
 
@@ -1279,19 +1099,13 @@ class MarketingApi(APISegmentBase):
1279
1099
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}"
1280
1100
  query_params = {
1281
1101
  k: v
1282
- for k, v in [
1283
- ("includeStats", includeStats),
1284
- ("includedProperties", includedProperties),
1285
- ("archived", archived),
1286
- ]
1102
+ for k, v in [("includeStats", includeStats), ("includedProperties", includedProperties), ("archived", archived)]
1287
1103
  if v is not None
1288
1104
  }
1289
1105
  response = self._get(url, params=query_params)
1290
1106
  return self._handle_response(response)
1291
1107
 
1292
- def delete_email_by_id_marketing(
1293
- self, emailId: str, archived: bool | None = None
1294
- ) -> Any:
1108
+ async def delete_email_by_id_marketing(self, emailId: str, archived: bool | None = None) -> Any:
1295
1109
  """
1296
1110
 
1297
1111
  Deletes the specified marketing email by its emailId, optionally archiving it, and returns a 204 No Content status on success.
@@ -1316,7 +1130,7 @@ class MarketingApi(APISegmentBase):
1316
1130
  response = self._delete(url, params=query_params)
1317
1131
  return self._handle_response(response)
1318
1132
 
1319
- def patch_email_by_id(
1133
+ async def patch_email_by_id(
1320
1134
  self,
1321
1135
  emailId: str,
1322
1136
  archived: bool | None = None,
@@ -1421,9 +1235,7 @@ class MarketingApi(APISegmentBase):
1421
1235
  "subcategory": subcategory,
1422
1236
  "sendOnPublish": sendOnPublish,
1423
1237
  }
1424
- request_body_data = {
1425
- k: v for k, v in request_body_data.items() if v is not None
1426
- }
1238
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1427
1239
  url = f"{self.main_app_client.base_url}/marketing/v3/emails/{emailId}"
1428
1240
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
1429
1241
  response = self._patch(url, data=request_body_data, params=query_params)