universal-mcp-applications 0.1.30rc1__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 (106) 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 +23 -4
  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 +280 -93
  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.30rc1.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/METADATA +2 -2
  103. {universal_mcp_applications-0.1.30rc1.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/RECORD +105 -106
  104. universal_mcp/applications/scraper/scraper_testers.py +0 -17
  105. {universal_mcp_applications-0.1.30rc1.dist-info → universal_mcp_applications-0.1.36rc1.dist-info}/WHEEL +0 -0
  106. {universal_mcp_applications-0.1.30rc1.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 CrmApi(APISegmentBase):
7
6
  def __init__(self, main_app_client: Any):
8
7
  super().__init__(main_app_client)
9
8
 
10
- def batch_read_emails(
9
+ async def batch_read_emails(
11
10
  self,
12
11
  propertiesWithHistory: list[str],
13
12
  inputs: list[dict[str, Any]],
@@ -42,20 +41,13 @@ class CrmApi(APISegmentBase):
42
41
  "inputs": inputs,
43
42
  "properties": properties,
44
43
  }
45
- request_body_data = {
46
- k: v for k, v in request_body_data.items() if v is not None
47
- }
44
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
48
45
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/batch/read"
49
46
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
50
- response = self._post(
51
- url,
52
- data=request_body_data,
53
- params=query_params,
54
- content_type="application/json",
55
- )
47
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
56
48
  return self._handle_response(response)
57
49
 
58
- def get_email_by_id(
50
+ async def get_email_by_id(
59
51
  self,
60
52
  emailId: str,
61
53
  properties: list[str] | None = None,
@@ -102,7 +94,7 @@ class CrmApi(APISegmentBase):
102
94
  response = self._get(url, params=query_params)
103
95
  return self._handle_response(response)
104
96
 
105
- def delete_email_by_id(self, emailId: str) -> Any:
97
+ async def delete_email_by_id(self, emailId: str) -> Any:
106
98
  """
107
99
 
108
100
  Deletes an email object identified by the specified emailId from a CRM system.
@@ -126,9 +118,7 @@ class CrmApi(APISegmentBase):
126
118
  response = self._delete(url, params=query_params)
127
119
  return self._handle_response(response)
128
120
 
129
- def update_email_by_id(
130
- self, emailId: str, properties: dict[str, str], idProperty: str | None = None
131
- ) -> dict[str, Any]:
121
+ async def update_email_by_id(self, emailId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
132
122
  """
133
123
 
134
124
  Updates specific properties of an existing email record in the CRM by its emailId using a PATCH request with JSON data.
@@ -151,17 +141,13 @@ class CrmApi(APISegmentBase):
151
141
  raise ValueError("Missing required parameter 'emailId'.")
152
142
  request_body_data = None
153
143
  request_body_data = {"properties": properties}
154
- request_body_data = {
155
- k: v for k, v in request_body_data.items() if v is not None
156
- }
144
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
157
145
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/{emailId}"
158
146
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
159
147
  response = self._patch(url, data=request_body_data, params=query_params)
160
148
  return self._handle_response(response)
161
149
 
162
- def merge_emails_post(
163
- self, objectIdToMerge: str, primaryObjectId: str
164
- ) -> dict[str, Any]:
150
+ async def merge_emails_post(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
165
151
  """
166
152
 
167
153
  Merges email records using the provided JSON payload, utilizing OAuth2 or private app authentication to manage contact data in the CRM system.
@@ -180,24 +166,14 @@ class CrmApi(APISegmentBase):
180
166
  Public_Object
181
167
  """
182
168
  request_body_data = None
183
- request_body_data = {
184
- "objectIdToMerge": objectIdToMerge,
185
- "primaryObjectId": primaryObjectId,
186
- }
187
- request_body_data = {
188
- k: v for k, v in request_body_data.items() if v is not None
189
- }
169
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
170
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
190
171
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/merge"
191
172
  query_params = {}
192
- response = self._post(
193
- url,
194
- data=request_body_data,
195
- params=query_params,
196
- content_type="application/json",
197
- )
173
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
198
174
  return self._handle_response(response)
199
175
 
200
- def archive_emails_batch(self, inputs: list[dict[str, Any]]) -> Any:
176
+ async def archive_emails_batch(self, inputs: list[dict[str, Any]]) -> Any:
201
177
  """
202
178
 
203
179
  Archives a batch of emails by sending a POST request to the "/crm/v3/objects/emails/batch/archive" endpoint with a JSON payload containing the email IDs to be archived.
@@ -216,20 +192,13 @@ class CrmApi(APISegmentBase):
216
192
  """
217
193
  request_body_data = None
218
194
  request_body_data = {"inputs": inputs}
219
- request_body_data = {
220
- k: v for k, v in request_body_data.items() if v is not None
221
- }
195
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
222
196
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/batch/archive"
223
197
  query_params = {}
224
- response = self._post(
225
- url,
226
- data=request_body_data,
227
- params=query_params,
228
- content_type="application/json",
229
- )
198
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
230
199
  return self._handle_response(response)
231
200
 
232
- def create_emails_batch_post(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
201
+ async def create_emails_batch_post(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
233
202
  """
234
203
 
235
204
  Creates a batch of email objects in the CRM using the POST method, requiring JSON content and authorization through OAuth2 or private apps.
@@ -248,20 +217,13 @@ class CrmApi(APISegmentBase):
248
217
  """
249
218
  request_body_data = None
250
219
  request_body_data = {"inputs": inputs}
251
- request_body_data = {
252
- k: v for k, v in request_body_data.items() if v is not None
253
- }
220
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
254
221
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/batch/create"
255
222
  query_params = {}
256
- response = self._post(
257
- url,
258
- data=request_body_data,
259
- params=query_params,
260
- content_type="application/json",
261
- )
223
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
262
224
  return self._handle_response(response)
263
225
 
264
- def update_emails_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
226
+ async def update_emails_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
265
227
  """
266
228
 
267
229
  Updates multiple email objects in a CRM system using a batch operation via the POST method, returning status messages for each update.
@@ -280,22 +242,13 @@ class CrmApi(APISegmentBase):
280
242
  """
281
243
  request_body_data = None
282
244
  request_body_data = {"inputs": inputs}
283
- request_body_data = {
284
- k: v for k, v in request_body_data.items() if v is not None
285
- }
245
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
286
246
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/batch/update"
287
247
  query_params = {}
288
- response = self._post(
289
- url,
290
- data=request_body_data,
291
- params=query_params,
292
- content_type="application/json",
293
- )
248
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
294
249
  return self._handle_response(response)
295
250
 
296
- def delete_email_gdpr_data(
297
- self, objectId: str, idProperty: str | None = None
298
- ) -> Any:
251
+ async def delete_email_gdpr_data(self, objectId: str, idProperty: str | None = None) -> Any:
299
252
  """
300
253
 
301
254
  Deletes a contact and associated data from the CRM in compliance with GDPR guidelines using the provided JSON payload, requiring the "crm.objects.contacts.write" permission.
@@ -315,20 +268,13 @@ class CrmApi(APISegmentBase):
315
268
  """
316
269
  request_body_data = None
317
270
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
318
- request_body_data = {
319
- k: v for k, v in request_body_data.items() if v is not None
320
- }
271
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
321
272
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/gdpr-delete"
322
273
  query_params = {}
323
- response = self._post(
324
- url,
325
- data=request_body_data,
326
- params=query_params,
327
- content_type="application/json",
328
- )
274
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
329
275
  return self._handle_response(response)
330
276
 
331
- def list_emails_with_filters(
277
+ async def list_emails_with_filters(
332
278
  self,
333
279
  limit: int | None = None,
334
280
  after: str | None = None,
@@ -374,9 +320,7 @@ class CrmApi(APISegmentBase):
374
320
  response = self._get(url, params=query_params)
375
321
  return self._handle_response(response)
376
322
 
377
- def create_email(
378
- self, associations: list[dict[str, Any]], properties: dict[str, str]
379
- ) -> dict[str, Any]:
323
+ async def create_email(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
380
324
  """
381
325
 
382
326
  Creates an email object in the CRM using the POST method, allowing for the association of metadata with the email and requiring authentication via OAuth2 or private apps to access the necessary permissions.
@@ -396,27 +340,14 @@ class CrmApi(APISegmentBase):
396
340
  """
397
341
  request_body_data = None
398
342
  request_body_data = {"associations": associations, "properties": properties}
399
- request_body_data = {
400
- k: v for k, v in request_body_data.items() if v is not None
401
- }
343
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
402
344
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails"
403
345
  query_params = {}
404
- response = self._post(
405
- url,
406
- data=request_body_data,
407
- params=query_params,
408
- content_type="application/json",
409
- )
346
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
410
347
  return self._handle_response(response)
411
348
 
412
- def search_emails_post(
413
- self,
414
- limit: int,
415
- after: str,
416
- sorts: list[str],
417
- properties: list[str],
418
- filterGroups: list[dict[str, Any]],
419
- query: str | None = None,
349
+ async def search_emails_post(
350
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
420
351
  ) -> dict[str, Any]:
421
352
  """
422
353
 
@@ -448,20 +379,13 @@ class CrmApi(APISegmentBase):
448
379
  "properties": properties,
449
380
  "filterGroups": filterGroups,
450
381
  }
451
- request_body_data = {
452
- k: v for k, v in request_body_data.items() if v is not None
453
- }
382
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
454
383
  url = f"{self.main_app_client.base_url}/crm/v3/objects/emails/search"
455
384
  query_params = {}
456
- response = self._post(
457
- url,
458
- data=request_body_data,
459
- params=query_params,
460
- content_type="application/json",
461
- )
385
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
462
386
  return self._handle_response(response)
463
387
 
464
- def batch_read_products_post(
388
+ async def batch_read_products_post(
465
389
  self,
466
390
  propertiesWithHistory: list[str],
467
391
  inputs: list[dict[str, Any]],
@@ -496,20 +420,13 @@ class CrmApi(APISegmentBase):
496
420
  "inputs": inputs,
497
421
  "properties": properties,
498
422
  }
499
- request_body_data = {
500
- k: v for k, v in request_body_data.items() if v is not None
501
- }
423
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
502
424
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/batch/read"
503
425
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
504
- response = self._post(
505
- url,
506
- data=request_body_data,
507
- params=query_params,
508
- content_type="application/json",
509
- )
426
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
510
427
  return self._handle_response(response)
511
428
 
512
- def get_product_by_id(
429
+ async def get_product_by_id(
513
430
  self,
514
431
  productId: str,
515
432
  properties: list[str] | None = None,
@@ -556,7 +473,7 @@ class CrmApi(APISegmentBase):
556
473
  response = self._get(url, params=query_params)
557
474
  return self._handle_response(response)
558
475
 
559
- def delete_product_by_id(self, productId: str) -> Any:
476
+ async def delete_product_by_id(self, productId: str) -> Any:
560
477
  """
561
478
 
562
479
  Deletes a product from the CRM using its product ID.
@@ -580,12 +497,7 @@ class CrmApi(APISegmentBase):
580
497
  response = self._delete(url, params=query_params)
581
498
  return self._handle_response(response)
582
499
 
583
- def patch_product_by_id(
584
- self,
585
- productId: str,
586
- properties: dict[str, str],
587
- idProperty: str | None = None,
588
- ) -> dict[str, Any]:
500
+ async def patch_product_by_id(self, productId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
589
501
  """
590
502
 
591
503
  Updates specified properties of a product identified by productId using a JSON PATCH request.
@@ -608,17 +520,13 @@ class CrmApi(APISegmentBase):
608
520
  raise ValueError("Missing required parameter 'productId'.")
609
521
  request_body_data = None
610
522
  request_body_data = {"properties": properties}
611
- request_body_data = {
612
- k: v for k, v in request_body_data.items() if v is not None
613
- }
523
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
614
524
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/{productId}"
615
525
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
616
526
  response = self._patch(url, data=request_body_data, params=query_params)
617
527
  return self._handle_response(response)
618
528
 
619
- def merge_products(
620
- self, objectIdToMerge: str, primaryObjectId: str
621
- ) -> dict[str, Any]:
529
+ async def merge_products(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
622
530
  """
623
531
 
624
532
  Merges two or more product records in a CRM system using the POST method, allowing for the consolidation of data into a single, unified record.
@@ -637,24 +545,14 @@ class CrmApi(APISegmentBase):
637
545
  Public_Object
638
546
  """
639
547
  request_body_data = None
640
- request_body_data = {
641
- "objectIdToMerge": objectIdToMerge,
642
- "primaryObjectId": primaryObjectId,
643
- }
644
- request_body_data = {
645
- k: v for k, v in request_body_data.items() if v is not None
646
- }
548
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
549
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
647
550
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/merge"
648
551
  query_params = {}
649
- response = self._post(
650
- url,
651
- data=request_body_data,
652
- params=query_params,
653
- content_type="application/json",
654
- )
552
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
655
553
  return self._handle_response(response)
656
554
 
657
- def archive_products_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
555
+ async def archive_products_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
658
556
  """
659
557
 
660
558
  Archives a batch of products by ID using the POST method, accepting JSON-formatted request bodies and returning a 204 status upon successful execution.
@@ -673,20 +571,13 @@ class CrmApi(APISegmentBase):
673
571
  """
674
572
  request_body_data = None
675
573
  request_body_data = {"inputs": inputs}
676
- request_body_data = {
677
- k: v for k, v in request_body_data.items() if v is not None
678
- }
574
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
679
575
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/batch/archive"
680
576
  query_params = {}
681
- response = self._post(
682
- url,
683
- data=request_body_data,
684
- params=query_params,
685
- content_type="application/json",
686
- )
577
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
687
578
  return self._handle_response(response)
688
579
 
689
- def create_products_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
580
+ async def create_products_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
690
581
  """
691
582
 
692
583
  Creates multiple product records in a single batch request within the CRM system.
@@ -705,20 +596,13 @@ class CrmApi(APISegmentBase):
705
596
  """
706
597
  request_body_data = None
707
598
  request_body_data = {"inputs": inputs}
708
- request_body_data = {
709
- k: v for k, v in request_body_data.items() if v is not None
710
- }
599
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
711
600
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/batch/create"
712
601
  query_params = {}
713
- response = self._post(
714
- url,
715
- data=request_body_data,
716
- params=query_params,
717
- content_type="application/json",
718
- )
602
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
719
603
  return self._handle_response(response)
720
604
 
721
- def update_products_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
605
+ async def update_products_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
722
606
  """
723
607
 
724
608
  Updates multiple product records in a batch using the HubSpot CRM v3 API and returns a status response indicating success or partial failure.
@@ -737,22 +621,13 @@ class CrmApi(APISegmentBase):
737
621
  """
738
622
  request_body_data = None
739
623
  request_body_data = {"inputs": inputs}
740
- request_body_data = {
741
- k: v for k, v in request_body_data.items() if v is not None
742
- }
624
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
743
625
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/batch/update"
744
626
  query_params = {}
745
- response = self._post(
746
- url,
747
- data=request_body_data,
748
- params=query_params,
749
- content_type="application/json",
750
- )
627
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
751
628
  return self._handle_response(response)
752
629
 
753
- def delete_product_gdpr_data(
754
- self, objectId: str, idProperty: str | None = None
755
- ) -> Any:
630
+ async def delete_product_gdpr_data(self, objectId: str, idProperty: str | None = None) -> Any:
756
631
  """
757
632
 
758
633
  Performs a GDPR-compliant deletion of product records in the CRM using the POST method, requiring a JSON request body and authentication.
@@ -772,20 +647,13 @@ class CrmApi(APISegmentBase):
772
647
  """
773
648
  request_body_data = None
774
649
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
775
- request_body_data = {
776
- k: v for k, v in request_body_data.items() if v is not None
777
- }
650
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
778
651
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/gdpr-delete"
779
652
  query_params = {}
780
- response = self._post(
781
- url,
782
- data=request_body_data,
783
- params=query_params,
784
- content_type="application/json",
785
- )
653
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
786
654
  return self._handle_response(response)
787
655
 
788
- def list_products(
656
+ async def list_products(
789
657
  self,
790
658
  limit: int | None = None,
791
659
  after: str | None = None,
@@ -831,9 +699,7 @@ class CrmApi(APISegmentBase):
831
699
  response = self._get(url, params=query_params)
832
700
  return self._handle_response(response)
833
701
 
834
- def create_product(
835
- self, associations: list[dict[str, Any]], properties: dict[str, str]
836
- ) -> dict[str, Any]:
702
+ async def create_product(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
837
703
  """
838
704
 
839
705
  Creates a new product in the CRM product library to manage the collection of goods and services offered by the company.
@@ -853,27 +719,14 @@ class CrmApi(APISegmentBase):
853
719
  """
854
720
  request_body_data = None
855
721
  request_body_data = {"associations": associations, "properties": properties}
856
- request_body_data = {
857
- k: v for k, v in request_body_data.items() if v is not None
858
- }
722
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
859
723
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products"
860
724
  query_params = {}
861
- response = self._post(
862
- url,
863
- data=request_body_data,
864
- params=query_params,
865
- content_type="application/json",
866
- )
725
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
867
726
  return self._handle_response(response)
868
727
 
869
- def search_products(
870
- self,
871
- limit: int,
872
- after: str,
873
- sorts: list[str],
874
- properties: list[str],
875
- filterGroups: list[dict[str, Any]],
876
- query: str | None = None,
728
+ async def search_products(
729
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
877
730
  ) -> dict[str, Any]:
878
731
  """
879
732
 
@@ -905,22 +758,13 @@ class CrmApi(APISegmentBase):
905
758
  "properties": properties,
906
759
  "filterGroups": filterGroups,
907
760
  }
908
- request_body_data = {
909
- k: v for k, v in request_body_data.items() if v is not None
910
- }
761
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
911
762
  url = f"{self.main_app_client.base_url}/crm/v3/objects/products/search"
912
763
  query_params = {}
913
- response = self._post(
914
- url,
915
- data=request_body_data,
916
- params=query_params,
917
- content_type="application/json",
918
- )
764
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
919
765
  return self._handle_response(response)
920
766
 
921
- def get_pipeline_by_id_for_type(
922
- self, objectType: str, pipelineId: str
923
- ) -> dict[str, Any]:
767
+ async def get_pipeline_by_id_for_type(self, objectType: str, pipelineId: str) -> dict[str, Any]:
924
768
  """
925
769
 
926
770
  Retrieves details about a specific CRM pipeline by its ID and object type, providing information about the stages and records within that pipeline.
@@ -947,7 +791,7 @@ class CrmApi(APISegmentBase):
947
791
  response = self._get(url, params=query_params)
948
792
  return self._handle_response(response)
949
793
 
950
- def update_pipeline(
794
+ async def update_pipeline(
951
795
  self,
952
796
  objectType: str,
953
797
  pipelineId: str,
@@ -984,35 +828,21 @@ class CrmApi(APISegmentBase):
984
828
  if pipelineId is None:
985
829
  raise ValueError("Missing required parameter 'pipelineId'.")
986
830
  request_body_data = None
987
- request_body_data = {
988
- "displayOrder": displayOrder,
989
- "stages": stages,
990
- "label": label,
991
- }
992
- request_body_data = {
993
- k: v for k, v in request_body_data.items() if v is not None
994
- }
831
+ request_body_data = {"displayOrder": displayOrder, "stages": stages, "label": label}
832
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
995
833
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}/{pipelineId}"
996
834
  query_params = {
997
835
  k: v
998
836
  for k, v in [
999
837
  ("validateReferencesBeforeDelete", validateReferencesBeforeDelete),
1000
- (
1001
- "validateDealStageUsagesBeforeDelete",
1002
- validateDealStageUsagesBeforeDelete,
1003
- ),
838
+ ("validateDealStageUsagesBeforeDelete", validateDealStageUsagesBeforeDelete),
1004
839
  ]
1005
840
  if v is not None
1006
841
  }
1007
- response = self._put(
1008
- url,
1009
- data=request_body_data,
1010
- params=query_params,
1011
- content_type="application/json",
1012
- )
842
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
1013
843
  return self._handle_response(response)
1014
844
 
1015
- def delete_pipeline_by_id_and_type(
845
+ async def delete_pipeline_by_id_and_type(
1016
846
  self,
1017
847
  objectType: str,
1018
848
  pipelineId: str,
@@ -1047,17 +877,14 @@ class CrmApi(APISegmentBase):
1047
877
  k: v
1048
878
  for k, v in [
1049
879
  ("validateReferencesBeforeDelete", validateReferencesBeforeDelete),
1050
- (
1051
- "validateDealStageUsagesBeforeDelete",
1052
- validateDealStageUsagesBeforeDelete,
1053
- ),
880
+ ("validateDealStageUsagesBeforeDelete", validateDealStageUsagesBeforeDelete),
1054
881
  ]
1055
882
  if v is not None
1056
883
  }
1057
884
  response = self._delete(url, params=query_params)
1058
885
  return self._handle_response(response)
1059
886
 
1060
- def patch_pipeline_by_object_type(
887
+ async def patch_pipeline_by_object_type(
1061
888
  self,
1062
889
  objectType: str,
1063
890
  pipelineId: str,
@@ -1094,32 +921,21 @@ class CrmApi(APISegmentBase):
1094
921
  if pipelineId is None:
1095
922
  raise ValueError("Missing required parameter 'pipelineId'.")
1096
923
  request_body_data = None
1097
- request_body_data = {
1098
- "archived": archived,
1099
- "displayOrder": displayOrder,
1100
- "label": label,
1101
- }
1102
- request_body_data = {
1103
- k: v for k, v in request_body_data.items() if v is not None
1104
- }
924
+ request_body_data = {"archived": archived, "displayOrder": displayOrder, "label": label}
925
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1105
926
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}/{pipelineId}"
1106
927
  query_params = {
1107
928
  k: v
1108
929
  for k, v in [
1109
930
  ("validateReferencesBeforeDelete", validateReferencesBeforeDelete),
1110
- (
1111
- "validateDealStageUsagesBeforeDelete",
1112
- validateDealStageUsagesBeforeDelete,
1113
- ),
931
+ ("validateDealStageUsagesBeforeDelete", validateDealStageUsagesBeforeDelete),
1114
932
  ]
1115
933
  if v is not None
1116
934
  }
1117
935
  response = self._patch(url, data=request_body_data, params=query_params)
1118
936
  return self._handle_response(response)
1119
937
 
1120
- def get_pipeline_audit_by_object_type(
1121
- self, objectType: str, pipelineId: str
1122
- ) -> dict[str, Any]:
938
+ async def get_pipeline_audit_by_object_type(self, objectType: str, pipelineId: str) -> dict[str, Any]:
1123
939
  """
1124
940
 
1125
941
  Retrieves an audit of all changes to a specific pipeline in HubSpot CRM, based on the provided object type and pipeline ID.
@@ -1146,9 +962,7 @@ class CrmApi(APISegmentBase):
1146
962
  response = self._get(url, params=query_params)
1147
963
  return self._handle_response(response)
1148
964
 
1149
- def get_pipeline_stages_by_object_type(
1150
- self, objectType: str, pipelineId: str
1151
- ) -> dict[str, Any]:
965
+ async def get_pipeline_stages_by_object_type(self, objectType: str, pipelineId: str) -> dict[str, Any]:
1152
966
  """
1153
967
 
1154
968
  Retrieves the list of stages within a specified pipeline for a given object type in the CRM system.
@@ -1175,13 +989,8 @@ class CrmApi(APISegmentBase):
1175
989
  response = self._get(url, params=query_params)
1176
990
  return self._handle_response(response)
1177
991
 
1178
- def create_pipeline_stage(
1179
- self,
1180
- objectType: str,
1181
- pipelineId: str,
1182
- metadata: dict[str, str],
1183
- displayOrder: int,
1184
- label: str,
992
+ async def create_pipeline_stage(
993
+ self, objectType: str, pipelineId: str, metadata: dict[str, str], displayOrder: int, label: str
1185
994
  ) -> dict[str, Any]:
1186
995
  """
1187
996
 
@@ -1212,25 +1021,14 @@ class CrmApi(APISegmentBase):
1212
1021
  if pipelineId is None:
1213
1022
  raise ValueError("Missing required parameter 'pipelineId'.")
1214
1023
  request_body_data = None
1215
- request_body_data = {
1216
- "metadata": metadata,
1217
- "displayOrder": displayOrder,
1218
- "label": label,
1219
- }
1220
- request_body_data = {
1221
- k: v for k, v in request_body_data.items() if v is not None
1222
- }
1024
+ request_body_data = {"metadata": metadata, "displayOrder": displayOrder, "label": label}
1025
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1223
1026
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}/{pipelineId}/stages"
1224
1027
  query_params = {}
1225
- response = self._post(
1226
- url,
1227
- data=request_body_data,
1228
- params=query_params,
1229
- content_type="application/json",
1230
- )
1028
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1231
1029
  return self._handle_response(response)
1232
1030
 
1233
- def list_pipelines_by_type(self, objectType: str) -> dict[str, Any]:
1031
+ async def list_pipelines_by_type(self, objectType: str) -> dict[str, Any]:
1234
1032
  """
1235
1033
 
1236
1034
  Retrieves a list of pipelines for a specified object type in the CRM, allowing for the management and inspection of pipelines relevant to that object type.
@@ -1254,12 +1052,8 @@ class CrmApi(APISegmentBase):
1254
1052
  response = self._get(url, params=query_params)
1255
1053
  return self._handle_response(response)
1256
1054
 
1257
- def create_pipeline_by_object_type(
1258
- self,
1259
- objectType: str,
1260
- displayOrder: int,
1261
- stages: list[dict[str, Any]],
1262
- label: str,
1055
+ async def create_pipeline_by_object_type(
1056
+ self, objectType: str, displayOrder: int, stages: list[dict[str, Any]], label: str
1263
1057
  ) -> dict[str, Any]:
1264
1058
  """
1265
1059
 
@@ -1283,27 +1077,14 @@ class CrmApi(APISegmentBase):
1283
1077
  if objectType is None:
1284
1078
  raise ValueError("Missing required parameter 'objectType'.")
1285
1079
  request_body_data = None
1286
- request_body_data = {
1287
- "displayOrder": displayOrder,
1288
- "stages": stages,
1289
- "label": label,
1290
- }
1291
- request_body_data = {
1292
- k: v for k, v in request_body_data.items() if v is not None
1293
- }
1080
+ request_body_data = {"displayOrder": displayOrder, "stages": stages, "label": label}
1081
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1294
1082
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}"
1295
1083
  query_params = {}
1296
- response = self._post(
1297
- url,
1298
- data=request_body_data,
1299
- params=query_params,
1300
- content_type="application/json",
1301
- )
1084
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1302
1085
  return self._handle_response(response)
1303
1086
 
1304
- def get_pipeline_stage_by_id(
1305
- self, objectType: str, pipelineId: str, stageId: str
1306
- ) -> dict[str, Any]:
1087
+ async def get_pipeline_stage_by_id(self, objectType: str, pipelineId: str, stageId: str) -> dict[str, Any]:
1307
1088
  """
1308
1089
 
1309
1090
  Retrieves detailed information about a specific stage within a given pipeline and object type in the CRM system.
@@ -1333,14 +1114,8 @@ class CrmApi(APISegmentBase):
1333
1114
  response = self._get(url, params=query_params)
1334
1115
  return self._handle_response(response)
1335
1116
 
1336
- def update_pipeline_stage_by_id(
1337
- self,
1338
- objectType: str,
1339
- pipelineId: str,
1340
- stageId: str,
1341
- metadata: dict[str, str],
1342
- displayOrder: int,
1343
- label: str,
1117
+ async def update_pipeline_stage_by_id(
1118
+ self, objectType: str, pipelineId: str, stageId: str, metadata: dict[str, str], displayOrder: int, label: str
1344
1119
  ) -> dict[str, Any]:
1345
1120
  """
1346
1121
 
@@ -1374,27 +1149,14 @@ class CrmApi(APISegmentBase):
1374
1149
  if stageId is None:
1375
1150
  raise ValueError("Missing required parameter 'stageId'.")
1376
1151
  request_body_data = None
1377
- request_body_data = {
1378
- "metadata": metadata,
1379
- "displayOrder": displayOrder,
1380
- "label": label,
1381
- }
1382
- request_body_data = {
1383
- k: v for k, v in request_body_data.items() if v is not None
1384
- }
1152
+ request_body_data = {"metadata": metadata, "displayOrder": displayOrder, "label": label}
1153
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1385
1154
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}"
1386
1155
  query_params = {}
1387
- response = self._put(
1388
- url,
1389
- data=request_body_data,
1390
- params=query_params,
1391
- content_type="application/json",
1392
- )
1156
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
1393
1157
  return self._handle_response(response)
1394
1158
 
1395
- def delete_pipeline_stage_by_id(
1396
- self, objectType: str, pipelineId: str, stageId: str
1397
- ) -> Any:
1159
+ async def delete_pipeline_stage_by_id(self, objectType: str, pipelineId: str, stageId: str) -> Any:
1398
1160
  """
1399
1161
 
1400
1162
  Deletes a specific stage from a pipeline for the given object type in the CRM system.
@@ -1424,7 +1186,7 @@ class CrmApi(APISegmentBase):
1424
1186
  response = self._delete(url, params=query_params)
1425
1187
  return self._handle_response(response)
1426
1188
 
1427
- def update_pipeline_stage(
1189
+ async def update_pipeline_stage(
1428
1190
  self,
1429
1191
  objectType: str,
1430
1192
  pipelineId: str,
@@ -1467,21 +1229,14 @@ class CrmApi(APISegmentBase):
1467
1229
  if stageId is None:
1468
1230
  raise ValueError("Missing required parameter 'stageId'.")
1469
1231
  request_body_data = None
1470
- request_body_data = {
1471
- "archived": archived,
1472
- "metadata": metadata,
1473
- "displayOrder": displayOrder,
1474
- "label": label,
1475
- }
1476
- request_body_data = {
1477
- k: v for k, v in request_body_data.items() if v is not None
1478
- }
1232
+ request_body_data = {"archived": archived, "metadata": metadata, "displayOrder": displayOrder, "label": label}
1233
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1479
1234
  url = f"{self.main_app_client.base_url}/crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}"
1480
1235
  query_params = {}
1481
1236
  response = self._patch(url, data=request_body_data, params=query_params)
1482
1237
  return self._handle_response(response)
1483
1238
 
1484
- def batch_read_companies_post(
1239
+ async def batch_read_companies_post(
1485
1240
  self,
1486
1241
  propertiesWithHistory: list[str],
1487
1242
  inputs: list[dict[str, Any]],
@@ -1516,20 +1271,13 @@ class CrmApi(APISegmentBase):
1516
1271
  "inputs": inputs,
1517
1272
  "properties": properties,
1518
1273
  }
1519
- request_body_data = {
1520
- k: v for k, v in request_body_data.items() if v is not None
1521
- }
1274
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1522
1275
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/batch/read"
1523
1276
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
1524
- response = self._post(
1525
- url,
1526
- data=request_body_data,
1527
- params=query_params,
1528
- content_type="application/json",
1529
- )
1277
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1530
1278
  return self._handle_response(response)
1531
1279
 
1532
- def get_company_by_id(
1280
+ async def get_company_by_id(
1533
1281
  self,
1534
1282
  companyId: str,
1535
1283
  properties: list[str] | None = None,
@@ -1576,7 +1324,7 @@ class CrmApi(APISegmentBase):
1576
1324
  response = self._get(url, params=query_params)
1577
1325
  return self._handle_response(response)
1578
1326
 
1579
- def delete_company_by_id(self, companyId: str) -> Any:
1327
+ async def delete_company_by_id(self, companyId: str) -> Any:
1580
1328
  """
1581
1329
 
1582
1330
  Deletes a company by its ID using the DELETE method, requiring the company ID as a path parameter and authorization through OAuth2 or private apps with the "crm.objects.companies.write" permission.
@@ -1600,12 +1348,7 @@ class CrmApi(APISegmentBase):
1600
1348
  response = self._delete(url, params=query_params)
1601
1349
  return self._handle_response(response)
1602
1350
 
1603
- def patch_company_by_id(
1604
- self,
1605
- companyId: str,
1606
- properties: dict[str, str],
1607
- idProperty: str | None = None,
1608
- ) -> dict[str, Any]:
1351
+ async def patch_company_by_id(self, companyId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
1609
1352
  """
1610
1353
 
1611
1354
  Updates a company in the CRM using the PATCH method, allowing partial modifications to the company's properties.
@@ -1628,17 +1371,13 @@ class CrmApi(APISegmentBase):
1628
1371
  raise ValueError("Missing required parameter 'companyId'.")
1629
1372
  request_body_data = None
1630
1373
  request_body_data = {"properties": properties}
1631
- request_body_data = {
1632
- k: v for k, v in request_body_data.items() if v is not None
1633
- }
1374
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1634
1375
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/{companyId}"
1635
1376
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
1636
1377
  response = self._patch(url, data=request_body_data, params=query_params)
1637
1378
  return self._handle_response(response)
1638
1379
 
1639
- def merge_companies_post(
1640
- self, objectIdToMerge: str, primaryObjectId: str
1641
- ) -> dict[str, Any]:
1380
+ async def merge_companies_post(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
1642
1381
  """
1643
1382
 
1644
1383
  Merges two or more company records into a single unified record using the CRM API, requiring a JSON payload and appropriate write permissions.
@@ -1657,24 +1396,14 @@ class CrmApi(APISegmentBase):
1657
1396
  Public_Object
1658
1397
  """
1659
1398
  request_body_data = None
1660
- request_body_data = {
1661
- "objectIdToMerge": objectIdToMerge,
1662
- "primaryObjectId": primaryObjectId,
1663
- }
1664
- request_body_data = {
1665
- k: v for k, v in request_body_data.items() if v is not None
1666
- }
1399
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
1400
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1667
1401
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/merge"
1668
1402
  query_params = {}
1669
- response = self._post(
1670
- url,
1671
- data=request_body_data,
1672
- params=query_params,
1673
- content_type="application/json",
1674
- )
1403
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1675
1404
  return self._handle_response(response)
1676
1405
 
1677
- def archive_companies_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
1406
+ async def archive_companies_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
1678
1407
  """
1679
1408
 
1680
1409
  Archives a batch of companies using the HubSpot CRM API, requiring a JSON body and returning a 204 status on successful operation.
@@ -1693,20 +1422,13 @@ class CrmApi(APISegmentBase):
1693
1422
  """
1694
1423
  request_body_data = None
1695
1424
  request_body_data = {"inputs": inputs}
1696
- request_body_data = {
1697
- k: v for k, v in request_body_data.items() if v is not None
1698
- }
1425
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1699
1426
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/batch/archive"
1700
1427
  query_params = {}
1701
- response = self._post(
1702
- url,
1703
- data=request_body_data,
1704
- params=query_params,
1705
- content_type="application/json",
1706
- )
1428
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1707
1429
  return self._handle_response(response)
1708
1430
 
1709
- def create_companies_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
1431
+ async def create_companies_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
1710
1432
  """
1711
1433
 
1712
1434
  Creates multiple company records in batch using the HubSpot CRM API and returns a status message, requiring authorization via OAuth2 or private apps.
@@ -1725,20 +1447,13 @@ class CrmApi(APISegmentBase):
1725
1447
  """
1726
1448
  request_body_data = None
1727
1449
  request_body_data = {"inputs": inputs}
1728
- request_body_data = {
1729
- k: v for k, v in request_body_data.items() if v is not None
1730
- }
1450
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1731
1451
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/batch/create"
1732
1452
  query_params = {}
1733
- response = self._post(
1734
- url,
1735
- data=request_body_data,
1736
- params=query_params,
1737
- content_type="application/json",
1738
- )
1453
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1739
1454
  return self._handle_response(response)
1740
1455
 
1741
- def update_companies_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
1456
+ async def update_companies_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
1742
1457
  """
1743
1458
 
1744
1459
  Updates multiple company records in a single request using the HubSpot CRM API.
@@ -1757,22 +1472,13 @@ class CrmApi(APISegmentBase):
1757
1472
  """
1758
1473
  request_body_data = None
1759
1474
  request_body_data = {"inputs": inputs}
1760
- request_body_data = {
1761
- k: v for k, v in request_body_data.items() if v is not None
1762
- }
1475
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1763
1476
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/batch/update"
1764
1477
  query_params = {}
1765
- response = self._post(
1766
- url,
1767
- data=request_body_data,
1768
- params=query_params,
1769
- content_type="application/json",
1770
- )
1478
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1771
1479
  return self._handle_response(response)
1772
1480
 
1773
- def delete_company_gdpr_data(
1774
- self, objectId: str, idProperty: str | None = None
1775
- ) -> Any:
1481
+ async def delete_company_gdpr_data(self, objectId: str, idProperty: str | None = None) -> Any:
1776
1482
  """
1777
1483
 
1778
1484
  Performs a GDPR-compliant deletion of a company record in the CRM, permanently removing the associated personal data.
@@ -1792,20 +1498,13 @@ class CrmApi(APISegmentBase):
1792
1498
  """
1793
1499
  request_body_data = None
1794
1500
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
1795
- request_body_data = {
1796
- k: v for k, v in request_body_data.items() if v is not None
1797
- }
1501
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1798
1502
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/gdpr-delete"
1799
1503
  query_params = {}
1800
- response = self._post(
1801
- url,
1802
- data=request_body_data,
1803
- params=query_params,
1804
- content_type="application/json",
1805
- )
1504
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1806
1505
  return self._handle_response(response)
1807
1506
 
1808
- def get_companies(
1507
+ async def get_companies(
1809
1508
  self,
1810
1509
  limit: int | None = None,
1811
1510
  after: str | None = None,
@@ -1851,9 +1550,7 @@ class CrmApi(APISegmentBase):
1851
1550
  response = self._get(url, params=query_params)
1852
1551
  return self._handle_response(response)
1853
1552
 
1854
- def create_company(
1855
- self, associations: list[dict[str, Any]], properties: dict[str, str]
1856
- ) -> dict[str, Any]:
1553
+ async def create_company(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
1857
1554
  """
1858
1555
 
1859
1556
  Creates a new company record in the CRM system using the provided JSON data and returns a 201 status code upon successful creation.
@@ -1873,27 +1570,14 @@ class CrmApi(APISegmentBase):
1873
1570
  """
1874
1571
  request_body_data = None
1875
1572
  request_body_data = {"associations": associations, "properties": properties}
1876
- request_body_data = {
1877
- k: v for k, v in request_body_data.items() if v is not None
1878
- }
1573
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1879
1574
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies"
1880
1575
  query_params = {}
1881
- response = self._post(
1882
- url,
1883
- data=request_body_data,
1884
- params=query_params,
1885
- content_type="application/json",
1886
- )
1576
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1887
1577
  return self._handle_response(response)
1888
1578
 
1889
- def search_companies_post(
1890
- self,
1891
- limit: int,
1892
- after: str,
1893
- sorts: list[str],
1894
- properties: list[str],
1895
- filterGroups: list[dict[str, Any]],
1896
- query: str | None = None,
1579
+ async def search_companies_post(
1580
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
1897
1581
  ) -> dict[str, Any]:
1898
1582
  """
1899
1583
 
@@ -1925,20 +1609,13 @@ class CrmApi(APISegmentBase):
1925
1609
  "properties": properties,
1926
1610
  "filterGroups": filterGroups,
1927
1611
  }
1928
- request_body_data = {
1929
- k: v for k, v in request_body_data.items() if v is not None
1930
- }
1612
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
1931
1613
  url = f"{self.main_app_client.base_url}/crm/v3/objects/companies/search"
1932
1614
  query_params = {}
1933
- response = self._post(
1934
- url,
1935
- data=request_body_data,
1936
- params=query_params,
1937
- content_type="application/json",
1938
- )
1615
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
1939
1616
  return self._handle_response(response)
1940
1617
 
1941
- def get_calling_app_settings(self, appId: str) -> dict[str, Any]:
1618
+ async def get_calling_app_settings(self, appId: str) -> dict[str, Any]:
1942
1619
  """
1943
1620
 
1944
1621
  Retrieves the calling settings for a specified application in HubSpot CRM using the provided app ID.
@@ -1962,7 +1639,7 @@ class CrmApi(APISegmentBase):
1962
1639
  response = self._get(url, params=query_params)
1963
1640
  return self._handle_response(response)
1964
1641
 
1965
- def update_calling_app_settings(
1642
+ async def update_calling_app_settings(
1966
1643
  self,
1967
1644
  appId: str,
1968
1645
  name: str,
@@ -2005,20 +1682,13 @@ class CrmApi(APISegmentBase):
2005
1682
  "url": url,
2006
1683
  "height": height,
2007
1684
  }
2008
- request_body_data = {
2009
- k: v for k, v in request_body_data.items() if v is not None
2010
- }
1685
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2011
1686
  url = f"{self.main_app_client.base_url}/crm/v3/extensions/calling/{appId}/settings"
2012
1687
  query_params = {}
2013
- response = self._post(
2014
- url,
2015
- data=request_body_data,
2016
- params=query_params,
2017
- content_type="application/json",
2018
- )
1688
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2019
1689
  return self._handle_response(response)
2020
1690
 
2021
- def delete_calling_app_settings_by_id(self, appId: str) -> Any:
1691
+ async def delete_calling_app_settings_by_id(self, appId: str) -> Any:
2022
1692
  """
2023
1693
 
2024
1694
  Deletes the settings for a specified CRM application identified by `{appId}`, returning a successful response with no content if the operation is completed.
@@ -2042,7 +1712,7 @@ class CrmApi(APISegmentBase):
2042
1712
  response = self._delete(url, params=query_params)
2043
1713
  return self._handle_response(response)
2044
1714
 
2045
- def update_calling_settings(
1715
+ async def update_calling_settings(
2046
1716
  self,
2047
1717
  appId: str,
2048
1718
  supportsCustomObjects: bool | None = None,
@@ -2085,15 +1755,13 @@ class CrmApi(APISegmentBase):
2085
1755
  "url": url,
2086
1756
  "height": height,
2087
1757
  }
2088
- request_body_data = {
2089
- k: v for k, v in request_body_data.items() if v is not None
2090
- }
1758
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2091
1759
  url = f"{self.main_app_client.base_url}/crm/v3/extensions/calling/{appId}/settings"
2092
1760
  query_params = {}
2093
1761
  response = self._patch(url, data=request_body_data, params=query_params)
2094
1762
  return self._handle_response(response)
2095
1763
 
2096
- def get_calling_app_recording_settings(self, appId: str) -> dict[str, Any]:
1764
+ async def get_calling_app_recording_settings(self, appId: str) -> dict[str, Any]:
2097
1765
  """
2098
1766
 
2099
1767
  Retrieves the recording settings for a calling extension with the specified `appId` in the HubSpot CRM.
@@ -2117,9 +1785,7 @@ class CrmApi(APISegmentBase):
2117
1785
  response = self._get(url, params=query_params)
2118
1786
  return self._handle_response(response)
2119
1787
 
2120
- def post_calling_app_recording_settings(
2121
- self, appId: str, urlToRetrieveAuthedRecording: str
2122
- ) -> dict[str, Any]:
1788
+ async def post_calling_app_recording_settings(self, appId: str, urlToRetrieveAuthedRecording: str) -> dict[str, Any]:
2123
1789
  """
2124
1790
 
2125
1791
  Configures call recording settings for a specific application ID in the CRM using a POST request to update the recording settings.
@@ -2140,25 +1806,14 @@ class CrmApi(APISegmentBase):
2140
1806
  if appId is None:
2141
1807
  raise ValueError("Missing required parameter 'appId'.")
2142
1808
  request_body_data = None
2143
- request_body_data = {
2144
- "urlToRetrieveAuthedRecording": urlToRetrieveAuthedRecording
2145
- }
2146
- request_body_data = {
2147
- k: v for k, v in request_body_data.items() if v is not None
2148
- }
1809
+ request_body_data = {"urlToRetrieveAuthedRecording": urlToRetrieveAuthedRecording}
1810
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2149
1811
  url = f"{self.main_app_client.base_url}/crm/v3/extensions/calling/{appId}/settings/recording"
2150
1812
  query_params = {}
2151
- response = self._post(
2152
- url,
2153
- data=request_body_data,
2154
- params=query_params,
2155
- content_type="application/json",
2156
- )
1813
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2157
1814
  return self._handle_response(response)
2158
1815
 
2159
- def update_recording_settings(
2160
- self, appId: str, urlToRetrieveAuthedRecording: str | None = None
2161
- ) -> dict[str, Any]:
1816
+ async def update_recording_settings(self, appId: str, urlToRetrieveAuthedRecording: str | None = None) -> dict[str, Any]:
2162
1817
  """
2163
1818
 
2164
1819
  Modifies the recording settings for a specific CRM application using the provided JSON body.
@@ -2179,18 +1834,14 @@ class CrmApi(APISegmentBase):
2179
1834
  if appId is None:
2180
1835
  raise ValueError("Missing required parameter 'appId'.")
2181
1836
  request_body_data = None
2182
- request_body_data = {
2183
- "urlToRetrieveAuthedRecording": urlToRetrieveAuthedRecording
2184
- }
2185
- request_body_data = {
2186
- k: v for k, v in request_body_data.items() if v is not None
2187
- }
1837
+ request_body_data = {"urlToRetrieveAuthedRecording": urlToRetrieveAuthedRecording}
1838
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2188
1839
  url = f"{self.main_app_client.base_url}/crm/v3/extensions/calling/{appId}/settings/recording"
2189
1840
  query_params = {}
2190
1841
  response = self._patch(url, data=request_body_data, params=query_params)
2191
1842
  return self._handle_response(response)
2192
1843
 
2193
- def read_quotes_batch(
1844
+ async def read_quotes_batch(
2194
1845
  self,
2195
1846
  propertiesWithHistory: list[str],
2196
1847
  inputs: list[dict[str, Any]],
@@ -2225,20 +1876,13 @@ class CrmApi(APISegmentBase):
2225
1876
  "inputs": inputs,
2226
1877
  "properties": properties,
2227
1878
  }
2228
- request_body_data = {
2229
- k: v for k, v in request_body_data.items() if v is not None
2230
- }
1879
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2231
1880
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/batch/read"
2232
1881
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
2233
- response = self._post(
2234
- url,
2235
- data=request_body_data,
2236
- params=query_params,
2237
- content_type="application/json",
2238
- )
1882
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2239
1883
  return self._handle_response(response)
2240
1884
 
2241
- def get_quote_by_id(
1885
+ async def get_quote_by_id(
2242
1886
  self,
2243
1887
  quoteId: str,
2244
1888
  properties: list[str] | None = None,
@@ -2285,7 +1929,7 @@ class CrmApi(APISegmentBase):
2285
1929
  response = self._get(url, params=query_params)
2286
1930
  return self._handle_response(response)
2287
1931
 
2288
- def delete_quote_by_id(self, quoteId: str) -> Any:
1932
+ async def delete_quote_by_id(self, quoteId: str) -> Any:
2289
1933
  """
2290
1934
 
2291
1935
  Deletes a sales quote with the specified ID using the HubSpot CRM API, requiring "crm.objects.quotes.write" permission.
@@ -2309,9 +1953,7 @@ class CrmApi(APISegmentBase):
2309
1953
  response = self._delete(url, params=query_params)
2310
1954
  return self._handle_response(response)
2311
1955
 
2312
- def update_quote(
2313
- self, quoteId: str, properties: dict[str, str], idProperty: str | None = None
2314
- ) -> dict[str, Any]:
1956
+ async def update_quote(self, quoteId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
2315
1957
  """
2316
1958
 
2317
1959
  Updates a quote object with the specified ID in the CRM system using partial modifications, requiring a JSON body with the changes and returning a status message upon success.
@@ -2334,17 +1976,13 @@ class CrmApi(APISegmentBase):
2334
1976
  raise ValueError("Missing required parameter 'quoteId'.")
2335
1977
  request_body_data = None
2336
1978
  request_body_data = {"properties": properties}
2337
- request_body_data = {
2338
- k: v for k, v in request_body_data.items() if v is not None
2339
- }
1979
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2340
1980
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/{quoteId}"
2341
1981
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
2342
1982
  response = self._patch(url, data=request_body_data, params=query_params)
2343
1983
  return self._handle_response(response)
2344
1984
 
2345
- def merge_quotes(
2346
- self, objectIdToMerge: str, primaryObjectId: str
2347
- ) -> dict[str, Any]:
1985
+ async def merge_quotes(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
2348
1986
  """
2349
1987
 
2350
1988
  Merges quote objects in a CRM system using the POST method, allowing for the integration of data from multiple quotes into a single unified quote.
@@ -2363,24 +2001,14 @@ class CrmApi(APISegmentBase):
2363
2001
  Public_Object
2364
2002
  """
2365
2003
  request_body_data = None
2366
- request_body_data = {
2367
- "objectIdToMerge": objectIdToMerge,
2368
- "primaryObjectId": primaryObjectId,
2369
- }
2370
- request_body_data = {
2371
- k: v for k, v in request_body_data.items() if v is not None
2372
- }
2004
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
2005
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2373
2006
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/merge"
2374
2007
  query_params = {}
2375
- response = self._post(
2376
- url,
2377
- data=request_body_data,
2378
- params=query_params,
2379
- content_type="application/json",
2380
- )
2008
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2381
2009
  return self._handle_response(response)
2382
2010
 
2383
- def archive_quotes_batch(self, inputs: list[dict[str, Any]]) -> Any:
2011
+ async def archive_quotes_batch(self, inputs: list[dict[str, Any]]) -> Any:
2384
2012
  """
2385
2013
 
2386
2014
  Archives a batch of quotes by sending a POST request to the "/crm/v3/objects/quotes/batch/archive" endpoint, requiring a JSON body and authentication via OAuth2 or private apps with the "crm.objects.quotes.write" permission.
@@ -2399,20 +2027,13 @@ class CrmApi(APISegmentBase):
2399
2027
  """
2400
2028
  request_body_data = None
2401
2029
  request_body_data = {"inputs": inputs}
2402
- request_body_data = {
2403
- k: v for k, v in request_body_data.items() if v is not None
2404
- }
2030
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2405
2031
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/batch/archive"
2406
2032
  query_params = {}
2407
- response = self._post(
2408
- url,
2409
- data=request_body_data,
2410
- params=query_params,
2411
- content_type="application/json",
2412
- )
2033
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2413
2034
  return self._handle_response(response)
2414
2035
 
2415
- def create_quote_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2036
+ async def create_quote_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2416
2037
  """
2417
2038
 
2418
2039
  Creates a batch of sales quotes using the HubSpot CRM API, requiring a JSON body and returning a status message upon successful creation.
@@ -2431,20 +2052,13 @@ class CrmApi(APISegmentBase):
2431
2052
  """
2432
2053
  request_body_data = None
2433
2054
  request_body_data = {"inputs": inputs}
2434
- request_body_data = {
2435
- k: v for k, v in request_body_data.items() if v is not None
2436
- }
2055
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2437
2056
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/batch/create"
2438
2057
  query_params = {}
2439
- response = self._post(
2440
- url,
2441
- data=request_body_data,
2442
- params=query_params,
2443
- content_type="application/json",
2444
- )
2058
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2445
2059
  return self._handle_response(response)
2446
2060
 
2447
- def update_quotes_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2061
+ async def update_quotes_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2448
2062
  """
2449
2063
 
2450
2064
  Updates a batch of quote objects in the CRM system using a single POST request, returning a status code indicating success or partial failure.
@@ -2463,22 +2077,13 @@ class CrmApi(APISegmentBase):
2463
2077
  """
2464
2078
  request_body_data = None
2465
2079
  request_body_data = {"inputs": inputs}
2466
- request_body_data = {
2467
- k: v for k, v in request_body_data.items() if v is not None
2468
- }
2080
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2469
2081
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/batch/update"
2470
2082
  query_params = {}
2471
- response = self._post(
2472
- url,
2473
- data=request_body_data,
2474
- params=query_params,
2475
- content_type="application/json",
2476
- )
2083
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2477
2084
  return self._handle_response(response)
2478
2085
 
2479
- def delete_quote_gdpr_data(
2480
- self, objectId: str, idProperty: str | None = None
2481
- ) -> Any:
2086
+ async def delete_quote_gdpr_data(self, objectId: str, idProperty: str | None = None) -> Any:
2482
2087
  """
2483
2088
 
2484
2089
  Performs a GDPR-compliant deletion of a quote object in the CRM system, permanently removing the associated personal data.
@@ -2498,20 +2103,13 @@ class CrmApi(APISegmentBase):
2498
2103
  """
2499
2104
  request_body_data = None
2500
2105
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
2501
- request_body_data = {
2502
- k: v for k, v in request_body_data.items() if v is not None
2503
- }
2106
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2504
2107
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/gdpr-delete"
2505
2108
  query_params = {}
2506
- response = self._post(
2507
- url,
2508
- data=request_body_data,
2509
- params=query_params,
2510
- content_type="application/json",
2511
- )
2109
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2512
2110
  return self._handle_response(response)
2513
2111
 
2514
- def get_quotes(
2112
+ async def get_quotes(
2515
2113
  self,
2516
2114
  limit: int | None = None,
2517
2115
  after: str | None = None,
@@ -2557,9 +2155,7 @@ class CrmApi(APISegmentBase):
2557
2155
  response = self._get(url, params=query_params)
2558
2156
  return self._handle_response(response)
2559
2157
 
2560
- def create_quote(
2561
- self, associations: list[dict[str, Any]], properties: dict[str, str]
2562
- ) -> dict[str, Any]:
2158
+ async def create_quote(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
2563
2159
  """
2564
2160
 
2565
2161
  Creates a new quote in HubSpot using the CRM API and returns a status message upon successful creation.
@@ -2579,27 +2175,14 @@ class CrmApi(APISegmentBase):
2579
2175
  """
2580
2176
  request_body_data = None
2581
2177
  request_body_data = {"associations": associations, "properties": properties}
2582
- request_body_data = {
2583
- k: v for k, v in request_body_data.items() if v is not None
2584
- }
2178
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2585
2179
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes"
2586
2180
  query_params = {}
2587
- response = self._post(
2588
- url,
2589
- data=request_body_data,
2590
- params=query_params,
2591
- content_type="application/json",
2592
- )
2181
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2593
2182
  return self._handle_response(response)
2594
2183
 
2595
- def search_quotes(
2596
- self,
2597
- limit: int,
2598
- after: str,
2599
- sorts: list[str],
2600
- properties: list[str],
2601
- filterGroups: list[dict[str, Any]],
2602
- query: str | None = None,
2184
+ async def search_quotes(
2185
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
2603
2186
  ) -> dict[str, Any]:
2604
2187
  """
2605
2188
 
@@ -2631,20 +2214,13 @@ class CrmApi(APISegmentBase):
2631
2214
  "properties": properties,
2632
2215
  "filterGroups": filterGroups,
2633
2216
  }
2634
- request_body_data = {
2635
- k: v for k, v in request_body_data.items() if v is not None
2636
- }
2217
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2637
2218
  url = f"{self.main_app_client.base_url}/crm/v3/objects/quotes/search"
2638
2219
  query_params = {}
2639
- response = self._post(
2640
- url,
2641
- data=request_body_data,
2642
- params=query_params,
2643
- content_type="application/json",
2644
- )
2220
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2645
2221
  return self._handle_response(response)
2646
2222
 
2647
- def batch_read_deals_post(
2223
+ async def batch_read_deals_post(
2648
2224
  self,
2649
2225
  propertiesWithHistory: list[str],
2650
2226
  inputs: list[dict[str, Any]],
@@ -2679,20 +2255,13 @@ class CrmApi(APISegmentBase):
2679
2255
  "inputs": inputs,
2680
2256
  "properties": properties,
2681
2257
  }
2682
- request_body_data = {
2683
- k: v for k, v in request_body_data.items() if v is not None
2684
- }
2258
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2685
2259
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/batch/read"
2686
2260
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
2687
- response = self._post(
2688
- url,
2689
- data=request_body_data,
2690
- params=query_params,
2691
- content_type="application/json",
2692
- )
2261
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2693
2262
  return self._handle_response(response)
2694
2263
 
2695
- def get_deal_by_id(
2264
+ async def get_deal_by_id(
2696
2265
  self,
2697
2266
  dealId: str,
2698
2267
  properties: list[str] | None = None,
@@ -2739,7 +2308,7 @@ class CrmApi(APISegmentBase):
2739
2308
  response = self._get(url, params=query_params)
2740
2309
  return self._handle_response(response)
2741
2310
 
2742
- def delete_deal_by_id(self, dealId: str) -> Any:
2311
+ async def delete_deal_by_id(self, dealId: str) -> Any:
2743
2312
  """
2744
2313
 
2745
2314
  Deletes a specific deal by its ID from the CRM system.
@@ -2763,9 +2332,7 @@ class CrmApi(APISegmentBase):
2763
2332
  response = self._delete(url, params=query_params)
2764
2333
  return self._handle_response(response)
2765
2334
 
2766
- def update_deal_by_id(
2767
- self, dealId: str, properties: dict[str, str], idProperty: str | None = None
2768
- ) -> dict[str, Any]:
2335
+ async def update_deal_by_id(self, dealId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
2769
2336
  """
2770
2337
 
2771
2338
  Updates an individual deal in the CRM by its record ID using the PATCH method.
@@ -2788,15 +2355,13 @@ class CrmApi(APISegmentBase):
2788
2355
  raise ValueError("Missing required parameter 'dealId'.")
2789
2356
  request_body_data = None
2790
2357
  request_body_data = {"properties": properties}
2791
- request_body_data = {
2792
- k: v for k, v in request_body_data.items() if v is not None
2793
- }
2358
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2794
2359
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/{dealId}"
2795
2360
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
2796
2361
  response = self._patch(url, data=request_body_data, params=query_params)
2797
2362
  return self._handle_response(response)
2798
2363
 
2799
- def merge_deals(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
2364
+ async def merge_deals(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
2800
2365
  """
2801
2366
 
2802
2367
  Merges two or more deal records into a single master deal record, consolidating data and deleting duplicates in the CRM system.
@@ -2815,24 +2380,14 @@ class CrmApi(APISegmentBase):
2815
2380
  Public_Object
2816
2381
  """
2817
2382
  request_body_data = None
2818
- request_body_data = {
2819
- "objectIdToMerge": objectIdToMerge,
2820
- "primaryObjectId": primaryObjectId,
2821
- }
2822
- request_body_data = {
2823
- k: v for k, v in request_body_data.items() if v is not None
2824
- }
2383
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
2384
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2825
2385
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/merge"
2826
2386
  query_params = {}
2827
- response = self._post(
2828
- url,
2829
- data=request_body_data,
2830
- params=query_params,
2831
- content_type="application/json",
2832
- )
2387
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2833
2388
  return self._handle_response(response)
2834
2389
 
2835
- def archive_deals_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
2390
+ async def archive_deals_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
2836
2391
  """
2837
2392
 
2838
2393
  Archives a batch of deal records in the CRM by their IDs using the POST method.
@@ -2851,20 +2406,13 @@ class CrmApi(APISegmentBase):
2851
2406
  """
2852
2407
  request_body_data = None
2853
2408
  request_body_data = {"inputs": inputs}
2854
- request_body_data = {
2855
- k: v for k, v in request_body_data.items() if v is not None
2856
- }
2409
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2857
2410
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/batch/archive"
2858
2411
  query_params = {}
2859
- response = self._post(
2860
- url,
2861
- data=request_body_data,
2862
- params=query_params,
2863
- content_type="application/json",
2864
- )
2412
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2865
2413
  return self._handle_response(response)
2866
2414
 
2867
- def create_deals_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2415
+ async def create_deals_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2868
2416
  """
2869
2417
 
2870
2418
  Creates multiple deals in a CRM using a batch operation via the POST method, requiring a JSON body with deal data and appropriate permissions for writing deals.
@@ -2883,20 +2431,13 @@ class CrmApi(APISegmentBase):
2883
2431
  """
2884
2432
  request_body_data = None
2885
2433
  request_body_data = {"inputs": inputs}
2886
- request_body_data = {
2887
- k: v for k, v in request_body_data.items() if v is not None
2888
- }
2434
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2889
2435
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/batch/create"
2890
2436
  query_params = {}
2891
- response = self._post(
2892
- url,
2893
- data=request_body_data,
2894
- params=query_params,
2895
- content_type="application/json",
2896
- )
2437
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2897
2438
  return self._handle_response(response)
2898
2439
 
2899
- def batch_update_deals(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2440
+ async def batch_update_deals(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
2900
2441
  """
2901
2442
 
2902
2443
  Updates multiple deals in HubSpot CRM in a single operation using a POST request to "/crm/v3/objects/deals/batch/update", requiring a JSON body with deal identifiers and updates, and supports OAuth2 and private app authentication for the "crm.objects.deals.write" scope.
@@ -2915,22 +2456,13 @@ class CrmApi(APISegmentBase):
2915
2456
  """
2916
2457
  request_body_data = None
2917
2458
  request_body_data = {"inputs": inputs}
2918
- request_body_data = {
2919
- k: v for k, v in request_body_data.items() if v is not None
2920
- }
2459
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2921
2460
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/batch/update"
2922
2461
  query_params = {}
2923
- response = self._post(
2924
- url,
2925
- data=request_body_data,
2926
- params=query_params,
2927
- content_type="application/json",
2928
- )
2462
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2929
2463
  return self._handle_response(response)
2930
2464
 
2931
- def post_deal_gdpr_delete(
2932
- self, objectId: str, idProperty: str | None = None
2933
- ) -> Any:
2465
+ async def post_deal_gdpr_delete(self, objectId: str, idProperty: str | None = None) -> Any:
2934
2466
  """
2935
2467
 
2936
2468
  Deletes a deal record in compliance with GDPR requirements using the provided JSON payload, requiring a valid OAuth2 or private app authentication with the necessary write permissions.
@@ -2950,20 +2482,13 @@ class CrmApi(APISegmentBase):
2950
2482
  """
2951
2483
  request_body_data = None
2952
2484
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
2953
- request_body_data = {
2954
- k: v for k, v in request_body_data.items() if v is not None
2955
- }
2485
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2956
2486
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/gdpr-delete"
2957
2487
  query_params = {}
2958
- response = self._post(
2959
- url,
2960
- data=request_body_data,
2961
- params=query_params,
2962
- content_type="application/json",
2963
- )
2488
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
2964
2489
  return self._handle_response(response)
2965
2490
 
2966
- def list_deals(
2491
+ async def list_deals(
2967
2492
  self,
2968
2493
  limit: int | None = None,
2969
2494
  after: str | None = None,
@@ -3009,9 +2534,7 @@ class CrmApi(APISegmentBase):
3009
2534
  response = self._get(url, params=query_params)
3010
2535
  return self._handle_response(response)
3011
2536
 
3012
- def create_deal(
3013
- self, associations: list[dict[str, Any]], properties: dict[str, str]
3014
- ) -> dict[str, Any]:
2537
+ async def create_deal(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
3015
2538
  """
3016
2539
 
3017
2540
  Creates a new deal object in the CRM using the HubSpot API, requiring a JSON payload and returning a status code indicating success.
@@ -3031,27 +2554,14 @@ class CrmApi(APISegmentBase):
3031
2554
  """
3032
2555
  request_body_data = None
3033
2556
  request_body_data = {"associations": associations, "properties": properties}
3034
- request_body_data = {
3035
- k: v for k, v in request_body_data.items() if v is not None
3036
- }
2557
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3037
2558
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals"
3038
2559
  query_params = {}
3039
- response = self._post(
3040
- url,
3041
- data=request_body_data,
3042
- params=query_params,
3043
- content_type="application/json",
3044
- )
2560
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3045
2561
  return self._handle_response(response)
3046
2562
 
3047
- def search_deals(
3048
- self,
3049
- limit: int,
3050
- after: str,
3051
- sorts: list[str],
3052
- properties: list[str],
3053
- filterGroups: list[dict[str, Any]],
3054
- query: str | None = None,
2563
+ async def search_deals(
2564
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
3055
2565
  ) -> dict[str, Any]:
3056
2566
  """
3057
2567
 
@@ -3083,20 +2593,13 @@ class CrmApi(APISegmentBase):
3083
2593
  "properties": properties,
3084
2594
  "filterGroups": filterGroups,
3085
2595
  }
3086
- request_body_data = {
3087
- k: v for k, v in request_body_data.items() if v is not None
3088
- }
2596
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3089
2597
  url = f"{self.main_app_client.base_url}/crm/v3/objects/deals/search"
3090
2598
  query_params = {}
3091
- response = self._post(
3092
- url,
3093
- data=request_body_data,
3094
- params=query_params,
3095
- content_type="application/json",
3096
- )
2599
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3097
2600
  return self._handle_response(response)
3098
2601
 
3099
- def cancel_import_by_id(self, importId: str) -> dict[str, Any]:
2602
+ async def cancel_import_by_id(self, importId: str) -> dict[str, Any]:
3100
2603
  """
3101
2604
 
3102
2605
  Cancels an active import operation in a CRM system using the provided import ID.
@@ -3118,15 +2621,10 @@ class CrmApi(APISegmentBase):
3118
2621
  request_body_data = None
3119
2622
  url = f"{self.main_app_client.base_url}/crm/v3/imports/{importId}/cancel"
3120
2623
  query_params = {}
3121
- response = self._post(
3122
- url,
3123
- data=request_body_data,
3124
- params=query_params,
3125
- content_type="application/json",
3126
- )
2624
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3127
2625
  return self._handle_response(response)
3128
2626
 
3129
- def get_import_by_id(self, importId: str) -> dict[str, Any]:
2627
+ async def get_import_by_id(self, importId: str) -> dict[str, Any]:
3130
2628
  """
3131
2629
 
3132
2630
  Retrieves the status and details of a specific CRM import operation identified by the import ID.
@@ -3150,9 +2648,7 @@ class CrmApi(APISegmentBase):
3150
2648
  response = self._get(url, params=query_params)
3151
2649
  return self._handle_response(response)
3152
2650
 
3153
- def get_import_errors_by_id(
3154
- self, importId: str, after: str | None = None, limit: int | None = None
3155
- ) -> dict[str, Any]:
2651
+ async def get_import_errors_by_id(self, importId: str, after: str | None = None, limit: int | None = None) -> dict[str, Any]:
3156
2652
  """
3157
2653
 
3158
2654
  Retrieves a list of errors associated with a specific CRM import operation, using the import ID, and allows filtering by optional parameters such as "after" and "limit".
@@ -3174,13 +2670,11 @@ class CrmApi(APISegmentBase):
3174
2670
  if importId is None:
3175
2671
  raise ValueError("Missing required parameter 'importId'.")
3176
2672
  url = f"{self.main_app_client.base_url}/crm/v3/imports/{importId}/errors"
3177
- query_params = {
3178
- k: v for k, v in [("after", after), ("limit", limit)] if v is not None
3179
- }
2673
+ query_params = {k: v for k, v in [("after", after), ("limit", limit)] if v is not None}
3180
2674
  response = self._get(url, params=query_params)
3181
2675
  return self._handle_response(response)
3182
2676
 
3183
- def get_schema_by_object_type(self, objectType: str) -> dict[str, Any]:
2677
+ async def get_schema_by_object_type(self, objectType: str) -> dict[str, Any]:
3184
2678
  """
3185
2679
 
3186
2680
  Retrieves the schema definition for a specified CRM object type, including its properties and metadata.
@@ -3204,9 +2698,7 @@ class CrmApi(APISegmentBase):
3204
2698
  response = self._get(url, params=query_params)
3205
2699
  return self._handle_response(response)
3206
2700
 
3207
- def delete_schema_by_type(
3208
- self, objectType: str, archived: bool | None = None
3209
- ) -> Any:
2701
+ async def delete_schema_by_type(self, objectType: str, archived: bool | None = None) -> Any:
3210
2702
  """
3211
2703
 
3212
2704
  Deletes the specified CRM object schema by its type, optionally including archived versions, to remove its definition from the system.
@@ -3231,7 +2723,7 @@ class CrmApi(APISegmentBase):
3231
2723
  response = self._delete(url, params=query_params)
3232
2724
  return self._handle_response(response)
3233
2725
 
3234
- def patch_crm_schema_by_object_type(
2726
+ async def patch_crm_schema_by_object_type(
3235
2727
  self,
3236
2728
  objectType: str,
3237
2729
  description: str | None = None,
@@ -3277,20 +2769,14 @@ class CrmApi(APISegmentBase):
3277
2769
  "restorable": restorable,
3278
2770
  "labels": labels,
3279
2771
  }
3280
- request_body_data = {
3281
- k: v for k, v in request_body_data.items() if v is not None
3282
- }
2772
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3283
2773
  url = f"{self.main_app_client.base_url}/crm/v3/schemas/{objectType}"
3284
2774
  query_params = {}
3285
2775
  response = self._patch(url, data=request_body_data, params=query_params)
3286
2776
  return self._handle_response(response)
3287
2777
 
3288
- def create_object_type_association(
3289
- self,
3290
- objectType: str,
3291
- fromObjectTypeId: str,
3292
- toObjectTypeId: str,
3293
- name: str | None = None,
2778
+ async def create_object_type_association(
2779
+ self, objectType: str, fromObjectTypeId: str, toObjectTypeId: str, name: str | None = None
3294
2780
  ) -> dict[str, Any]:
3295
2781
  """
3296
2782
 
@@ -3314,27 +2800,14 @@ class CrmApi(APISegmentBase):
3314
2800
  if objectType is None:
3315
2801
  raise ValueError("Missing required parameter 'objectType'.")
3316
2802
  request_body_data = None
3317
- request_body_data = {
3318
- "fromObjectTypeId": fromObjectTypeId,
3319
- "name": name,
3320
- "toObjectTypeId": toObjectTypeId,
3321
- }
3322
- request_body_data = {
3323
- k: v for k, v in request_body_data.items() if v is not None
3324
- }
3325
- url = (
3326
- f"{self.main_app_client.base_url}/crm/v3/schemas/{objectType}/associations"
3327
- )
2803
+ request_body_data = {"fromObjectTypeId": fromObjectTypeId, "name": name, "toObjectTypeId": toObjectTypeId}
2804
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
2805
+ url = f"{self.main_app_client.base_url}/crm/v3/schemas/{objectType}/associations"
3328
2806
  query_params = {}
3329
- response = self._post(
3330
- url,
3331
- data=request_body_data,
3332
- params=query_params,
3333
- content_type="application/json",
3334
- )
2807
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3335
2808
  return self._handle_response(response)
3336
2809
 
3337
- def delete_schema_object_type_purge(self, objectType: str) -> Any:
2810
+ async def delete_schema_object_type_purge(self, objectType: str) -> Any:
3338
2811
  """
3339
2812
 
3340
2813
  Purges a schema for a specific object type in the CRM system using the DELETE method, requiring the objectType as a path parameter and a custom write permission.
@@ -3358,9 +2831,7 @@ class CrmApi(APISegmentBase):
3358
2831
  response = self._delete(url, params=query_params)
3359
2832
  return self._handle_response(response)
3360
2833
 
3361
- def delete_association_by_object_type_id(
3362
- self, objectType: str, associationIdentifier: str
3363
- ) -> Any:
2834
+ async def delete_association_by_object_type_id(self, objectType: str, associationIdentifier: str) -> Any:
3364
2835
  """
3365
2836
 
3366
2837
  Removes an association identified by the associationIdentifier from a CRM object schema of the specified objectType using the HubSpot API.
@@ -3387,7 +2858,7 @@ class CrmApi(APISegmentBase):
3387
2858
  response = self._delete(url, params=query_params)
3388
2859
  return self._handle_response(response)
3389
2860
 
3390
- def list_schemas(self, archived: bool | None = None) -> dict[str, Any]:
2861
+ async def list_schemas(self, archived: bool | None = None) -> dict[str, Any]:
3391
2862
  """
3392
2863
 
3393
2864
  Retrieves a list of custom object schemas in the CRM, optionally filtering by archived status, using either legacy private apps or OAuth2 credentials for authentication.
@@ -3409,7 +2880,7 @@ class CrmApi(APISegmentBase):
3409
2880
  response = self._get(url, params=query_params)
3410
2881
  return self._handle_response(response)
3411
2882
 
3412
- def create_crm_schema(
2883
+ async def create_crm_schema(
3413
2884
  self,
3414
2885
  requiredProperties: list[str],
3415
2886
  name: str,
@@ -3457,22 +2928,13 @@ class CrmApi(APISegmentBase):
3457
2928
  "properties": properties,
3458
2929
  "labels": labels,
3459
2930
  }
3460
- request_body_data = {
3461
- k: v for k, v in request_body_data.items() if v is not None
3462
- }
2931
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3463
2932
  url = f"{self.main_app_client.base_url}/crm/v3/schemas"
3464
2933
  query_params = {}
3465
- response = self._post(
3466
- url,
3467
- data=request_body_data,
3468
- params=query_params,
3469
- content_type="application/json",
3470
- )
2934
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3471
2935
  return self._handle_response(response)
3472
2936
 
3473
- def archive_properties_batch_post(
3474
- self, objectType: str, inputs: list[dict[str, Any]]
3475
- ) -> Any:
2937
+ async def archive_properties_batch_post(self, objectType: str, inputs: list[dict[str, Any]]) -> Any:
3476
2938
  """
3477
2939
 
3478
2940
  Archives a batch of properties for a specified object type in CRM using a POST request.
@@ -3494,20 +2956,13 @@ class CrmApi(APISegmentBase):
3494
2956
  raise ValueError("Missing required parameter 'objectType'.")
3495
2957
  request_body_data = None
3496
2958
  request_body_data = {"inputs": inputs}
3497
- request_body_data = {
3498
- k: v for k, v in request_body_data.items() if v is not None
3499
- }
2959
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3500
2960
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/batch/archive"
3501
2961
  query_params = {}
3502
- response = self._post(
3503
- url,
3504
- data=request_body_data,
3505
- params=query_params,
3506
- content_type="application/json",
3507
- )
2962
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3508
2963
  return self._handle_response(response)
3509
2964
 
3510
- def get_property_group(self, objectType: str, groupName: str) -> dict[str, Any]:
2965
+ async def get_property_group(self, objectType: str, groupName: str) -> dict[str, Any]:
3511
2966
  """
3512
2967
 
3513
2968
  Retrieves details of a specified property group for a given CRM object type.
@@ -3534,7 +2989,7 @@ class CrmApi(APISegmentBase):
3534
2989
  response = self._get(url, params=query_params)
3535
2990
  return self._handle_response(response)
3536
2991
 
3537
- def remove_property_group(self, objectType: str, groupName: str) -> Any:
2992
+ async def remove_property_group(self, objectType: str, groupName: str) -> Any:
3538
2993
  """
3539
2994
 
3540
2995
  Deletes a property group identified by the given object type and group name from the CRM schema.
@@ -3561,12 +3016,8 @@ class CrmApi(APISegmentBase):
3561
3016
  response = self._delete(url, params=query_params)
3562
3017
  return self._handle_response(response)
3563
3018
 
3564
- def update_property_group_by_identifier(
3565
- self,
3566
- objectType: str,
3567
- groupName: str,
3568
- displayOrder: int | None = None,
3569
- label: str | None = None,
3019
+ async def update_property_group_by_identifier(
3020
+ self, objectType: str, groupName: str, displayOrder: int | None = None, label: str | None = None
3570
3021
  ) -> dict[str, Any]:
3571
3022
  """
3572
3023
 
@@ -3593,20 +3044,14 @@ class CrmApi(APISegmentBase):
3593
3044
  raise ValueError("Missing required parameter 'groupName'.")
3594
3045
  request_body_data = None
3595
3046
  request_body_data = {"displayOrder": displayOrder, "label": label}
3596
- request_body_data = {
3597
- k: v for k, v in request_body_data.items() if v is not None
3598
- }
3047
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3599
3048
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/groups/{groupName}"
3600
3049
  query_params = {}
3601
3050
  response = self._patch(url, data=request_body_data, params=query_params)
3602
3051
  return self._handle_response(response)
3603
3052
 
3604
- def get_crm_property(
3605
- self,
3606
- objectType: str,
3607
- propertyName: str,
3608
- archived: bool | None = None,
3609
- properties: str | None = None,
3053
+ async def get_crm_property(
3054
+ self, objectType: str, propertyName: str, archived: bool | None = None, properties: str | None = None
3610
3055
  ) -> dict[str, Any]:
3611
3056
  """
3612
3057
 
@@ -3632,15 +3077,11 @@ class CrmApi(APISegmentBase):
3632
3077
  if propertyName is None:
3633
3078
  raise ValueError("Missing required parameter 'propertyName'.")
3634
3079
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/{propertyName}"
3635
- query_params = {
3636
- k: v
3637
- for k, v in [("archived", archived), ("properties", properties)]
3638
- if v is not None
3639
- }
3080
+ query_params = {k: v for k, v in [("archived", archived), ("properties", properties)] if v is not None}
3640
3081
  response = self._get(url, params=query_params)
3641
3082
  return self._handle_response(response)
3642
3083
 
3643
- def delete_property_by_object_type(self, objectType: str, propertyName: str) -> Any:
3084
+ async def delete_property_by_object_type(self, objectType: str, propertyName: str) -> Any:
3644
3085
  """
3645
3086
 
3646
3087
  Deletes a specified property of a given object type in the CRM system.
@@ -3667,7 +3108,7 @@ class CrmApi(APISegmentBase):
3667
3108
  response = self._delete(url, params=query_params)
3668
3109
  return self._handle_response(response)
3669
3110
 
3670
- def patch_crm_property_by_name(
3111
+ async def patch_crm_property_by_name(
3671
3112
  self,
3672
3113
  objectType: str,
3673
3114
  propertyName: str,
@@ -3726,17 +3167,13 @@ class CrmApi(APISegmentBase):
3726
3167
  "fieldType": fieldType,
3727
3168
  "formField": formField,
3728
3169
  }
3729
- request_body_data = {
3730
- k: v for k, v in request_body_data.items() if v is not None
3731
- }
3170
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3732
3171
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/{propertyName}"
3733
3172
  query_params = {}
3734
3173
  response = self._patch(url, data=request_body_data, params=query_params)
3735
3174
  return self._handle_response(response)
3736
3175
 
3737
- def batch_read_properties_by_object_type(
3738
- self, objectType: str, archived: bool, inputs: list[dict[str, Any]]
3739
- ) -> dict[str, Any]:
3176
+ async def batch_read_properties_by_object_type(self, objectType: str, archived: bool, inputs: list[dict[str, Any]]) -> dict[str, Any]:
3740
3177
  """
3741
3178
 
3742
3179
  Performs a batch read operation on CRM properties for a specified object type using a POST request, returning the results in a batch format.
@@ -3759,24 +3196,13 @@ class CrmApi(APISegmentBase):
3759
3196
  raise ValueError("Missing required parameter 'objectType'.")
3760
3197
  request_body_data = None
3761
3198
  request_body_data = {"archived": archived, "inputs": inputs}
3762
- request_body_data = {
3763
- k: v for k, v in request_body_data.items() if v is not None
3764
- }
3765
- url = (
3766
- f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/batch/read"
3767
- )
3199
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3200
+ url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/batch/read"
3768
3201
  query_params = {}
3769
- response = self._post(
3770
- url,
3771
- data=request_body_data,
3772
- params=query_params,
3773
- content_type="application/json",
3774
- )
3202
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3775
3203
  return self._handle_response(response)
3776
3204
 
3777
- def create_batch_properties(
3778
- self, objectType: str, inputs: list[dict[str, Any]]
3779
- ) -> dict[str, Any]:
3205
+ async def create_batch_properties(self, objectType: str, inputs: list[dict[str, Any]]) -> dict[str, Any]:
3780
3206
  """
3781
3207
 
3782
3208
  Creates multiple properties in batches for a specified object type in the CRM using a POST request to the "/crm/v3/properties/{objectType}/batch/create" endpoint.
@@ -3798,24 +3224,14 @@ class CrmApi(APISegmentBase):
3798
3224
  raise ValueError("Missing required parameter 'objectType'.")
3799
3225
  request_body_data = None
3800
3226
  request_body_data = {"inputs": inputs}
3801
- request_body_data = {
3802
- k: v for k, v in request_body_data.items() if v is not None
3803
- }
3227
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3804
3228
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/batch/create"
3805
3229
  query_params = {}
3806
- response = self._post(
3807
- url,
3808
- data=request_body_data,
3809
- params=query_params,
3810
- content_type="application/json",
3811
- )
3230
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3812
3231
  return self._handle_response(response)
3813
3232
 
3814
- def get_properties_by_object_type(
3815
- self,
3816
- objectType: str,
3817
- archived: bool | None = None,
3818
- properties: str | None = None,
3233
+ async def get_properties_by_object_type(
3234
+ self, objectType: str, archived: bool | None = None, properties: str | None = None
3819
3235
  ) -> dict[str, Any]:
3820
3236
  """
3821
3237
 
@@ -3838,15 +3254,11 @@ class CrmApi(APISegmentBase):
3838
3254
  if objectType is None:
3839
3255
  raise ValueError("Missing required parameter 'objectType'.")
3840
3256
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}"
3841
- query_params = {
3842
- k: v
3843
- for k, v in [("archived", archived), ("properties", properties)]
3844
- if v is not None
3845
- }
3257
+ query_params = {k: v for k, v in [("archived", archived), ("properties", properties)] if v is not None}
3846
3258
  response = self._get(url, params=query_params)
3847
3259
  return self._handle_response(response)
3848
3260
 
3849
- def create_property_schema(
3261
+ async def create_property_schema(
3850
3262
  self,
3851
3263
  objectType: str,
3852
3264
  label: str,
@@ -3913,20 +3325,13 @@ class CrmApi(APISegmentBase):
3913
3325
  "fieldType": fieldType,
3914
3326
  "externalOptions": externalOptions,
3915
3327
  }
3916
- request_body_data = {
3917
- k: v for k, v in request_body_data.items() if v is not None
3918
- }
3328
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3919
3329
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}"
3920
3330
  query_params = {}
3921
- response = self._post(
3922
- url,
3923
- data=request_body_data,
3924
- params=query_params,
3925
- content_type="application/json",
3926
- )
3331
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3927
3332
  return self._handle_response(response)
3928
3333
 
3929
- def get_property_groups_by_object_type(self, objectType: str) -> dict[str, Any]:
3334
+ async def get_property_groups_by_object_type(self, objectType: str) -> dict[str, Any]:
3930
3335
  """
3931
3336
 
3932
3337
  Retrieves a list of groups for a specified object type in the CRM using the "GET" method at the path "/crm/v3/properties/{objectType}/groups".
@@ -3950,9 +3355,7 @@ class CrmApi(APISegmentBase):
3950
3355
  response = self._get(url, params=query_params)
3951
3356
  return self._handle_response(response)
3952
3357
 
3953
- def create_property_group(
3954
- self, objectType: str, name: str, label: str, displayOrder: int | None = None
3955
- ) -> dict[str, Any]:
3358
+ async def create_property_group(self, objectType: str, name: str, label: str, displayOrder: int | None = None) -> dict[str, Any]:
3956
3359
  """
3957
3360
 
3958
3361
  Creates a new property group for the specified CRM object type to organize related properties within HubSpot records.
@@ -3976,25 +3379,13 @@ class CrmApi(APISegmentBase):
3976
3379
  raise ValueError("Missing required parameter 'objectType'.")
3977
3380
  request_body_data = None
3978
3381
  request_body_data = {"name": name, "displayOrder": displayOrder, "label": label}
3979
- request_body_data = {
3980
- k: v for k, v in request_body_data.items() if v is not None
3981
- }
3382
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
3982
3383
  url = f"{self.main_app_client.base_url}/crm/v3/properties/{objectType}/groups"
3983
3384
  query_params = {}
3984
- response = self._post(
3985
- url,
3986
- data=request_body_data,
3987
- params=query_params,
3988
- content_type="application/json",
3989
- )
3385
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
3990
3386
  return self._handle_response(response)
3991
3387
 
3992
- def get_owner_by_id(
3993
- self,
3994
- ownerId: str,
3995
- idProperty: str | None = None,
3996
- archived: bool | None = None,
3997
- ) -> dict[str, Any]:
3388
+ async def get_owner_by_id(self, ownerId: str, idProperty: str | None = None, archived: bool | None = None) -> dict[str, Any]:
3998
3389
  """
3999
3390
 
4000
3391
  Retrieves detailed information about a specific CRM owner by their ID using the HubSpot API.
@@ -4016,17 +3407,11 @@ class CrmApi(APISegmentBase):
4016
3407
  if ownerId is None:
4017
3408
  raise ValueError("Missing required parameter 'ownerId'.")
4018
3409
  url = f"{self.main_app_client.base_url}/crm/v3/owners/{ownerId}"
4019
- query_params = {
4020
- k: v
4021
- for k, v in [("idProperty", idProperty), ("archived", archived)]
4022
- if v is not None
4023
- }
3410
+ query_params = {k: v for k, v in [("idProperty", idProperty), ("archived", archived)] if v is not None}
4024
3411
  response = self._get(url, params=query_params)
4025
3412
  return self._handle_response(response)
4026
3413
 
4027
- def batch_create_timeline_events(
4028
- self, inputs: list[dict[str, Any]]
4029
- ) -> dict[str, Any]:
3414
+ async def batch_create_timeline_events(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
4030
3415
  """
4031
3416
 
4032
3417
  Creates multiple timeline events in a batch using the provided event templates and returns a response with the created events.
@@ -4045,22 +3430,13 @@ class CrmApi(APISegmentBase):
4045
3430
  """
4046
3431
  request_body_data = None
4047
3432
  request_body_data = {"inputs": inputs}
4048
- request_body_data = {
4049
- k: v for k, v in request_body_data.items() if v is not None
4050
- }
3433
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4051
3434
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/events/batch/create"
4052
3435
  query_params = {}
4053
- response = self._post(
4054
- url,
4055
- data=request_body_data,
4056
- params=query_params,
4057
- content_type="application/json",
4058
- )
3436
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4059
3437
  return self._handle_response(response)
4060
3438
 
4061
- def get_timeline_event_template_by_id(
4062
- self, appId: str, eventTemplateId: str
4063
- ) -> dict[str, Any]:
3439
+ async def get_timeline_event_template_by_id(self, appId: str, eventTemplateId: str) -> dict[str, Any]:
4064
3440
  """
4065
3441
 
4066
3442
  Retrieves a specific event template by its ID for an application in HubSpot CRM, using the provided app ID and event template ID.
@@ -4087,7 +3463,7 @@ class CrmApi(APISegmentBase):
4087
3463
  response = self._get(url, params=query_params)
4088
3464
  return self._handle_response(response)
4089
3465
 
4090
- def update_timeline_event_template_by_id(
3466
+ async def update_timeline_event_template_by_id(
4091
3467
  self,
4092
3468
  appId: str,
4093
3469
  eventTemplateId: str,
@@ -4131,27 +3507,14 @@ class CrmApi(APISegmentBase):
4131
3507
  if eventTemplateId is None:
4132
3508
  raise ValueError("Missing required parameter 'eventTemplateId'.")
4133
3509
  request_body_data = None
4134
- request_body_data = {
4135
- "detailTemplate": detailTemplate,
4136
- "name": name,
4137
- "tokens": tokens,
4138
- "id": id,
4139
- "headerTemplate": headerTemplate,
4140
- }
4141
- request_body_data = {
4142
- k: v for k, v in request_body_data.items() if v is not None
4143
- }
3510
+ request_body_data = {"detailTemplate": detailTemplate, "name": name, "tokens": tokens, "id": id, "headerTemplate": headerTemplate}
3511
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4144
3512
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}"
4145
3513
  query_params = {}
4146
- response = self._put(
4147
- url,
4148
- data=request_body_data,
4149
- params=query_params,
4150
- content_type="application/json",
4151
- )
3514
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
4152
3515
  return self._handle_response(response)
4153
3516
 
4154
- def delete_event_template_by_id(self, appId: str, eventTemplateId: str) -> Any:
3517
+ async def delete_event_template_by_id(self, appId: str, eventTemplateId: str) -> Any:
4155
3518
  """
4156
3519
 
4157
3520
  Deletes an event template with the specified `eventTemplateId` associated with the application identified by `appId` in a CRM system, returning a successful response with no content upon completion.
@@ -4178,7 +3541,7 @@ class CrmApi(APISegmentBase):
4178
3541
  response = self._delete(url, params=query_params)
4179
3542
  return self._handle_response(response)
4180
3543
 
4181
- def create_event(
3544
+ async def create_event(
4182
3545
  self,
4183
3546
  eventTemplateId: str,
4184
3547
  tokens: dict[str, str],
@@ -4229,20 +3592,13 @@ class CrmApi(APISegmentBase):
4229
3592
  "objectId": objectId,
4230
3593
  "timestamp": timestamp,
4231
3594
  }
4232
- request_body_data = {
4233
- k: v for k, v in request_body_data.items() if v is not None
4234
- }
3595
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4235
3596
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/events"
4236
3597
  query_params = {}
4237
- response = self._post(
4238
- url,
4239
- data=request_body_data,
4240
- params=query_params,
4241
- content_type="application/json",
4242
- )
3598
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4243
3599
  return self._handle_response(response)
4244
3600
 
4245
- def create_token_template(
3601
+ async def create_token_template(
4246
3602
  self,
4247
3603
  appId: str,
4248
3604
  eventTemplateId: str,
@@ -4292,20 +3648,13 @@ class CrmApi(APISegmentBase):
4292
3648
  "type": type,
4293
3649
  "updatedAt": updatedAt,
4294
3650
  }
4295
- request_body_data = {
4296
- k: v for k, v in request_body_data.items() if v is not None
4297
- }
3651
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4298
3652
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}/tokens"
4299
3653
  query_params = {}
4300
- response = self._post(
4301
- url,
4302
- data=request_body_data,
4303
- params=query_params,
4304
- content_type="application/json",
4305
- )
3654
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4306
3655
  return self._handle_response(response)
4307
3656
 
4308
- def update_event_template_token(
3657
+ async def update_event_template_token(
4309
3658
  self,
4310
3659
  appId: str,
4311
3660
  eventTemplateId: str,
@@ -4342,27 +3691,14 @@ class CrmApi(APISegmentBase):
4342
3691
  if tokenName is None:
4343
3692
  raise ValueError("Missing required parameter 'tokenName'.")
4344
3693
  request_body_data = None
4345
- request_body_data = {
4346
- "options": options,
4347
- "label": label,
4348
- "objectPropertyName": objectPropertyName,
4349
- }
4350
- request_body_data = {
4351
- k: v for k, v in request_body_data.items() if v is not None
4352
- }
3694
+ request_body_data = {"options": options, "label": label, "objectPropertyName": objectPropertyName}
3695
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4353
3696
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}"
4354
3697
  query_params = {}
4355
- response = self._put(
4356
- url,
4357
- data=request_body_data,
4358
- params=query_params,
4359
- content_type="application/json",
4360
- )
3698
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
4361
3699
  return self._handle_response(response)
4362
3700
 
4363
- def delete_timeline_event_template_token(
4364
- self, appId: str, eventTemplateId: str, tokenName: str
4365
- ) -> Any:
3701
+ async def delete_timeline_event_template_token(self, appId: str, eventTemplateId: str, tokenName: str) -> Any:
4366
3702
  """
4367
3703
 
4368
3704
  Deletes a token by the specified name from an event template in the CRM timeline for a given application ID.
@@ -4392,9 +3728,7 @@ class CrmApi(APISegmentBase):
4392
3728
  response = self._delete(url, params=query_params)
4393
3729
  return self._handle_response(response)
4394
3730
 
4395
- def get_timeline_event_detail_by_id(
4396
- self, eventTemplateId: str, eventId: str
4397
- ) -> dict[str, Any]:
3731
+ async def get_timeline_event_detail_by_id(self, eventTemplateId: str, eventId: str) -> dict[str, Any]:
4398
3732
  """
4399
3733
 
4400
3734
  Retrieves detailed information for a specific timeline event identified by its event template ID and event ID in the CRM.
@@ -4421,9 +3755,7 @@ class CrmApi(APISegmentBase):
4421
3755
  response = self._get(url, params=query_params)
4422
3756
  return self._handle_response(response)
4423
3757
 
4424
- def get_timeline_event_by_id(
4425
- self, eventTemplateId: str, eventId: str
4426
- ) -> dict[str, Any]:
3758
+ async def get_timeline_event_by_id(self, eventTemplateId: str, eventId: str) -> dict[str, Any]:
4427
3759
  """
4428
3760
 
4429
3761
  Retrieves a specific timeline event by its event template ID and event ID, returning detailed information about that event in the CRM.
@@ -4450,7 +3782,7 @@ class CrmApi(APISegmentBase):
4450
3782
  response = self._get(url, params=query_params)
4451
3783
  return self._handle_response(response)
4452
3784
 
4453
- def get_timeline_event_templates_by_app_id(self, appId: str) -> dict[str, Any]:
3785
+ async def get_timeline_event_templates_by_app_id(self, appId: str) -> dict[str, Any]:
4454
3786
  """
4455
3787
 
4456
3788
  Retrieves a list of event templates for a specified app ID in the HubSpot CRM API.
@@ -4474,7 +3806,7 @@ class CrmApi(APISegmentBase):
4474
3806
  response = self._get(url, params=query_params)
4475
3807
  return self._handle_response(response)
4476
3808
 
4477
- def create_timeline_event_template(
3809
+ async def create_timeline_event_template(
4478
3810
  self,
4479
3811
  appId: str,
4480
3812
  name: str,
@@ -4519,22 +3851,13 @@ class CrmApi(APISegmentBase):
4519
3851
  "headerTemplate": headerTemplate,
4520
3852
  "objectType": objectType,
4521
3853
  }
4522
- request_body_data = {
4523
- k: v for k, v in request_body_data.items() if v is not None
4524
- }
3854
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4525
3855
  url = f"{self.main_app_client.base_url}/crm/v3/timeline/{appId}/event-templates"
4526
3856
  query_params = {}
4527
- response = self._post(
4528
- url,
4529
- data=request_body_data,
4530
- params=query_params,
4531
- content_type="application/json",
4532
- )
3857
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4533
3858
  return self._handle_response(response)
4534
3859
 
4535
- def get_timeline_event_render(
4536
- self, eventTemplateId: str, eventId: str, detail: bool | None = None
4537
- ) -> Any:
3860
+ async def get_timeline_event_render(self, eventTemplateId: str, eventId: str, detail: bool | None = None) -> Any:
4538
3861
  """
4539
3862
 
4540
3863
  Retrieves and renders a specific timeline event from a CRM object using an event template and event ID, allowing for optional detailed rendering.
@@ -4562,7 +3885,7 @@ class CrmApi(APISegmentBase):
4562
3885
  response = self._get(url, params=query_params)
4563
3886
  return self._handle_response(response)
4564
3887
 
4565
- def batch_read_contacts_post(
3888
+ async def batch_read_contacts_post(
4566
3889
  self,
4567
3890
  propertiesWithHistory: list[str],
4568
3891
  inputs: list[dict[str, Any]],
@@ -4597,20 +3920,13 @@ class CrmApi(APISegmentBase):
4597
3920
  "inputs": inputs,
4598
3921
  "properties": properties,
4599
3922
  }
4600
- request_body_data = {
4601
- k: v for k, v in request_body_data.items() if v is not None
4602
- }
3923
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4603
3924
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/batch/read"
4604
3925
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
4605
- response = self._post(
4606
- url,
4607
- data=request_body_data,
4608
- params=query_params,
4609
- content_type="application/json",
4610
- )
3926
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4611
3927
  return self._handle_response(response)
4612
3928
 
4613
- def get_contact_by_id(
3929
+ async def get_contact_by_id(
4614
3930
  self,
4615
3931
  contactId: str,
4616
3932
  properties: list[str] | None = None,
@@ -4654,7 +3970,7 @@ class CrmApi(APISegmentBase):
4654
3970
  response = self._get(url, params=query_params)
4655
3971
  return self._handle_response(response)
4656
3972
 
4657
- def delete_contact_by_id(self, contactId: str) -> Any:
3973
+ async def delete_contact_by_id(self, contactId: str) -> Any:
4658
3974
  """
4659
3975
 
4660
3976
  Deletes a contact by its ID from the CRM system, permanently removing all associated content in compliance with GDPR, and requires the "crm.objects.contacts.write" permission.
@@ -4678,9 +3994,7 @@ class CrmApi(APISegmentBase):
4678
3994
  response = self._delete(url, params=query_params)
4679
3995
  return self._handle_response(response)
4680
3996
 
4681
- def update_contact_by_id(
4682
- self, contactId: str, properties: dict[str, str]
4683
- ) -> dict[str, Any]:
3997
+ async def update_contact_by_id(self, contactId: str, properties: dict[str, str]) -> dict[str, Any]:
4684
3998
  """
4685
3999
 
4686
4000
  Updates an individual contact by its record ID using a PATCH request to the "/crm/v3/objects/contacts/{contactId}" endpoint, requiring a JSON body with the fields to be updated.
@@ -4702,17 +4016,13 @@ class CrmApi(APISegmentBase):
4702
4016
  raise ValueError("Missing required parameter 'contactId'.")
4703
4017
  request_body_data = None
4704
4018
  request_body_data = {"properties": properties}
4705
- request_body_data = {
4706
- k: v for k, v in request_body_data.items() if v is not None
4707
- }
4019
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4708
4020
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/{contactId}"
4709
4021
  query_params = {}
4710
4022
  response = self._patch(url, data=request_body_data, params=query_params)
4711
4023
  return self._handle_response(response)
4712
4024
 
4713
- def merge_contacts(
4714
- self, objectIdToMerge: str, primaryObjectId: str
4715
- ) -> dict[str, Any]:
4025
+ async def merge_contacts(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
4716
4026
  """
4717
4027
 
4718
4028
  Merges two or more duplicate contact records into a single record in the CRM system, retaining the most relevant data while discarding redundant information.
@@ -4731,24 +4041,14 @@ class CrmApi(APISegmentBase):
4731
4041
  Public_Object
4732
4042
  """
4733
4043
  request_body_data = None
4734
- request_body_data = {
4735
- "objectIdToMerge": objectIdToMerge,
4736
- "primaryObjectId": primaryObjectId,
4737
- }
4738
- request_body_data = {
4739
- k: v for k, v in request_body_data.items() if v is not None
4740
- }
4044
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
4045
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4741
4046
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/merge"
4742
4047
  query_params = {}
4743
- response = self._post(
4744
- url,
4745
- data=request_body_data,
4746
- params=query_params,
4747
- content_type="application/json",
4748
- )
4048
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4749
4049
  return self._handle_response(response)
4750
4050
 
4751
- def archive_contacts_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
4051
+ async def archive_contacts_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
4752
4052
  """
4753
4053
 
4754
4054
  Archives a batch of contacts by ID using the HubSpot CRM API, returning a "204 No Content" response upon success.
@@ -4767,20 +4067,13 @@ class CrmApi(APISegmentBase):
4767
4067
  """
4768
4068
  request_body_data = None
4769
4069
  request_body_data = {"inputs": inputs}
4770
- request_body_data = {
4771
- k: v for k, v in request_body_data.items() if v is not None
4772
- }
4070
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4773
4071
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/batch/archive"
4774
4072
  query_params = {}
4775
- response = self._post(
4776
- url,
4777
- data=request_body_data,
4778
- params=query_params,
4779
- content_type="application/json",
4780
- )
4073
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4781
4074
  return self._handle_response(response)
4782
4075
 
4783
- def create_contacts_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
4076
+ async def create_contacts_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
4784
4077
  """
4785
4078
 
4786
4079
  Creates a batch of contacts in HubSpot using the CRM API, requiring a JSON payload and OAuth2 or private app authentication.
@@ -4799,20 +4092,13 @@ class CrmApi(APISegmentBase):
4799
4092
  """
4800
4093
  request_body_data = None
4801
4094
  request_body_data = {"inputs": inputs}
4802
- request_body_data = {
4803
- k: v for k, v in request_body_data.items() if v is not None
4804
- }
4095
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4805
4096
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/batch/create"
4806
4097
  query_params = {}
4807
- response = self._post(
4808
- url,
4809
- data=request_body_data,
4810
- params=query_params,
4811
- content_type="application/json",
4812
- )
4098
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4813
4099
  return self._handle_response(response)
4814
4100
 
4815
- def batch_update_contacts(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
4101
+ async def batch_update_contacts(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
4816
4102
  """
4817
4103
 
4818
4104
  Updates multiple contact records in a single request by providing their IDs or unique property values, overwriting specified properties in batch.
@@ -4831,22 +4117,13 @@ class CrmApi(APISegmentBase):
4831
4117
  """
4832
4118
  request_body_data = None
4833
4119
  request_body_data = {"inputs": inputs}
4834
- request_body_data = {
4835
- k: v for k, v in request_body_data.items() if v is not None
4836
- }
4120
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4837
4121
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/batch/update"
4838
4122
  query_params = {}
4839
- response = self._post(
4840
- url,
4841
- data=request_body_data,
4842
- params=query_params,
4843
- content_type="application/json",
4844
- )
4123
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4845
4124
  return self._handle_response(response)
4846
4125
 
4847
- def delete_contact_gdpr_data(
4848
- self, objectId: str, idProperty: str | None = None
4849
- ) -> Any:
4126
+ async def delete_contact_gdpr_data(self, objectId: str, idProperty: str | None = None) -> Any:
4850
4127
  """
4851
4128
 
4852
4129
  Permanently deletes a contact and all associated data from the CRM to comply with GDPR requirements.
@@ -4866,20 +4143,13 @@ class CrmApi(APISegmentBase):
4866
4143
  """
4867
4144
  request_body_data = None
4868
4145
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
4869
- request_body_data = {
4870
- k: v for k, v in request_body_data.items() if v is not None
4871
- }
4146
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4872
4147
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/gdpr-delete"
4873
4148
  query_params = {}
4874
- response = self._post(
4875
- url,
4876
- data=request_body_data,
4877
- params=query_params,
4878
- content_type="application/json",
4879
- )
4149
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4880
4150
  return self._handle_response(response)
4881
4151
 
4882
- def get_contacts(
4152
+ async def get_contacts(
4883
4153
  self,
4884
4154
  limit: int | None = None,
4885
4155
  after: str | None = None,
@@ -4925,9 +4195,7 @@ class CrmApi(APISegmentBase):
4925
4195
  response = self._get(url, params=query_params)
4926
4196
  return self._handle_response(response)
4927
4197
 
4928
- def create_contact(
4929
- self, associations: list[dict[str, Any]], properties: dict[str, str]
4930
- ) -> dict[str, Any]:
4198
+ async def create_contact(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
4931
4199
  """
4932
4200
 
4933
4201
  Creates a new contact in the CRM system using the provided JSON data and returns a successful creation response.
@@ -4947,27 +4215,14 @@ class CrmApi(APISegmentBase):
4947
4215
  """
4948
4216
  request_body_data = None
4949
4217
  request_body_data = {"associations": associations, "properties": properties}
4950
- request_body_data = {
4951
- k: v for k, v in request_body_data.items() if v is not None
4952
- }
4218
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4953
4219
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts"
4954
4220
  query_params = {}
4955
- response = self._post(
4956
- url,
4957
- data=request_body_data,
4958
- params=query_params,
4959
- content_type="application/json",
4960
- )
4221
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
4961
4222
  return self._handle_response(response)
4962
4223
 
4963
- def search_contacts_post(
4964
- self,
4965
- limit: int,
4966
- after: str,
4967
- sorts: list[str],
4968
- properties: list[str],
4969
- filterGroups: list[dict[str, Any]],
4970
- query: str | None = None,
4224
+ async def search_contacts_post(
4225
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
4971
4226
  ) -> dict[str, Any]:
4972
4227
  """
4973
4228
 
@@ -4999,20 +4254,13 @@ class CrmApi(APISegmentBase):
4999
4254
  "properties": properties,
5000
4255
  "filterGroups": filterGroups,
5001
4256
  }
5002
- request_body_data = {
5003
- k: v for k, v in request_body_data.items() if v is not None
5004
- }
4257
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5005
4258
  url = f"{self.main_app_client.base_url}/crm/v3/objects/contacts/search"
5006
4259
  query_params = {}
5007
- response = self._post(
5008
- url,
5009
- data=request_body_data,
5010
- params=query_params,
5011
- content_type="application/json",
5012
- )
4260
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5013
4261
  return self._handle_response(response)
5014
4262
 
5015
- def batch_read_feedback_submissions(
4263
+ async def batch_read_feedback_submissions(
5016
4264
  self,
5017
4265
  propertiesWithHistory: list[str],
5018
4266
  inputs: list[dict[str, Any]],
@@ -5047,20 +4295,13 @@ class CrmApi(APISegmentBase):
5047
4295
  "inputs": inputs,
5048
4296
  "properties": properties,
5049
4297
  }
5050
- request_body_data = {
5051
- k: v for k, v in request_body_data.items() if v is not None
5052
- }
4298
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5053
4299
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/batch/read"
5054
4300
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
5055
- response = self._post(
5056
- url,
5057
- data=request_body_data,
5058
- params=query_params,
5059
- content_type="application/json",
5060
- )
4301
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5061
4302
  return self._handle_response(response)
5062
4303
 
5063
- def get_feedback_submission_by_id(
4304
+ async def get_feedback_submission_by_id(
5064
4305
  self,
5065
4306
  feedbackSubmissionId: str,
5066
4307
  properties: list[str] | None = None,
@@ -5107,7 +4348,7 @@ class CrmApi(APISegmentBase):
5107
4348
  response = self._get(url, params=query_params)
5108
4349
  return self._handle_response(response)
5109
4350
 
5110
- def delete_feedback_submission_by_id(self, feedbackSubmissionId: str) -> Any:
4351
+ async def delete_feedback_submission_by_id(self, feedbackSubmissionId: str) -> Any:
5111
4352
  """
5112
4353
 
5113
4354
  Deletes a specific feedback submission identified by the provided `feedbackSubmissionId` from the CRM system.
@@ -5131,11 +4372,8 @@ class CrmApi(APISegmentBase):
5131
4372
  response = self._delete(url, params=query_params)
5132
4373
  return self._handle_response(response)
5133
4374
 
5134
- def patch_feedback_submission_by_id(
5135
- self,
5136
- feedbackSubmissionId: str,
5137
- properties: dict[str, str],
5138
- idProperty: str | None = None,
4375
+ async def patch_feedback_submission_by_id(
4376
+ self, feedbackSubmissionId: str, properties: dict[str, str], idProperty: str | None = None
5139
4377
  ) -> dict[str, Any]:
5140
4378
  """
5141
4379
 
@@ -5159,17 +4397,13 @@ class CrmApi(APISegmentBase):
5159
4397
  raise ValueError("Missing required parameter 'feedbackSubmissionId'.")
5160
4398
  request_body_data = None
5161
4399
  request_body_data = {"properties": properties}
5162
- request_body_data = {
5163
- k: v for k, v in request_body_data.items() if v is not None
5164
- }
4400
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5165
4401
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/{feedbackSubmissionId}"
5166
4402
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
5167
4403
  response = self._patch(url, data=request_body_data, params=query_params)
5168
4404
  return self._handle_response(response)
5169
4405
 
5170
- def merge_feedback_submissions(
5171
- self, objectIdToMerge: str, primaryObjectId: str
5172
- ) -> dict[str, Any]:
4406
+ async def merge_feedback_submissions(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
5173
4407
  """
5174
4408
 
5175
4409
  Merges feedback submission records using the POST method, requiring a JSON body and supporting OAuth2 and private apps for authentication.
@@ -5188,26 +4422,14 @@ class CrmApi(APISegmentBase):
5188
4422
  Public_Object
5189
4423
  """
5190
4424
  request_body_data = None
5191
- request_body_data = {
5192
- "objectIdToMerge": objectIdToMerge,
5193
- "primaryObjectId": primaryObjectId,
5194
- }
5195
- request_body_data = {
5196
- k: v for k, v in request_body_data.items() if v is not None
5197
- }
5198
- url = (
5199
- f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/merge"
5200
- )
4425
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
4426
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4427
+ url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/merge"
5201
4428
  query_params = {}
5202
- response = self._post(
5203
- url,
5204
- data=request_body_data,
5205
- params=query_params,
5206
- content_type="application/json",
5207
- )
4429
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5208
4430
  return self._handle_response(response)
5209
4431
 
5210
- def archive_feedback_submissions_batch(self, inputs: list[dict[str, Any]]) -> Any:
4432
+ async def archive_feedback_submissions_batch(self, inputs: list[dict[str, Any]]) -> Any:
5211
4433
  """
5212
4434
 
5213
4435
  Archives a batch of feedback submissions by ID using the HubSpot API and returns a status response with a 204 status code upon successful completion.
@@ -5226,22 +4448,13 @@ class CrmApi(APISegmentBase):
5226
4448
  """
5227
4449
  request_body_data = None
5228
4450
  request_body_data = {"inputs": inputs}
5229
- request_body_data = {
5230
- k: v for k, v in request_body_data.items() if v is not None
5231
- }
4451
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5232
4452
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/batch/archive"
5233
4453
  query_params = {}
5234
- response = self._post(
5235
- url,
5236
- data=request_body_data,
5237
- params=query_params,
5238
- content_type="application/json",
5239
- )
4454
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5240
4455
  return self._handle_response(response)
5241
4456
 
5242
- def create_feedback_submissions_batch(
5243
- self, inputs: list[dict[str, Any]]
5244
- ) -> dict[str, Any]:
4457
+ async def create_feedback_submissions_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5245
4458
  """
5246
4459
 
5247
4460
  Creates a batch of feedback submissions using the HubSpot API, allowing for the simultaneous creation of multiple feedback submissions.
@@ -5260,22 +4473,13 @@ class CrmApi(APISegmentBase):
5260
4473
  """
5261
4474
  request_body_data = None
5262
4475
  request_body_data = {"inputs": inputs}
5263
- request_body_data = {
5264
- k: v for k, v in request_body_data.items() if v is not None
5265
- }
4476
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5266
4477
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/batch/create"
5267
4478
  query_params = {}
5268
- response = self._post(
5269
- url,
5270
- data=request_body_data,
5271
- params=query_params,
5272
- content_type="application/json",
5273
- )
4479
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5274
4480
  return self._handle_response(response)
5275
4481
 
5276
- def update_feedback_submissions_batch(
5277
- self, inputs: list[dict[str, Any]]
5278
- ) -> dict[str, Any]:
4482
+ async def update_feedback_submissions_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5279
4483
  """
5280
4484
 
5281
4485
  Updates multiple feedback submissions in batches using the HubSpot CRM API.
@@ -5294,22 +4498,13 @@ class CrmApi(APISegmentBase):
5294
4498
  """
5295
4499
  request_body_data = None
5296
4500
  request_body_data = {"inputs": inputs}
5297
- request_body_data = {
5298
- k: v for k, v in request_body_data.items() if v is not None
5299
- }
4501
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5300
4502
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/batch/update"
5301
4503
  query_params = {}
5302
- response = self._post(
5303
- url,
5304
- data=request_body_data,
5305
- params=query_params,
5306
- content_type="application/json",
5307
- )
4504
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5308
4505
  return self._handle_response(response)
5309
4506
 
5310
- def post_feedback_submissions_gdpr_delete(
5311
- self, objectId: str, idProperty: str | None = None
5312
- ) -> Any:
4507
+ async def post_feedback_submissions_gdpr_delete(self, objectId: str, idProperty: str | None = None) -> Any:
5313
4508
  """
5314
4509
 
5315
4510
  Permanently deletes feedback submissions and associated data to comply with GDPR regulations using the provided JSON body.
@@ -5329,20 +4524,13 @@ class CrmApi(APISegmentBase):
5329
4524
  """
5330
4525
  request_body_data = None
5331
4526
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
5332
- request_body_data = {
5333
- k: v for k, v in request_body_data.items() if v is not None
5334
- }
4527
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5335
4528
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/gdpr-delete"
5336
4529
  query_params = {}
5337
- response = self._post(
5338
- url,
5339
- data=request_body_data,
5340
- params=query_params,
5341
- content_type="application/json",
5342
- )
4530
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5343
4531
  return self._handle_response(response)
5344
4532
 
5345
- def get_feedback_submissions(
4533
+ async def get_feedback_submissions(
5346
4534
  self,
5347
4535
  limit: int | None = None,
5348
4536
  after: str | None = None,
@@ -5388,9 +4576,7 @@ class CrmApi(APISegmentBase):
5388
4576
  response = self._get(url, params=query_params)
5389
4577
  return self._handle_response(response)
5390
4578
 
5391
- def create_feedback_submission(
5392
- self, associations: list[dict[str, Any]], properties: dict[str, str]
5393
- ) -> dict[str, Any]:
4579
+ async def create_feedback_submission(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
5394
4580
  """
5395
4581
 
5396
4582
  Searches for feedback submissions using the HubSpot CRM API and returns relevant results.
@@ -5410,27 +4596,14 @@ class CrmApi(APISegmentBase):
5410
4596
  """
5411
4597
  request_body_data = None
5412
4598
  request_body_data = {"associations": associations, "properties": properties}
5413
- request_body_data = {
5414
- k: v for k, v in request_body_data.items() if v is not None
5415
- }
4599
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5416
4600
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions"
5417
4601
  query_params = {}
5418
- response = self._post(
5419
- url,
5420
- data=request_body_data,
5421
- params=query_params,
5422
- content_type="application/json",
5423
- )
4602
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5424
4603
  return self._handle_response(response)
5425
4604
 
5426
- def search_feedback_submissions(
5427
- self,
5428
- limit: int,
5429
- after: str,
5430
- sorts: list[str],
5431
- properties: list[str],
5432
- filterGroups: list[dict[str, Any]],
5433
- query: str | None = None,
4605
+ async def search_feedback_submissions(
4606
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
5434
4607
  ) -> dict[str, Any]:
5435
4608
  """
5436
4609
 
@@ -5462,20 +4635,13 @@ class CrmApi(APISegmentBase):
5462
4635
  "properties": properties,
5463
4636
  "filterGroups": filterGroups,
5464
4637
  }
5465
- request_body_data = {
5466
- k: v for k, v in request_body_data.items() if v is not None
5467
- }
4638
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5468
4639
  url = f"{self.main_app_client.base_url}/crm/v3/objects/feedback_submissions/search"
5469
4640
  query_params = {}
5470
- response = self._post(
5471
- url,
5472
- data=request_body_data,
5473
- params=query_params,
5474
- content_type="application/json",
5475
- )
4641
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5476
4642
  return self._handle_response(response)
5477
4643
 
5478
- def read_batch_objects(
4644
+ async def read_batch_objects(
5479
4645
  self,
5480
4646
  objectType: str,
5481
4647
  propertiesWithHistory: list[str],
@@ -5514,20 +4680,13 @@ class CrmApi(APISegmentBase):
5514
4680
  "inputs": inputs,
5515
4681
  "properties": properties,
5516
4682
  }
5517
- request_body_data = {
5518
- k: v for k, v in request_body_data.items() if v is not None
5519
- }
4683
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5520
4684
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/read"
5521
4685
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
5522
- response = self._post(
5523
- url,
5524
- data=request_body_data,
5525
- params=query_params,
5526
- content_type="application/json",
5527
- )
4686
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5528
4687
  return self._handle_response(response)
5529
4688
 
5530
- def get_object_details(
4689
+ async def get_object_details(
5531
4690
  self,
5532
4691
  objectType: str,
5533
4692
  objectId: str,
@@ -5578,7 +4737,7 @@ class CrmApi(APISegmentBase):
5578
4737
  response = self._get(url, params=query_params)
5579
4738
  return self._handle_response(response)
5580
4739
 
5581
- def delete_object_by_id(self, objectType: str, objectId: str) -> Any:
4740
+ async def delete_object_by_id(self, objectType: str, objectId: str) -> Any:
5582
4741
  """
5583
4742
 
5584
4743
  Deletes a specified CRM object of the given type and ID using the DELETE method.
@@ -5605,12 +4764,8 @@ class CrmApi(APISegmentBase):
5605
4764
  response = self._delete(url, params=query_params)
5606
4765
  return self._handle_response(response)
5607
4766
 
5608
- def patch_object_by_id(
5609
- self,
5610
- objectType: str,
5611
- objectId: str,
5612
- properties: dict[str, str],
5613
- idProperty: str | None = None,
4767
+ async def patch_object_by_id(
4768
+ self, objectType: str, objectId: str, properties: dict[str, str], idProperty: str | None = None
5614
4769
  ) -> dict[str, Any]:
5615
4770
  """
5616
4771
 
@@ -5637,17 +4792,13 @@ class CrmApi(APISegmentBase):
5637
4792
  raise ValueError("Missing required parameter 'objectId'.")
5638
4793
  request_body_data = None
5639
4794
  request_body_data = {"properties": properties}
5640
- request_body_data = {
5641
- k: v for k, v in request_body_data.items() if v is not None
5642
- }
4795
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5643
4796
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/{objectId}"
5644
4797
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
5645
4798
  response = self._patch(url, data=request_body_data, params=query_params)
5646
4799
  return self._handle_response(response)
5647
4800
 
5648
- def merge_objects(
5649
- self, objectType: str, objectIdToMerge: str, primaryObjectId: str
5650
- ) -> dict[str, Any]:
4801
+ async def merge_objects(self, objectType: str, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
5651
4802
  """
5652
4803
 
5653
4804
  Merges duplicate records of a specified object type into a single record using the provided JSON body.
@@ -5669,26 +4820,14 @@ class CrmApi(APISegmentBase):
5669
4820
  if objectType is None:
5670
4821
  raise ValueError("Missing required parameter 'objectType'.")
5671
4822
  request_body_data = None
5672
- request_body_data = {
5673
- "objectIdToMerge": objectIdToMerge,
5674
- "primaryObjectId": primaryObjectId,
5675
- }
5676
- request_body_data = {
5677
- k: v for k, v in request_body_data.items() if v is not None
5678
- }
4823
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
4824
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5679
4825
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/merge"
5680
4826
  query_params = {}
5681
- response = self._post(
5682
- url,
5683
- data=request_body_data,
5684
- params=query_params,
5685
- content_type="application/json",
5686
- )
4827
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5687
4828
  return self._handle_response(response)
5688
4829
 
5689
- def archive_batch_objects_by_type(
5690
- self, objectType: str, inputs: list[dict[str, Any]]
5691
- ) -> Any:
4830
+ async def archive_batch_objects_by_type(self, objectType: str, inputs: list[dict[str, Any]]) -> Any:
5692
4831
  """
5693
4832
 
5694
4833
  Archives a batch of objects of a specified type in CRM using the POST method, requiring a JSON body and returning a 204 status code upon successful archiving.
@@ -5710,24 +4849,13 @@ class CrmApi(APISegmentBase):
5710
4849
  raise ValueError("Missing required parameter 'objectType'.")
5711
4850
  request_body_data = None
5712
4851
  request_body_data = {"inputs": inputs}
5713
- request_body_data = {
5714
- k: v for k, v in request_body_data.items() if v is not None
5715
- }
5716
- url = (
5717
- f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/archive"
5718
- )
4852
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4853
+ url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/archive"
5719
4854
  query_params = {}
5720
- response = self._post(
5721
- url,
5722
- data=request_body_data,
5723
- params=query_params,
5724
- content_type="application/json",
5725
- )
4855
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5726
4856
  return self._handle_response(response)
5727
4857
 
5728
- def batch_create_object_records(
5729
- self, objectType: str, inputs: list[dict[str, Any]]
5730
- ) -> dict[str, Any]:
4858
+ async def batch_create_object_records(self, objectType: str, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5731
4859
  """
5732
4860
 
5733
4861
  Creates multiple records of a specified object type in a CRM system using a single POST request, supporting batch creation and returning a status message based on the outcome.
@@ -5749,24 +4877,13 @@ class CrmApi(APISegmentBase):
5749
4877
  raise ValueError("Missing required parameter 'objectType'.")
5750
4878
  request_body_data = None
5751
4879
  request_body_data = {"inputs": inputs}
5752
- request_body_data = {
5753
- k: v for k, v in request_body_data.items() if v is not None
5754
- }
5755
- url = (
5756
- f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/create"
5757
- )
4880
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4881
+ url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/create"
5758
4882
  query_params = {}
5759
- response = self._post(
5760
- url,
5761
- data=request_body_data,
5762
- params=query_params,
5763
- content_type="application/json",
5764
- )
4883
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5765
4884
  return self._handle_response(response)
5766
4885
 
5767
- def update_batch_object(
5768
- self, objectType: str, inputs: list[dict[str, Any]]
5769
- ) -> dict[str, Any]:
4886
+ async def update_batch_object(self, objectType: str, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5770
4887
  """
5771
4888
 
5772
4889
  Updates multiple records of a specified object type in a CRM system using a batch operation via the POST method.
@@ -5788,24 +4905,13 @@ class CrmApi(APISegmentBase):
5788
4905
  raise ValueError("Missing required parameter 'objectType'.")
5789
4906
  request_body_data = None
5790
4907
  request_body_data = {"inputs": inputs}
5791
- request_body_data = {
5792
- k: v for k, v in request_body_data.items() if v is not None
5793
- }
5794
- url = (
5795
- f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/update"
5796
- )
4908
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
4909
+ url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/batch/update"
5797
4910
  query_params = {}
5798
- response = self._post(
5799
- url,
5800
- data=request_body_data,
5801
- params=query_params,
5802
- content_type="application/json",
5803
- )
4911
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5804
4912
  return self._handle_response(response)
5805
4913
 
5806
- def gdpr_delete_object(
5807
- self, objectType: str, objectId: str, idProperty: str | None = None
5808
- ) -> Any:
4914
+ async def gdpr_delete_object(self, objectType: str, objectId: str, idProperty: str | None = None) -> Any:
5809
4915
  """
5810
4916
 
5811
4917
  Permanently deletes an object of the specified type from the CRM, adhering to GDPR guidelines for data removal, using the "POST" method with the object type specified in the path and additional details in the request body.
@@ -5828,20 +4934,13 @@ class CrmApi(APISegmentBase):
5828
4934
  raise ValueError("Missing required parameter 'objectType'.")
5829
4935
  request_body_data = None
5830
4936
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
5831
- request_body_data = {
5832
- k: v for k, v in request_body_data.items() if v is not None
5833
- }
4937
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5834
4938
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/gdpr-delete"
5835
4939
  query_params = {}
5836
- response = self._post(
5837
- url,
5838
- data=request_body_data,
5839
- params=query_params,
5840
- content_type="application/json",
5841
- )
4940
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5842
4941
  return self._handle_response(response)
5843
4942
 
5844
- def list_objects_by_type(
4943
+ async def list_objects_by_type(
5845
4944
  self,
5846
4945
  objectType: str,
5847
4946
  limit: int | None = None,
@@ -5891,11 +4990,8 @@ class CrmApi(APISegmentBase):
5891
4990
  response = self._get(url, params=query_params)
5892
4991
  return self._handle_response(response)
5893
4992
 
5894
- def create_object_by_type(
5895
- self,
5896
- objectType: str,
5897
- associations: list[dict[str, Any]],
5898
- properties: dict[str, str],
4993
+ async def create_object_by_type(
4994
+ self, objectType: str, associations: list[dict[str, Any]], properties: dict[str, str]
5899
4995
  ) -> dict[str, Any]:
5900
4996
  """
5901
4997
 
@@ -5919,20 +5015,13 @@ class CrmApi(APISegmentBase):
5919
5015
  raise ValueError("Missing required parameter 'objectType'.")
5920
5016
  request_body_data = None
5921
5017
  request_body_data = {"associations": associations, "properties": properties}
5922
- request_body_data = {
5923
- k: v for k, v in request_body_data.items() if v is not None
5924
- }
5018
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5925
5019
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}"
5926
5020
  query_params = {}
5927
- response = self._post(
5928
- url,
5929
- data=request_body_data,
5930
- params=query_params,
5931
- content_type="application/json",
5932
- )
5021
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5933
5022
  return self._handle_response(response)
5934
5023
 
5935
- def search_objects_by_type_post(
5024
+ async def search_objects_by_type_post(
5936
5025
  self,
5937
5026
  objectType: str,
5938
5027
  limit: int,
@@ -5975,20 +5064,13 @@ class CrmApi(APISegmentBase):
5975
5064
  "properties": properties,
5976
5065
  "filterGroups": filterGroups,
5977
5066
  }
5978
- request_body_data = {
5979
- k: v for k, v in request_body_data.items() if v is not None
5980
- }
5067
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
5981
5068
  url = f"{self.main_app_client.base_url}/crm/v3/objects/{objectType}/search"
5982
5069
  query_params = {}
5983
- response = self._post(
5984
- url,
5985
- data=request_body_data,
5986
- params=query_params,
5987
- content_type="application/json",
5988
- )
5070
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
5989
5071
  return self._handle_response(response)
5990
5072
 
5991
- def get_video_conferencing_settings_by_app_id(self, appId: str) -> dict[str, Any]:
5073
+ async def get_video_conferencing_settings_by_app_id(self, appId: str) -> dict[str, Any]:
5992
5074
  """
5993
5075
 
5994
5076
  Retrieves the video conferencing settings for a specific application identified by the provided appId using the HubSpot API.
@@ -6012,7 +5094,7 @@ class CrmApi(APISegmentBase):
6012
5094
  response = self._get(url, params=query_params)
6013
5095
  return self._handle_response(response)
6014
5096
 
6015
- def update_video_conferencing_settings_by_app_id(
5097
+ async def update_video_conferencing_settings_by_app_id(
6016
5098
  self,
6017
5099
  appId: str,
6018
5100
  createMeetingUrl: str,
@@ -6052,20 +5134,13 @@ class CrmApi(APISegmentBase):
6052
5134
  "updateMeetingUrl": updateMeetingUrl,
6053
5135
  "deleteMeetingUrl": deleteMeetingUrl,
6054
5136
  }
6055
- request_body_data = {
6056
- k: v for k, v in request_body_data.items() if v is not None
6057
- }
5137
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6058
5138
  url = f"{self.main_app_client.base_url}/crm/v3/extensions/videoconferencing/settings/{appId}"
6059
5139
  query_params = {}
6060
- response = self._put(
6061
- url,
6062
- data=request_body_data,
6063
- params=query_params,
6064
- content_type="application/json",
6065
- )
5140
+ response = self._put(url, data=request_body_data, params=query_params, content_type="application/json")
6066
5141
  return self._handle_response(response)
6067
5142
 
6068
- def delete_video_conf_settings_by_app_id(self, appId: str) -> Any:
5143
+ async def delete_video_conf_settings_by_app_id(self, appId: str) -> Any:
6069
5144
  """
6070
5145
 
6071
5146
  Deletes the video conferencing settings for the specified app identified by the appId.
@@ -6089,7 +5164,7 @@ class CrmApi(APISegmentBase):
6089
5164
  response = self._delete(url, params=query_params)
6090
5165
  return self._handle_response(response)
6091
5166
 
6092
- def batch_read_tickets_post(
5167
+ async def batch_read_tickets_post(
6093
5168
  self,
6094
5169
  propertiesWithHistory: list[str],
6095
5170
  inputs: list[dict[str, Any]],
@@ -6124,20 +5199,13 @@ class CrmApi(APISegmentBase):
6124
5199
  "inputs": inputs,
6125
5200
  "properties": properties,
6126
5201
  }
6127
- request_body_data = {
6128
- k: v for k, v in request_body_data.items() if v is not None
6129
- }
5202
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6130
5203
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/batch/read"
6131
5204
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
6132
- response = self._post(
6133
- url,
6134
- data=request_body_data,
6135
- params=query_params,
6136
- content_type="application/json",
6137
- )
5205
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6138
5206
  return self._handle_response(response)
6139
5207
 
6140
- def get_ticket_by_id(
5208
+ async def get_ticket_by_id(
6141
5209
  self,
6142
5210
  ticketId: str,
6143
5211
  properties: list[str] | None = None,
@@ -6184,7 +5252,7 @@ class CrmApi(APISegmentBase):
6184
5252
  response = self._get(url, params=query_params)
6185
5253
  return self._handle_response(response)
6186
5254
 
6187
- def delete_ticket_by_id(self, ticketId: str) -> Any:
5255
+ async def delete_ticket_by_id(self, ticketId: str) -> Any:
6188
5256
  """
6189
5257
 
6190
5258
  Deletes a ticket by its ID using the CRM API.
@@ -6208,12 +5276,7 @@ class CrmApi(APISegmentBase):
6208
5276
  response = self._delete(url, params=query_params)
6209
5277
  return self._handle_response(response)
6210
5278
 
6211
- def update_ticket(
6212
- self,
6213
- ticketId: str,
6214
- properties: dict[str, str],
6215
- idProperty: str | None = None,
6216
- ) -> dict[str, Any]:
5279
+ async def update_ticket(self, ticketId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
6217
5280
  """
6218
5281
 
6219
5282
  Updates an individual ticket by its ID using the HubSpot CRM API, allowing modification of specific fields via a JSON payload.
@@ -6236,17 +5299,13 @@ class CrmApi(APISegmentBase):
6236
5299
  raise ValueError("Missing required parameter 'ticketId'.")
6237
5300
  request_body_data = None
6238
5301
  request_body_data = {"properties": properties}
6239
- request_body_data = {
6240
- k: v for k, v in request_body_data.items() if v is not None
6241
- }
5302
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6242
5303
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/{ticketId}"
6243
5304
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
6244
5305
  response = self._patch(url, data=request_body_data, params=query_params)
6245
5306
  return self._handle_response(response)
6246
5307
 
6247
- def merge_tickets(
6248
- self, objectIdToMerge: str, primaryObjectId: str
6249
- ) -> dict[str, Any]:
5308
+ async def merge_tickets(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
6250
5309
  """
6251
5310
 
6252
5311
  Merges two or more tickets into a single ticket in the CRM system using the POST method, allowing for the consolidation of related customer service requests.
@@ -6265,24 +5324,14 @@ class CrmApi(APISegmentBase):
6265
5324
  Public_Object
6266
5325
  """
6267
5326
  request_body_data = None
6268
- request_body_data = {
6269
- "objectIdToMerge": objectIdToMerge,
6270
- "primaryObjectId": primaryObjectId,
6271
- }
6272
- request_body_data = {
6273
- k: v for k, v in request_body_data.items() if v is not None
6274
- }
5327
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
5328
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6275
5329
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/merge"
6276
5330
  query_params = {}
6277
- response = self._post(
6278
- url,
6279
- data=request_body_data,
6280
- params=query_params,
6281
- content_type="application/json",
6282
- )
5331
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6283
5332
  return self._handle_response(response)
6284
5333
 
6285
- def archive_tickets_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
5334
+ async def archive_tickets_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
6286
5335
  """
6287
5336
 
6288
5337
  Archives a batch of tickets by ID using the HubSpot API and returns a status message.
@@ -6301,20 +5350,13 @@ class CrmApi(APISegmentBase):
6301
5350
  """
6302
5351
  request_body_data = None
6303
5352
  request_body_data = {"inputs": inputs}
6304
- request_body_data = {
6305
- k: v for k, v in request_body_data.items() if v is not None
6306
- }
5353
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6307
5354
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/batch/archive"
6308
5355
  query_params = {}
6309
- response = self._post(
6310
- url,
6311
- data=request_body_data,
6312
- params=query_params,
6313
- content_type="application/json",
6314
- )
5356
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6315
5357
  return self._handle_response(response)
6316
5358
 
6317
- def create_tickets_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5359
+ async def create_tickets_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
6318
5360
  """
6319
5361
 
6320
5362
  Creates a batch of tickets in the CRM using the HubSpot API and returns a status message.
@@ -6333,20 +5375,13 @@ class CrmApi(APISegmentBase):
6333
5375
  """
6334
5376
  request_body_data = None
6335
5377
  request_body_data = {"inputs": inputs}
6336
- request_body_data = {
6337
- k: v for k, v in request_body_data.items() if v is not None
6338
- }
5378
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6339
5379
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/batch/create"
6340
5380
  query_params = {}
6341
- response = self._post(
6342
- url,
6343
- data=request_body_data,
6344
- params=query_params,
6345
- content_type="application/json",
6346
- )
5381
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6347
5382
  return self._handle_response(response)
6348
5383
 
6349
- def update_tickets_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5384
+ async def update_tickets_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
6350
5385
  """
6351
5386
 
6352
5387
  Updates multiple tickets in a single request using the HubSpot CRM API, returning a status message indicating the success or partial success of the operation.
@@ -6365,22 +5400,13 @@ class CrmApi(APISegmentBase):
6365
5400
  """
6366
5401
  request_body_data = None
6367
5402
  request_body_data = {"inputs": inputs}
6368
- request_body_data = {
6369
- k: v for k, v in request_body_data.items() if v is not None
6370
- }
5403
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6371
5404
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/batch/update"
6372
5405
  query_params = {}
6373
- response = self._post(
6374
- url,
6375
- data=request_body_data,
6376
- params=query_params,
6377
- content_type="application/json",
6378
- )
5406
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6379
5407
  return self._handle_response(response)
6380
5408
 
6381
- def delete_ticket_gdpr(
6382
- self, objectId: str, idProperty: str | None = None
6383
- ) -> Any:
5409
+ async def delete_ticket_gdpr(self, objectId: str, idProperty: str | None = None) -> Any:
6384
5410
  """
6385
5411
 
6386
5412
  Permanently deletes a ticket and associated data in compliance with GDPR guidelines using the POST method.
@@ -6400,20 +5426,13 @@ class CrmApi(APISegmentBase):
6400
5426
  """
6401
5427
  request_body_data = None
6402
5428
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
6403
- request_body_data = {
6404
- k: v for k, v in request_body_data.items() if v is not None
6405
- }
5429
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6406
5430
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/gdpr-delete"
6407
5431
  query_params = {}
6408
- response = self._post(
6409
- url,
6410
- data=request_body_data,
6411
- params=query_params,
6412
- content_type="application/json",
6413
- )
5432
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6414
5433
  return self._handle_response(response)
6415
5434
 
6416
- def get_tickets(
5435
+ async def get_tickets(
6417
5436
  self,
6418
5437
  limit: int | None = None,
6419
5438
  after: str | None = None,
@@ -6459,9 +5478,7 @@ class CrmApi(APISegmentBase):
6459
5478
  response = self._get(url, params=query_params)
6460
5479
  return self._handle_response(response)
6461
5480
 
6462
- def create_ticket(
6463
- self, associations: list[dict[str, Any]], properties: dict[str, str]
6464
- ) -> dict[str, Any]:
5481
+ async def create_ticket(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
6465
5482
  """
6466
5483
 
6467
5484
  Creates a new ticket object in the CRM using the HubSpot API, allowing for the management of customer service requests.
@@ -6481,27 +5498,14 @@ class CrmApi(APISegmentBase):
6481
5498
  """
6482
5499
  request_body_data = None
6483
5500
  request_body_data = {"associations": associations, "properties": properties}
6484
- request_body_data = {
6485
- k: v for k, v in request_body_data.items() if v is not None
6486
- }
5501
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6487
5502
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets"
6488
5503
  query_params = {}
6489
- response = self._post(
6490
- url,
6491
- data=request_body_data,
6492
- params=query_params,
6493
- content_type="application/json",
6494
- )
5504
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6495
5505
  return self._handle_response(response)
6496
5506
 
6497
- def search_tickets_post(
6498
- self,
6499
- limit: int,
6500
- after: str,
6501
- sorts: list[str],
6502
- properties: list[str],
6503
- filterGroups: list[dict[str, Any]],
6504
- query: str | None = None,
5507
+ async def search_tickets_post(
5508
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
6505
5509
  ) -> dict[str, Any]:
6506
5510
  """
6507
5511
 
@@ -6533,20 +5537,13 @@ class CrmApi(APISegmentBase):
6533
5537
  "properties": properties,
6534
5538
  "filterGroups": filterGroups,
6535
5539
  }
6536
- request_body_data = {
6537
- k: v for k, v in request_body_data.items() if v is not None
6538
- }
5540
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6539
5541
  url = f"{self.main_app_client.base_url}/crm/v3/objects/tickets/search"
6540
5542
  query_params = {}
6541
- response = self._post(
6542
- url,
6543
- data=request_body_data,
6544
- params=query_params,
6545
- content_type="application/json",
6546
- )
5543
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6547
5544
  return self._handle_response(response)
6548
5545
 
6549
- def batch_read_line_items_post(
5546
+ async def batch_read_line_items_post(
6550
5547
  self,
6551
5548
  propertiesWithHistory: list[str],
6552
5549
  inputs: list[dict[str, Any]],
@@ -6581,20 +5578,13 @@ class CrmApi(APISegmentBase):
6581
5578
  "inputs": inputs,
6582
5579
  "properties": properties,
6583
5580
  }
6584
- request_body_data = {
6585
- k: v for k, v in request_body_data.items() if v is not None
6586
- }
5581
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6587
5582
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/batch/read"
6588
5583
  query_params = {k: v for k, v in [("archived", archived)] if v is not None}
6589
- response = self._post(
6590
- url,
6591
- data=request_body_data,
6592
- params=query_params,
6593
- content_type="application/json",
6594
- )
5584
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6595
5585
  return self._handle_response(response)
6596
5586
 
6597
- def get_line_item_by_id(
5587
+ async def get_line_item_by_id(
6598
5588
  self,
6599
5589
  lineItemId: str,
6600
5590
  properties: list[str] | None = None,
@@ -6641,7 +5631,7 @@ class CrmApi(APISegmentBase):
6641
5631
  response = self._get(url, params=query_params)
6642
5632
  return self._handle_response(response)
6643
5633
 
6644
- def delete_line_item_by_id(self, lineItemId: str) -> Any:
5634
+ async def delete_line_item_by_id(self, lineItemId: str) -> Any:
6645
5635
  """
6646
5636
 
6647
5637
  Deletes a line item from HubSpot CRM using its ID, requiring the "crm.objects.line_items.write" permission.
@@ -6665,12 +5655,7 @@ class CrmApi(APISegmentBase):
6665
5655
  response = self._delete(url, params=query_params)
6666
5656
  return self._handle_response(response)
6667
5657
 
6668
- def patch_line_item_by_id(
6669
- self,
6670
- lineItemId: str,
6671
- properties: dict[str, str],
6672
- idProperty: str | None = None,
6673
- ) -> dict[str, Any]:
5658
+ async def patch_line_item_by_id(self, lineItemId: str, properties: dict[str, str], idProperty: str | None = None) -> dict[str, Any]:
6674
5659
  """
6675
5660
 
6676
5661
  Updates properties of a specific line item in the CRM system using a partial JSON patch request.
@@ -6693,17 +5678,13 @@ class CrmApi(APISegmentBase):
6693
5678
  raise ValueError("Missing required parameter 'lineItemId'.")
6694
5679
  request_body_data = None
6695
5680
  request_body_data = {"properties": properties}
6696
- request_body_data = {
6697
- k: v for k, v in request_body_data.items() if v is not None
6698
- }
5681
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6699
5682
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/{lineItemId}"
6700
5683
  query_params = {k: v for k, v in [("idProperty", idProperty)] if v is not None}
6701
5684
  response = self._patch(url, data=request_body_data, params=query_params)
6702
5685
  return self._handle_response(response)
6703
5686
 
6704
- def merge_line_items_post(
6705
- self, objectIdToMerge: str, primaryObjectId: str
6706
- ) -> dict[str, Any]:
5687
+ async def merge_line_items_post(self, objectIdToMerge: str, primaryObjectId: str) -> dict[str, Any]:
6707
5688
  """
6708
5689
 
6709
5690
  Merges duplicate line items into a single instance using the specified parameters via the POST method.
@@ -6722,24 +5703,14 @@ class CrmApi(APISegmentBase):
6722
5703
  Public_Object
6723
5704
  """
6724
5705
  request_body_data = None
6725
- request_body_data = {
6726
- "objectIdToMerge": objectIdToMerge,
6727
- "primaryObjectId": primaryObjectId,
6728
- }
6729
- request_body_data = {
6730
- k: v for k, v in request_body_data.items() if v is not None
6731
- }
5706
+ request_body_data = {"objectIdToMerge": objectIdToMerge, "primaryObjectId": primaryObjectId}
5707
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6732
5708
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/merge"
6733
5709
  query_params = {}
6734
- response = self._post(
6735
- url,
6736
- data=request_body_data,
6737
- params=query_params,
6738
- content_type="application/json",
6739
- )
5710
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6740
5711
  return self._handle_response(response)
6741
5712
 
6742
- def archive_line_items_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
5713
+ async def archive_line_items_batch_post(self, inputs: list[dict[str, Any]]) -> Any:
6743
5714
  """
6744
5715
 
6745
5716
  Archives a batch of line items by their IDs in the CRM using a POST request.
@@ -6758,20 +5729,13 @@ class CrmApi(APISegmentBase):
6758
5729
  """
6759
5730
  request_body_data = None
6760
5731
  request_body_data = {"inputs": inputs}
6761
- request_body_data = {
6762
- k: v for k, v in request_body_data.items() if v is not None
6763
- }
5732
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6764
5733
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/batch/archive"
6765
5734
  query_params = {}
6766
- response = self._post(
6767
- url,
6768
- data=request_body_data,
6769
- params=query_params,
6770
- content_type="application/json",
6771
- )
5735
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6772
5736
  return self._handle_response(response)
6773
5737
 
6774
- def create_line_items_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5738
+ async def create_line_items_batch(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
6775
5739
  """
6776
5740
 
6777
5741
  Creates a batch of line items using the HubSpot API and returns a status message upon successful creation.
@@ -6790,20 +5754,13 @@ class CrmApi(APISegmentBase):
6790
5754
  """
6791
5755
  request_body_data = None
6792
5756
  request_body_data = {"inputs": inputs}
6793
- request_body_data = {
6794
- k: v for k, v in request_body_data.items() if v is not None
6795
- }
5757
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6796
5758
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/batch/create"
6797
5759
  query_params = {}
6798
- response = self._post(
6799
- url,
6800
- data=request_body_data,
6801
- params=query_params,
6802
- content_type="application/json",
6803
- )
5760
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6804
5761
  return self._handle_response(response)
6805
5762
 
6806
- def batch_update_line_items(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
5763
+ async def batch_update_line_items(self, inputs: list[dict[str, Any]]) -> dict[str, Any]:
6807
5764
  """
6808
5765
 
6809
5766
  Updates a batch of line items using their internal IDs or unique property values via the POST method, requiring authentication with the "crm.objects.line_items.write" scope.
@@ -6822,22 +5779,13 @@ class CrmApi(APISegmentBase):
6822
5779
  """
6823
5780
  request_body_data = None
6824
5781
  request_body_data = {"inputs": inputs}
6825
- request_body_data = {
6826
- k: v for k, v in request_body_data.items() if v is not None
6827
- }
5782
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6828
5783
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/batch/update"
6829
5784
  query_params = {}
6830
- response = self._post(
6831
- url,
6832
- data=request_body_data,
6833
- params=query_params,
6834
- content_type="application/json",
6835
- )
5785
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6836
5786
  return self._handle_response(response)
6837
5787
 
6838
- def gdpr_delete_line_items(
6839
- self, objectId: str, idProperty: str | None = None
6840
- ) -> Any:
5788
+ async def gdpr_delete_line_items(self, objectId: str, idProperty: str | None = None) -> Any:
6841
5789
  """
6842
5790
 
6843
5791
  Deletes line item records from the CRM to comply with GDPR requirements, using the POST method with OAuth2 or private app authentication.
@@ -6857,20 +5805,13 @@ class CrmApi(APISegmentBase):
6857
5805
  """
6858
5806
  request_body_data = None
6859
5807
  request_body_data = {"idProperty": idProperty, "objectId": objectId}
6860
- request_body_data = {
6861
- k: v for k, v in request_body_data.items() if v is not None
6862
- }
5808
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6863
5809
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/gdpr-delete"
6864
5810
  query_params = {}
6865
- response = self._post(
6866
- url,
6867
- data=request_body_data,
6868
- params=query_params,
6869
- content_type="application/json",
6870
- )
5811
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6871
5812
  return self._handle_response(response)
6872
5813
 
6873
- def list_line_items(
5814
+ async def list_line_items(
6874
5815
  self,
6875
5816
  limit: int | None = None,
6876
5817
  after: str | None = None,
@@ -6916,9 +5857,7 @@ class CrmApi(APISegmentBase):
6916
5857
  response = self._get(url, params=query_params)
6917
5858
  return self._handle_response(response)
6918
5859
 
6919
- def create_line_item(
6920
- self, associations: list[dict[str, Any]], properties: dict[str, str]
6921
- ) -> dict[str, Any]:
5860
+ async def create_line_item(self, associations: list[dict[str, Any]], properties: dict[str, str]) -> dict[str, Any]:
6922
5861
  """
6923
5862
 
6924
5863
  Creates a new line item in HubSpot CRM using the POST method, allowing you to add products or services to deals and quotes.
@@ -6938,27 +5877,14 @@ class CrmApi(APISegmentBase):
6938
5877
  """
6939
5878
  request_body_data = None
6940
5879
  request_body_data = {"associations": associations, "properties": properties}
6941
- request_body_data = {
6942
- k: v for k, v in request_body_data.items() if v is not None
6943
- }
5880
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6944
5881
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items"
6945
5882
  query_params = {}
6946
- response = self._post(
6947
- url,
6948
- data=request_body_data,
6949
- params=query_params,
6950
- content_type="application/json",
6951
- )
5883
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
6952
5884
  return self._handle_response(response)
6953
5885
 
6954
- def search_line_items(
6955
- self,
6956
- limit: int,
6957
- after: str,
6958
- sorts: list[str],
6959
- properties: list[str],
6960
- filterGroups: list[dict[str, Any]],
6961
- query: str | None = None,
5886
+ async def search_line_items(
5887
+ self, limit: int, after: str, sorts: list[str], properties: list[str], filterGroups: list[dict[str, Any]], query: str | None = None
6962
5888
  ) -> dict[str, Any]:
6963
5889
  """
6964
5890
 
@@ -6990,25 +5916,13 @@ class CrmApi(APISegmentBase):
6990
5916
  "properties": properties,
6991
5917
  "filterGroups": filterGroups,
6992
5918
  }
6993
- request_body_data = {
6994
- k: v for k, v in request_body_data.items() if v is not None
6995
- }
5919
+ request_body_data = {k: v for k, v in request_body_data.items() if v is not None}
6996
5920
  url = f"{self.main_app_client.base_url}/crm/v3/objects/line_items/search"
6997
5921
  query_params = {}
6998
- response = self._post(
6999
- url,
7000
- data=request_body_data,
7001
- params=query_params,
7002
- content_type="application/json",
7003
- )
5922
+ response = self._post(url, data=request_body_data, params=query_params, content_type="application/json")
7004
5923
  return self._handle_response(response)
7005
5924
 
7006
- def get_crm_imports(
7007
- self,
7008
- after: str | None = None,
7009
- before: str | None = None,
7010
- limit: int | None = None,
7011
- ) -> dict[str, Any]:
5925
+ async def get_crm_imports(self, after: str | None = None, before: str | None = None, limit: int | None = None) -> dict[str, Any]:
7012
5926
  """
7013
5927
 
7014
5928
  Retrieves a list of CRM import operations using the HubSpot API, allowing optional filtering by date and limit on the number of results returned.
@@ -7028,17 +5942,11 @@ class CrmApi(APISegmentBase):
7028
5942
  Core
7029
5943
  """
7030
5944
  url = f"{self.main_app_client.base_url}/crm/v3/imports"
7031
- query_params = {
7032
- k: v
7033
- for k, v in [("after", after), ("before", before), ("limit", limit)]
7034
- if v is not None
7035
- }
5945
+ query_params = {k: v for k, v in [("after", after), ("before", before), ("limit", limit)] if v is not None}
7036
5946
  response = self._get(url, params=query_params)
7037
5947
  return self._handle_response(response)
7038
5948
 
7039
- def create_crm_import(
7040
- self, files: bytes | None = None, importRequest: str | None = None
7041
- ) -> dict[str, Any]:
5949
+ async def create_crm_import(self, files: bytes | None = None, importRequest: str | None = None) -> dict[str, Any]:
7042
5950
  """
7043
5951
 
7044
5952
  Imports data into a HubSpot CRM using a POST request with a multipart/form-data payload, allowing bulk creation or update of records via uploaded files such as CSV or Excel.
@@ -7069,21 +5977,11 @@ class CrmApi(APISegmentBase):
7069
5977
  files_data = None
7070
5978
  url = f"{self.main_app_client.base_url}/crm/v3/imports"
7071
5979
  query_params = {}
7072
- response = self._post(
7073
- url,
7074
- data=request_body_data,
7075
- files=files_data,
7076
- params=query_params,
7077
- content_type="multipart/form-data",
7078
- )
5980
+ response = self._post(url, data=request_body_data, files=files_data, params=query_params, content_type="multipart/form-data")
7079
5981
  return self._handle_response(response)
7080
5982
 
7081
- def get_owners_list(
7082
- self,
7083
- email: str | None = None,
7084
- after: str | None = None,
7085
- limit: int | None = None,
7086
- archived: bool | None = None,
5983
+ async def get_owners_list(
5984
+ self, email: str | None = None, after: str | None = None, limit: int | None = None, archived: bool | None = None
7087
5985
  ) -> dict[str, Any]:
7088
5986
  """
7089
5987
 
@@ -7105,22 +6003,11 @@ class CrmApi(APISegmentBase):
7105
6003
  Owners
7106
6004
  """
7107
6005
  url = f"{self.main_app_client.base_url}/crm/v3/owners"
7108
- query_params = {
7109
- k: v
7110
- for k, v in [
7111
- ("email", email),
7112
- ("after", after),
7113
- ("limit", limit),
7114
- ("archived", archived),
7115
- ]
7116
- if v is not None
7117
- }
6006
+ query_params = {k: v for k, v in [("email", email), ("after", after), ("limit", limit), ("archived", archived)] if v is not None}
7118
6007
  response = self._get(url, params=query_params)
7119
6008
  return self._handle_response(response)
7120
6009
 
7121
- def get_association_types_by_object_types(
7122
- self, fromObjectType: str, toObjectType: str
7123
- ) -> dict[str, Any]:
6010
+ async def get_association_types_by_object_types(self, fromObjectType: str, toObjectType: str) -> dict[str, Any]:
7124
6011
  """
7125
6012
 
7126
6013
  Retrieves the association types between two specified object types in HubSpot CRM using the "GET" method.