universal-mcp-applications 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. universal_mcp/applications/ahrefs/README.md +51 -0
  2. universal_mcp/applications/ahrefs/__init__.py +1 -0
  3. universal_mcp/applications/ahrefs/app.py +2291 -0
  4. universal_mcp/applications/airtable/README.md +22 -0
  5. universal_mcp/applications/airtable/__init__.py +1 -0
  6. universal_mcp/applications/airtable/app.py +479 -0
  7. universal_mcp/applications/apollo/README.md +44 -0
  8. universal_mcp/applications/apollo/__init__.py +1 -0
  9. universal_mcp/applications/apollo/app.py +1847 -0
  10. universal_mcp/applications/asana/README.md +199 -0
  11. universal_mcp/applications/asana/__init__.py +1 -0
  12. universal_mcp/applications/asana/app.py +9509 -0
  13. universal_mcp/applications/aws-s3/README.md +0 -0
  14. universal_mcp/applications/aws-s3/__init__.py +1 -0
  15. universal_mcp/applications/aws-s3/app.py +552 -0
  16. universal_mcp/applications/bill/README.md +0 -0
  17. universal_mcp/applications/bill/__init__.py +1 -0
  18. universal_mcp/applications/bill/app.py +8705 -0
  19. universal_mcp/applications/box/README.md +307 -0
  20. universal_mcp/applications/box/__init__.py +1 -0
  21. universal_mcp/applications/box/app.py +15987 -0
  22. universal_mcp/applications/braze/README.md +106 -0
  23. universal_mcp/applications/braze/__init__.py +1 -0
  24. universal_mcp/applications/braze/app.py +4754 -0
  25. universal_mcp/applications/cal-com-v2/README.md +150 -0
  26. universal_mcp/applications/cal-com-v2/__init__.py +1 -0
  27. universal_mcp/applications/cal-com-v2/app.py +5541 -0
  28. universal_mcp/applications/calendly/README.md +53 -0
  29. universal_mcp/applications/calendly/__init__.py +1 -0
  30. universal_mcp/applications/calendly/app.py +1436 -0
  31. universal_mcp/applications/canva/README.md +43 -0
  32. universal_mcp/applications/canva/__init__.py +1 -0
  33. universal_mcp/applications/canva/app.py +941 -0
  34. universal_mcp/applications/clickup/README.md +135 -0
  35. universal_mcp/applications/clickup/__init__.py +1 -0
  36. universal_mcp/applications/clickup/app.py +5009 -0
  37. universal_mcp/applications/coda/README.md +108 -0
  38. universal_mcp/applications/coda/__init__.py +1 -0
  39. universal_mcp/applications/coda/app.py +3671 -0
  40. universal_mcp/applications/confluence/README.md +198 -0
  41. universal_mcp/applications/confluence/__init__.py +1 -0
  42. universal_mcp/applications/confluence/app.py +6273 -0
  43. universal_mcp/applications/contentful/README.md +17 -0
  44. universal_mcp/applications/contentful/__init__.py +1 -0
  45. universal_mcp/applications/contentful/app.py +364 -0
  46. universal_mcp/applications/crustdata/README.md +25 -0
  47. universal_mcp/applications/crustdata/__init__.py +1 -0
  48. universal_mcp/applications/crustdata/app.py +586 -0
  49. universal_mcp/applications/dialpad/README.md +202 -0
  50. universal_mcp/applications/dialpad/__init__.py +1 -0
  51. universal_mcp/applications/dialpad/app.py +5949 -0
  52. universal_mcp/applications/digitalocean/README.md +463 -0
  53. universal_mcp/applications/digitalocean/__init__.py +1 -0
  54. universal_mcp/applications/digitalocean/app.py +20835 -0
  55. universal_mcp/applications/domain-checker/README.md +13 -0
  56. universal_mcp/applications/domain-checker/__init__.py +1 -0
  57. universal_mcp/applications/domain-checker/app.py +265 -0
  58. universal_mcp/applications/e2b/README.md +12 -0
  59. universal_mcp/applications/e2b/__init__.py +1 -0
  60. universal_mcp/applications/e2b/app.py +187 -0
  61. universal_mcp/applications/elevenlabs/README.md +88 -0
  62. universal_mcp/applications/elevenlabs/__init__.py +1 -0
  63. universal_mcp/applications/elevenlabs/app.py +3235 -0
  64. universal_mcp/applications/exa/README.md +15 -0
  65. universal_mcp/applications/exa/__init__.py +1 -0
  66. universal_mcp/applications/exa/app.py +221 -0
  67. universal_mcp/applications/falai/README.md +17 -0
  68. universal_mcp/applications/falai/__init__.py +1 -0
  69. universal_mcp/applications/falai/app.py +331 -0
  70. universal_mcp/applications/figma/README.md +49 -0
  71. universal_mcp/applications/figma/__init__.py +1 -0
  72. universal_mcp/applications/figma/app.py +1090 -0
  73. universal_mcp/applications/firecrawl/README.md +20 -0
  74. universal_mcp/applications/firecrawl/__init__.py +1 -0
  75. universal_mcp/applications/firecrawl/app.py +514 -0
  76. universal_mcp/applications/fireflies/README.md +25 -0
  77. universal_mcp/applications/fireflies/__init__.py +1 -0
  78. universal_mcp/applications/fireflies/app.py +506 -0
  79. universal_mcp/applications/fpl/README.md +23 -0
  80. universal_mcp/applications/fpl/__init__.py +1 -0
  81. universal_mcp/applications/fpl/app.py +1327 -0
  82. universal_mcp/applications/fpl/utils/api.py +142 -0
  83. universal_mcp/applications/fpl/utils/fixtures.py +629 -0
  84. universal_mcp/applications/fpl/utils/helper.py +982 -0
  85. universal_mcp/applications/fpl/utils/league_utils.py +546 -0
  86. universal_mcp/applications/fpl/utils/position_utils.py +68 -0
  87. universal_mcp/applications/ghost-content/README.md +25 -0
  88. universal_mcp/applications/ghost-content/__init__.py +1 -0
  89. universal_mcp/applications/ghost-content/app.py +654 -0
  90. universal_mcp/applications/github/README.md +1049 -0
  91. universal_mcp/applications/github/__init__.py +1 -0
  92. universal_mcp/applications/github/app.py +50600 -0
  93. universal_mcp/applications/gong/README.md +63 -0
  94. universal_mcp/applications/gong/__init__.py +1 -0
  95. universal_mcp/applications/gong/app.py +2297 -0
  96. universal_mcp/applications/google-ads/README.md +0 -0
  97. universal_mcp/applications/google-ads/__init__.py +1 -0
  98. universal_mcp/applications/google-ads/app.py +23 -0
  99. universal_mcp/applications/google-calendar/README.md +21 -0
  100. universal_mcp/applications/google-calendar/__init__.py +1 -0
  101. universal_mcp/applications/google-calendar/app.py +574 -0
  102. universal_mcp/applications/google-docs/README.md +25 -0
  103. universal_mcp/applications/google-docs/__init__.py +1 -0
  104. universal_mcp/applications/google-docs/app.py +760 -0
  105. universal_mcp/applications/google-drive/README.md +68 -0
  106. universal_mcp/applications/google-drive/__init__.py +1 -0
  107. universal_mcp/applications/google-drive/app.py +4936 -0
  108. universal_mcp/applications/google-gemini/README.md +25 -0
  109. universal_mcp/applications/google-gemini/__init__.py +1 -0
  110. universal_mcp/applications/google-gemini/app.py +663 -0
  111. universal_mcp/applications/google-mail/README.md +31 -0
  112. universal_mcp/applications/google-mail/__init__.py +1 -0
  113. universal_mcp/applications/google-mail/app.py +1354 -0
  114. universal_mcp/applications/google-searchconsole/README.md +21 -0
  115. universal_mcp/applications/google-searchconsole/__init__.py +1 -0
  116. universal_mcp/applications/google-searchconsole/app.py +320 -0
  117. universal_mcp/applications/google-sheet/README.md +36 -0
  118. universal_mcp/applications/google-sheet/__init__.py +1 -0
  119. universal_mcp/applications/google-sheet/app.py +1941 -0
  120. universal_mcp/applications/hashnode/README.md +20 -0
  121. universal_mcp/applications/hashnode/__init__.py +1 -0
  122. universal_mcp/applications/hashnode/app.py +455 -0
  123. universal_mcp/applications/heygen/README.md +44 -0
  124. universal_mcp/applications/heygen/__init__.py +1 -0
  125. universal_mcp/applications/heygen/app.py +961 -0
  126. universal_mcp/applications/http-tools/README.md +16 -0
  127. universal_mcp/applications/http-tools/__init__.py +1 -0
  128. universal_mcp/applications/http-tools/app.py +153 -0
  129. universal_mcp/applications/hubspot/README.md +239 -0
  130. universal_mcp/applications/hubspot/__init__.py +1 -0
  131. universal_mcp/applications/hubspot/app.py +416 -0
  132. universal_mcp/applications/jira/README.md +600 -0
  133. universal_mcp/applications/jira/__init__.py +1 -0
  134. universal_mcp/applications/jira/app.py +28804 -0
  135. universal_mcp/applications/klaviyo/README.md +313 -0
  136. universal_mcp/applications/klaviyo/__init__.py +1 -0
  137. universal_mcp/applications/klaviyo/app.py +11236 -0
  138. universal_mcp/applications/linkedin/README.md +15 -0
  139. universal_mcp/applications/linkedin/__init__.py +1 -0
  140. universal_mcp/applications/linkedin/app.py +243 -0
  141. universal_mcp/applications/mailchimp/README.md +281 -0
  142. universal_mcp/applications/mailchimp/__init__.py +1 -0
  143. universal_mcp/applications/mailchimp/app.py +10937 -0
  144. universal_mcp/applications/markitdown/README.md +12 -0
  145. universal_mcp/applications/markitdown/__init__.py +1 -0
  146. universal_mcp/applications/markitdown/app.py +63 -0
  147. universal_mcp/applications/miro/README.md +151 -0
  148. universal_mcp/applications/miro/__init__.py +1 -0
  149. universal_mcp/applications/miro/app.py +5429 -0
  150. universal_mcp/applications/ms-teams/README.md +42 -0
  151. universal_mcp/applications/ms-teams/__init__.py +1 -0
  152. universal_mcp/applications/ms-teams/app.py +1823 -0
  153. universal_mcp/applications/neon/README.md +74 -0
  154. universal_mcp/applications/neon/__init__.py +1 -0
  155. universal_mcp/applications/neon/app.py +2018 -0
  156. universal_mcp/applications/notion/README.md +30 -0
  157. universal_mcp/applications/notion/__init__.py +1 -0
  158. universal_mcp/applications/notion/app.py +527 -0
  159. universal_mcp/applications/openai/README.md +22 -0
  160. universal_mcp/applications/openai/__init__.py +1 -0
  161. universal_mcp/applications/openai/app.py +759 -0
  162. universal_mcp/applications/outlook/README.md +20 -0
  163. universal_mcp/applications/outlook/__init__.py +1 -0
  164. universal_mcp/applications/outlook/app.py +444 -0
  165. universal_mcp/applications/perplexity/README.md +12 -0
  166. universal_mcp/applications/perplexity/__init__.py +1 -0
  167. universal_mcp/applications/perplexity/app.py +65 -0
  168. universal_mcp/applications/pipedrive/README.md +284 -0
  169. universal_mcp/applications/pipedrive/__init__.py +1 -0
  170. universal_mcp/applications/pipedrive/app.py +12924 -0
  171. universal_mcp/applications/posthog/README.md +132 -0
  172. universal_mcp/applications/posthog/__init__.py +1 -0
  173. universal_mcp/applications/posthog/app.py +7125 -0
  174. universal_mcp/applications/reddit/README.md +135 -0
  175. universal_mcp/applications/reddit/__init__.py +1 -0
  176. universal_mcp/applications/reddit/app.py +4652 -0
  177. universal_mcp/applications/replicate/README.md +18 -0
  178. universal_mcp/applications/replicate/__init__.py +1 -0
  179. universal_mcp/applications/replicate/app.py +495 -0
  180. universal_mcp/applications/resend/README.md +40 -0
  181. universal_mcp/applications/resend/__init__.py +1 -0
  182. universal_mcp/applications/resend/app.py +881 -0
  183. universal_mcp/applications/retell/README.md +21 -0
  184. universal_mcp/applications/retell/__init__.py +1 -0
  185. universal_mcp/applications/retell/app.py +333 -0
  186. universal_mcp/applications/rocketlane/README.md +70 -0
  187. universal_mcp/applications/rocketlane/__init__.py +1 -0
  188. universal_mcp/applications/rocketlane/app.py +4346 -0
  189. universal_mcp/applications/semanticscholar/README.md +25 -0
  190. universal_mcp/applications/semanticscholar/__init__.py +1 -0
  191. universal_mcp/applications/semanticscholar/app.py +482 -0
  192. universal_mcp/applications/semrush/README.md +44 -0
  193. universal_mcp/applications/semrush/__init__.py +1 -0
  194. universal_mcp/applications/semrush/app.py +2081 -0
  195. universal_mcp/applications/sendgrid/README.md +362 -0
  196. universal_mcp/applications/sendgrid/__init__.py +1 -0
  197. universal_mcp/applications/sendgrid/app.py +9752 -0
  198. universal_mcp/applications/sentry/README.md +186 -0
  199. universal_mcp/applications/sentry/__init__.py +1 -0
  200. universal_mcp/applications/sentry/app.py +7471 -0
  201. universal_mcp/applications/serpapi/README.md +14 -0
  202. universal_mcp/applications/serpapi/__init__.py +1 -0
  203. universal_mcp/applications/serpapi/app.py +293 -0
  204. universal_mcp/applications/sharepoint/README.md +0 -0
  205. universal_mcp/applications/sharepoint/__init__.py +1 -0
  206. universal_mcp/applications/sharepoint/app.py +215 -0
  207. universal_mcp/applications/shopify/README.md +321 -0
  208. universal_mcp/applications/shopify/__init__.py +1 -0
  209. universal_mcp/applications/shopify/app.py +15392 -0
  210. universal_mcp/applications/shortcut/README.md +128 -0
  211. universal_mcp/applications/shortcut/__init__.py +1 -0
  212. universal_mcp/applications/shortcut/app.py +4478 -0
  213. universal_mcp/applications/slack/README.md +0 -0
  214. universal_mcp/applications/slack/__init__.py +1 -0
  215. universal_mcp/applications/slack/app.py +570 -0
  216. universal_mcp/applications/spotify/README.md +91 -0
  217. universal_mcp/applications/spotify/__init__.py +1 -0
  218. universal_mcp/applications/spotify/app.py +2526 -0
  219. universal_mcp/applications/supabase/README.md +87 -0
  220. universal_mcp/applications/supabase/__init__.py +1 -0
  221. universal_mcp/applications/supabase/app.py +2970 -0
  222. universal_mcp/applications/tavily/README.md +12 -0
  223. universal_mcp/applications/tavily/__init__.py +1 -0
  224. universal_mcp/applications/tavily/app.py +51 -0
  225. universal_mcp/applications/trello/README.md +266 -0
  226. universal_mcp/applications/trello/__init__.py +1 -0
  227. universal_mcp/applications/trello/app.py +10875 -0
  228. universal_mcp/applications/twillo/README.md +0 -0
  229. universal_mcp/applications/twillo/__init__.py +1 -0
  230. universal_mcp/applications/twillo/app.py +269 -0
  231. universal_mcp/applications/twitter/README.md +100 -0
  232. universal_mcp/applications/twitter/__init__.py +1 -0
  233. universal_mcp/applications/twitter/api_segments/__init__.py +0 -0
  234. universal_mcp/applications/twitter/api_segments/api_segment_base.py +51 -0
  235. universal_mcp/applications/twitter/api_segments/compliance_api.py +122 -0
  236. universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +255 -0
  237. universal_mcp/applications/twitter/api_segments/dm_events_api.py +140 -0
  238. universal_mcp/applications/twitter/api_segments/likes_api.py +159 -0
  239. universal_mcp/applications/twitter/api_segments/lists_api.py +395 -0
  240. universal_mcp/applications/twitter/api_segments/openapi_json_api.py +34 -0
  241. universal_mcp/applications/twitter/api_segments/spaces_api.py +309 -0
  242. universal_mcp/applications/twitter/api_segments/trends_api.py +40 -0
  243. universal_mcp/applications/twitter/api_segments/tweets_api.py +1403 -0
  244. universal_mcp/applications/twitter/api_segments/usage_api.py +40 -0
  245. universal_mcp/applications/twitter/api_segments/users_api.py +1498 -0
  246. universal_mcp/applications/twitter/app.py +46 -0
  247. universal_mcp/applications/unipile/README.md +28 -0
  248. universal_mcp/applications/unipile/__init__.py +1 -0
  249. universal_mcp/applications/unipile/app.py +829 -0
  250. universal_mcp/applications/whatsapp/README.md +23 -0
  251. universal_mcp/applications/whatsapp/__init__.py +1 -0
  252. universal_mcp/applications/whatsapp/app.py +595 -0
  253. universal_mcp/applications/whatsapp-business/README.md +34 -0
  254. universal_mcp/applications/whatsapp-business/__init__.py +1 -0
  255. universal_mcp/applications/whatsapp-business/app.py +1065 -0
  256. universal_mcp/applications/wrike/README.md +46 -0
  257. universal_mcp/applications/wrike/__init__.py +1 -0
  258. universal_mcp/applications/wrike/app.py +1583 -0
  259. universal_mcp/applications/youtube/README.md +57 -0
  260. universal_mcp/applications/youtube/__init__.py +1 -0
  261. universal_mcp/applications/youtube/app.py +1696 -0
  262. universal_mcp/applications/zenquotes/README.md +12 -0
  263. universal_mcp/applications/zenquotes/__init__.py +1 -0
  264. universal_mcp/applications/zenquotes/app.py +31 -0
  265. universal_mcp_applications-0.1.1.dist-info/METADATA +172 -0
  266. universal_mcp_applications-0.1.1.dist-info/RECORD +268 -0
  267. universal_mcp_applications-0.1.1.dist-info/WHEEL +4 -0
  268. universal_mcp_applications-0.1.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1583 @@
1
+ from typing import Any
2
+
3
+ from universal_mcp.applications.application import APIApplication
4
+ from universal_mcp.integrations import Integration
5
+
6
+
7
+ class WrikeApp(APIApplication):
8
+ def __init__(self, integration: Integration = None, **kwargs) -> None:
9
+ """
10
+ Initializes the OfficialWrikeCollectionV21App with a specified integration and additional keyword arguments.
11
+
12
+ Args:
13
+ integration: Integration, optional. The integration instance to associate with this app. Defaults to None.
14
+ **kwargs: Additional keyword arguments passed to the superclass initializer.
15
+
16
+ Returns:
17
+ None. This constructor initializes the instance in place.
18
+ """
19
+ super().__init__(name="wrike", integration=integration, **kwargs)
20
+ self.base_url = "https://www.wrike.com/api/v4"
21
+
22
+ def get_contacts(self, deleted=None, fields=None, metadata=None) -> Any:
23
+ """
24
+ Retrieves contacts from the server with optional deleted status filtering, field selection, and metadata inclusion.
25
+
26
+ Args:
27
+ deleted: Optional[bool]. Filters contacts by deletion status. When None, returns contacts regardless of deletion status.
28
+ fields: Optional[str]. Comma-separated fields to include in each contact's response. Limits returned contact fields.
29
+ metadata: Optional[str]. Comma-separated metadata fields to include in each contact's response.
30
+
31
+ Returns:
32
+ JSON-decoded response from server containing contact data, typically as a list or dictionary based on API structure.
33
+
34
+ Raises:
35
+ HTTPError: Raised when the server returns a non-success status code, typically due to invalid parameters or server errors.
36
+
37
+ Tags:
38
+ retrieve, contacts, filter, api, important
39
+ """
40
+ url = f"{self.base_url}/contacts"
41
+ query_params = {
42
+ k: v
43
+ for k, v in [
44
+ ("deleted", deleted),
45
+ ("fields", fields),
46
+ ("metadata", metadata),
47
+ ]
48
+ if v is not None
49
+ }
50
+ response = self._get(url, params=query_params)
51
+ response.raise_for_status()
52
+ return response.json()
53
+
54
+ def get_contacts_by_contactid(self, contactId, fields=None) -> Any:
55
+ """
56
+ Retrieves contact information for a specific contact ID, optionally returning only specified fields.
57
+
58
+ Args:
59
+ contactId: The unique identifier of the contact to retrieve. Must not be None.
60
+ fields: Optional; a comma-separated string specifying which fields to include in the response. If None, all fields are returned.
61
+
62
+ Returns:
63
+ A JSON-decoded object containing the contact's details as returned by the API.
64
+
65
+ Raises:
66
+ ValueError: Raised when the 'contactId' parameter is missing.
67
+
68
+ Tags:
69
+ retrieve, contact-management
70
+ """
71
+ if contactId is None:
72
+ raise ValueError("Missing required parameter 'contactId'")
73
+ url = f"{self.base_url}/contacts/{contactId}"
74
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
75
+ response = self._get(url, params=query_params)
76
+ response.raise_for_status()
77
+ return response.json()
78
+
79
+ def put_contacts_by_contactid(
80
+ self,
81
+ contactId,
82
+ metadata=None,
83
+ currentBillRate=None,
84
+ currentCostRate=None,
85
+ jobRoleId=None,
86
+ customFields=None,
87
+ fields=None,
88
+ ) -> Any:
89
+ """
90
+ Updates an existing contact using the specified contact ID with provided details including metadata, billing/cost rates, job role, and custom fields.
91
+
92
+ Args:
93
+ contactId: The unique identifier of the contact to update (required).
94
+ metadata: Optional dictionary containing metadata for the contact.
95
+ currentBillRate: Optional current billing rate associated with the contact.
96
+ currentCostRate: Optional current cost rate associated with the contact.
97
+ jobRoleId: Optional identifier for the contact's job role.
98
+ customFields: Optional dictionary of custom field values for the contact.
99
+ fields: Optional list of field names to include in the response.
100
+
101
+ Returns:
102
+ JSON-decoded response containing updated contact details from the API.
103
+
104
+ Raises:
105
+ ValueError: When contactId parameter is not provided.
106
+ requests.HTTPError: When the API request fails due to client (4xx) or server (5xx) errors.
107
+
108
+ Tags:
109
+ update, contact, async-job, management
110
+ """
111
+ if contactId is None:
112
+ raise ValueError("Missing required parameter 'contactId'")
113
+ request_body = {
114
+ "metadata": metadata,
115
+ "currentBillRate": currentBillRate,
116
+ "currentCostRate": currentCostRate,
117
+ "jobRoleId": jobRoleId,
118
+ "customFields": customFields,
119
+ "fields": fields,
120
+ }
121
+ request_body = {k: v for k, v in request_body.items() if v is not None}
122
+ url = f"{self.base_url}/contacts/{contactId}"
123
+ query_params = {}
124
+ response = self._put(url, data=request_body, params=query_params)
125
+ response.raise_for_status()
126
+ return response.json()
127
+
128
+ def get_users_by_userid(self, userId) -> Any:
129
+ """
130
+ Retrieves user information by ID from the API endpoint.
131
+
132
+ Args:
133
+ userId: The unique identifier of the user to retrieve (required).
134
+
135
+ Returns:
136
+ JSON-decoded dictionary containing user details from the API response.
137
+
138
+ Raises:
139
+ ValueError: Raised when userId is None or missing.
140
+ HTTPError: Raised when the API request fails (non-2xx status code).
141
+
142
+ Tags:
143
+ retrieve, user-info, api, management
144
+ """
145
+ if userId is None:
146
+ raise ValueError("Missing required parameter 'userId'")
147
+ url = f"{self.base_url}/users/{userId}"
148
+ query_params = {}
149
+ response = self._get(url, params=query_params)
150
+ response.raise_for_status()
151
+ return response.json()
152
+
153
+ def put_users_by_userid(self, userId, profile=None) -> Any:
154
+ """
155
+ Updates a user's profile information by user ID using a PUT request.
156
+
157
+ Args:
158
+ userId: The unique identifier of the user. Must not be None.
159
+ profile: Optional. The profile information to update for the user. If None, no profile data is sent.
160
+
161
+ Returns:
162
+ The parsed JSON response from the server after updating the user's information.
163
+
164
+ Raises:
165
+ ValueError: Raised when the 'userId' parameter is missing.
166
+ HTTPError: Raised if the HTTP request to the server fails.
167
+
168
+ Tags:
169
+ update, user-management
170
+ """
171
+ if userId is None:
172
+ raise ValueError("Missing required parameter 'userId'")
173
+ request_body = {
174
+ "profile": profile,
175
+ }
176
+ request_body = {k: v for k, v in request_body.items() if v is not None}
177
+ url = f"{self.base_url}/users/{userId}"
178
+ query_params = {}
179
+ response = self._put(url, data=request_body, params=query_params)
180
+ response.raise_for_status()
181
+ return response.json()
182
+
183
+ def get_groups(
184
+ self, metadata=None, pageSize=None, pageToken=None, fields=None
185
+ ) -> Any:
186
+ """
187
+ Retrieves a list of groups from the API, applying optional filtering and pagination parameters.
188
+
189
+ Args:
190
+ metadata: Optional metadata to include or filter by in the group results.
191
+ pageSize: The maximum number of groups to return in the response.
192
+ pageToken: A token identifying the page of results to return, for pagination.
193
+ fields: Selector specifying a subset of fields to include in the response.
194
+
195
+ Returns:
196
+ A JSON-compatible object, typically a dictionary containing group information.
197
+
198
+ Raises:
199
+ requests.HTTPError: Raised if the HTTP request returns an unsuccessful status code.
200
+
201
+ Tags:
202
+ list, management, important
203
+ """
204
+ url = f"{self.base_url}/groups"
205
+ query_params = {
206
+ k: v
207
+ for k, v in [
208
+ ("metadata", metadata),
209
+ ("pageSize", pageSize),
210
+ ("pageToken", pageToken),
211
+ ("fields", fields),
212
+ ]
213
+ if v is not None
214
+ }
215
+ response = self._get(url, params=query_params)
216
+ response.raise_for_status()
217
+ return response.json()
218
+
219
+ def post_groups(
220
+ self, title, members=None, parent=None, avatar=None, metadata=None
221
+ ) -> Any:
222
+ """
223
+ Creates a new group with the specified title and optional details via a POST request to the groups endpoint.
224
+
225
+ Args:
226
+ title: The name of the group to create. This parameter is required.
227
+ members: Optional list of member identifiers to include in the group.
228
+ parent: Optional identifier of the parent group.
229
+ avatar: Optional avatar image or data to associate with the group.
230
+ metadata: Optional dictionary of additional metadata or custom fields for the group.
231
+
232
+ Returns:
233
+ A dictionary containing the response data representing the created group.
234
+
235
+ Raises:
236
+ ValueError: Raised when the required 'title' parameter is missing.
237
+
238
+ Tags:
239
+ create, group-management
240
+ """
241
+ if title is None:
242
+ raise ValueError("Missing required parameter 'title'")
243
+ request_body = {
244
+ "title": title,
245
+ "members": members,
246
+ "parent": parent,
247
+ "avatar": avatar,
248
+ "metadata": metadata,
249
+ }
250
+ request_body = {k: v for k, v in request_body.items() if v is not None}
251
+ url = f"{self.base_url}/groups"
252
+ query_params = {}
253
+ response = self._post(url, data=request_body, params=query_params)
254
+ response.raise_for_status()
255
+ return response.json()
256
+
257
+ def get_groups_by_groupid(self, groupId, fields=None) -> Any:
258
+ """
259
+ Retrieves details for a specific group by its group ID, optionally returning only specified fields.
260
+
261
+ Args:
262
+ groupId: The unique identifier of the group to retrieve.
263
+ fields: Optional; a comma-separated list of fields to include in the response.
264
+
265
+ Returns:
266
+ A dictionary containing the group details as returned by the API.
267
+
268
+ Raises:
269
+ ValueError: Raised if the groupId parameter is missing.
270
+
271
+ Tags:
272
+ retrieve, group-management, data-fetch
273
+ """
274
+ if groupId is None:
275
+ raise ValueError("Missing required parameter 'groupId'")
276
+ url = f"{self.base_url}/groups/{groupId}"
277
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
278
+ response = self._get(url, params=query_params)
279
+ response.raise_for_status()
280
+ return response.json()
281
+
282
+ def put_groups_by_groupid(
283
+ self,
284
+ groupId,
285
+ title=None,
286
+ addMembers=None,
287
+ removeMembers=None,
288
+ addInvitations=None,
289
+ removeInvitations=None,
290
+ parent=None,
291
+ avatar=None,
292
+ metadata=None,
293
+ ) -> Any:
294
+ """
295
+ Updates an existing group by groupId with new properties and membership changes via a PUT request.
296
+
297
+ Args:
298
+ groupId: The unique identifier of the group to update. Required.
299
+ title: Optional new title for the group.
300
+ addMembers: Optional list of member identifiers to add to the group.
301
+ removeMembers: Optional list of member identifiers to remove from the group.
302
+ addInvitations: Optional list of invitations to add to the group.
303
+ removeInvitations: Optional list of invitations to remove from the group.
304
+ parent: Optional new parent group identifier for hierarchy changes.
305
+ avatar: Optional new avatar for the group, typically a URL or encoded image data.
306
+ metadata: Optional additional metadata to attach to the group.
307
+
308
+ Returns:
309
+ A dict containing the updated group details from the server response.
310
+
311
+ Raises:
312
+ ValueError: Raised if the required 'groupId' parameter is missing.
313
+
314
+ Tags:
315
+ update, group-management, membership
316
+ """
317
+ if groupId is None:
318
+ raise ValueError("Missing required parameter 'groupId'")
319
+ request_body = {
320
+ "title": title,
321
+ "addMembers": addMembers,
322
+ "removeMembers": removeMembers,
323
+ "addInvitations": addInvitations,
324
+ "removeInvitations": removeInvitations,
325
+ "parent": parent,
326
+ "avatar": avatar,
327
+ "metadata": metadata,
328
+ }
329
+ request_body = {k: v for k, v in request_body.items() if v is not None}
330
+ url = f"{self.base_url}/groups/{groupId}"
331
+ query_params = {}
332
+ response = self._put(url, data=request_body, params=query_params)
333
+ response.raise_for_status()
334
+ return response.json()
335
+
336
+ def delete_groups_by_groupid(self, groupId) -> Any:
337
+ """
338
+ Deletes a group resource identified by the provided groupId using an HTTP DELETE request.
339
+
340
+ Args:
341
+ groupId: The unique identifier of the group to be deleted.
342
+
343
+ Returns:
344
+ The JSON-decoded response from the API after deleting the group.
345
+
346
+ Raises:
347
+ ValueError: Raised if the groupId is None.
348
+
349
+ Tags:
350
+ delete, group-management, api-call
351
+ """
352
+ if groupId is None:
353
+ raise ValueError("Missing required parameter 'groupId'")
354
+ url = f"{self.base_url}/groups/{groupId}"
355
+ query_params = {}
356
+ response = self._delete(url, params=query_params)
357
+ response.raise_for_status()
358
+ return response.json()
359
+
360
+ def put_groups_bulk(self, members) -> Any:
361
+ """
362
+ Updates multiple group memberships in bulk by sending a PUT request with the given member data.
363
+
364
+ Args:
365
+ members: List or collection of member data to be processed in bulk. Must not be None.
366
+
367
+ Returns:
368
+ Parsed JSON response from the API containing the result of the bulk update operation.
369
+
370
+ Raises:
371
+ ValueError: Raised when the required 'members' parameter is missing or None.
372
+
373
+ Tags:
374
+ bulk, update, management
375
+ """
376
+ if members is None:
377
+ raise ValueError("Missing required parameter 'members'")
378
+ request_body = {
379
+ "members": members,
380
+ }
381
+ request_body = {k: v for k, v in request_body.items() if v is not None}
382
+ url = f"{self.base_url}/groups_bulk"
383
+ query_params = {}
384
+ response = self._put(url, data=request_body, params=query_params)
385
+ response.raise_for_status()
386
+ return response.json()
387
+
388
+ def get_invitations(
389
+ self,
390
+ ) -> Any:
391
+ """
392
+ Retrieves all invitations from the server using a GET request.
393
+
394
+ Args:
395
+ None: This function takes no arguments.
396
+
397
+ Returns:
398
+ Any: JSON-decoded response containing invitation data.
399
+
400
+ Raises:
401
+ requests.HTTPError: Raised if the HTTP request fails (non-2xx status code).
402
+
403
+ Tags:
404
+ retrieve, list, invitations, async_job
405
+ """
406
+ url = f"{self.base_url}/invitations"
407
+ query_params = {}
408
+ response = self._get(url, params=query_params)
409
+ response.raise_for_status()
410
+ return response.json()
411
+
412
+ def post_invitations(
413
+ self,
414
+ email,
415
+ firstName=None,
416
+ lastName=None,
417
+ role=None,
418
+ external=None,
419
+ subject=None,
420
+ message=None,
421
+ userTypeId=None,
422
+ ) -> Any:
423
+ """
424
+ Sends an invitation email to a user with optional details such as name, role, and custom message.
425
+
426
+ Args:
427
+ email: The email address of the user to invite. Required.
428
+ firstName: The first name of the invitee. Optional.
429
+ lastName: The last name of the invitee. Optional.
430
+ role: The role to assign to the invited user. Optional.
431
+ external: Indicates if the invitation is for an external user. Optional.
432
+ subject: Custom subject line for the invitation email. Optional.
433
+ message: Custom message to include in the invitation. Optional.
434
+ userTypeId: The user type identifier to associate with the invitation. Optional.
435
+
436
+ Returns:
437
+ The server's parsed JSON response to the invitation request.
438
+
439
+ Raises:
440
+ ValueError: Raised if the required 'email' parameter is missing.
441
+
442
+ Tags:
443
+ invite, email, invitation, user-management
444
+ """
445
+ if email is None:
446
+ raise ValueError("Missing required parameter 'email'")
447
+ request_body = {
448
+ "email": email,
449
+ "firstName": firstName,
450
+ "lastName": lastName,
451
+ "role": role,
452
+ "external": external,
453
+ "subject": subject,
454
+ "message": message,
455
+ "userTypeId": userTypeId,
456
+ }
457
+ request_body = {k: v for k, v in request_body.items() if v is not None}
458
+ url = f"{self.base_url}/invitations"
459
+ query_params = {}
460
+ response = self._post(url, data=request_body, params=query_params)
461
+ response.raise_for_status()
462
+ return response.json()
463
+
464
+ def put_invitations_by_invitationid(
465
+ self, invitationId, resend=None, role=None, external=None, userTypeId=None
466
+ ) -> Any:
467
+ """
468
+ Updates an existing invitation by its unique ID with optional parameters, handling conditional updates and API communication.
469
+
470
+ Args:
471
+ invitationId: The unique identifier of the invitation to update (required).
472
+ resend: Optional boolean indicating whether to resend the invitation.
473
+ role: Optional role assignment for the invitation recipient.
474
+ external: Optional flag marking the invitation as external/internal.
475
+ userTypeId: Optional identifier specifying the user type for the invitation.
476
+
477
+ Returns:
478
+ Dictionary containing the updated invitation resource from the API.
479
+
480
+ Raises:
481
+ ValueError: When 'invitationId' is not provided.
482
+ HTTPError: When the API request fails (raised via response.raise_for_status()).
483
+
484
+ Tags:
485
+ update, invitation, api, async-job, management
486
+ """
487
+ if invitationId is None:
488
+ raise ValueError("Missing required parameter 'invitationId'")
489
+ request_body = {
490
+ "resend": resend,
491
+ "role": role,
492
+ "external": external,
493
+ "userTypeId": userTypeId,
494
+ }
495
+ request_body = {k: v for k, v in request_body.items() if v is not None}
496
+ url = f"{self.base_url}/invitations/{invitationId}"
497
+ query_params = {}
498
+ response = self._put(url, data=request_body, params=query_params)
499
+ response.raise_for_status()
500
+ return response.json()
501
+
502
+ def delete_invitations_by_invitationid(self, invitationId) -> Any:
503
+ """
504
+ Deletes a specific invitation using its unique identifier
505
+
506
+ Args:
507
+ invitationId: The unique identifier of the invitation to delete (required)
508
+
509
+ Returns:
510
+ JSON-decoded response containing the API result after deletion
511
+
512
+ Raises:
513
+ ValueError: Raised when invitationId is not provided
514
+ requests.exceptions.HTTPError: Raised for HTTP request failures (e.g., invalid invitation ID or network issues)
515
+
516
+ Tags:
517
+ delete, invitation, api, management
518
+ """
519
+ if invitationId is None:
520
+ raise ValueError("Missing required parameter 'invitationId'")
521
+ url = f"{self.base_url}/invitations/{invitationId}"
522
+ query_params = {}
523
+ response = self._delete(url, params=query_params)
524
+ response.raise_for_status()
525
+ return response.json()
526
+
527
+ def get_a_ccount(self, fields=None) -> Any:
528
+ """
529
+ Retrieves account information from the API, optionally including only specified fields.
530
+
531
+ Args:
532
+ fields: Optional string. A comma-separated string of field names to include in the response. If None, all default fields are returned.
533
+
534
+ Returns:
535
+ The JSON-decoded response from the API containing account details.
536
+
537
+ Raises:
538
+ requests.exceptions.HTTPError: Raised when the HTTP request returns an unsuccessful status code.
539
+
540
+ Tags:
541
+ retrieve, account, api
542
+ """
543
+ url = f"{self.base_url}/account"
544
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
545
+ response = self._get(url, params=query_params)
546
+ response.raise_for_status()
547
+ return response.json()
548
+
549
+ def put_a_ccount(self, metadata=None) -> Any:
550
+ """
551
+ Sends a PUT request to update or create an account with the provided metadata and returns the server response as a JSON object.
552
+
553
+ Args:
554
+ metadata: Optional metadata to associate with the account. If provided, included in the request body. Must match the server's expected schema. Defaults to None.
555
+
556
+ Returns:
557
+ JSON-decoded Python object representing the server's response from the account API endpoint.
558
+
559
+ Raises:
560
+ HTTPError: Raised if the HTTP request fails (e.g., due to invalid metadata format, network issues, or server errors).
561
+
562
+ Tags:
563
+ put, account, metadata, async_job
564
+ """
565
+ request_body = {
566
+ "metadata": metadata,
567
+ }
568
+ request_body = {k: v for k, v in request_body.items() if v is not None}
569
+ url = f"{self.base_url}/account"
570
+ query_params = {}
571
+ response = self._put(url, data=request_body, params=query_params)
572
+ response.raise_for_status()
573
+ return response.json()
574
+
575
+ def get_workflows(
576
+ self,
577
+ ) -> Any:
578
+ """
579
+ Retrieves all workflows from the server using a GET request.
580
+
581
+ Args:
582
+ None: This function takes no arguments
583
+
584
+ Returns:
585
+ The parsed JSON response containing the list of workflows.
586
+
587
+ Raises:
588
+ requests.RequestException: Raised if there's a problem with the HTTP request to the server.
589
+
590
+ Tags:
591
+ list, fetch, workflows, management, important
592
+ """
593
+ url = f"{self.base_url}/workflows"
594
+ query_params = {}
595
+ response = self._get(url, params=query_params)
596
+ response.raise_for_status()
597
+ return response.json()
598
+
599
+ def post_workflows(self, name=None, request_body=None) -> Any:
600
+ """
601
+ Creates a new workflow by sending a POST request to the workflows endpoint with optional name and request body.
602
+
603
+ Args:
604
+ name: Optional; name of the workflow to create, included as a query parameter if provided.
605
+ request_body: Optional; request body containing workflow details, provided as the data payload for the POST request.
606
+
607
+ Returns:
608
+ JSON-decoded response from the server containing details of the created workflow.
609
+
610
+ Raises:
611
+ HTTPError: Raised when the server returns a 4XX/5XX status code, indicating a failed request.
612
+
613
+ Tags:
614
+ post, create, workflow, async_job, management
615
+ """
616
+ url = f"{self.base_url}/workflows"
617
+ query_params = {k: v for k, v in [("name", name)] if v is not None}
618
+ response = self._post(url, data=request_body, params=query_params)
619
+ response.raise_for_status()
620
+ return response.json()
621
+
622
+ def put_workflows_by_workflowid(
623
+ self, workflowId, name=None, hidden=None, request_body=None
624
+ ) -> Any:
625
+ """
626
+ Updates an existing workflow by workflow ID with optional name, hidden status, and request body data.
627
+
628
+ Args:
629
+ workflowId: The unique identifier of the workflow to update. Required.
630
+ name: An optional new name for the workflow. If provided, updates the workflow's name.
631
+ hidden: An optional boolean indicating whether the workflow should be hidden.
632
+ request_body: Optional data to include in the request body when updating the workflow.
633
+
634
+ Returns:
635
+ The updated workflow as a JSON-decoded Python object.
636
+
637
+ Raises:
638
+ ValueError: Raised when the 'workflowId' parameter is missing.
639
+
640
+ Tags:
641
+ update, workflow, management
642
+ """
643
+ if workflowId is None:
644
+ raise ValueError("Missing required parameter 'workflowId'")
645
+ url = f"{self.base_url}/workflows/{workflowId}"
646
+ query_params = {
647
+ k: v for k, v in [("name", name), ("hidden", hidden)] if v is not None
648
+ }
649
+ response = self._put(url, data=request_body, params=query_params)
650
+ response.raise_for_status()
651
+ return response.json()
652
+
653
+ def get_customfields(
654
+ self,
655
+ ) -> Any:
656
+ """
657
+ Retrieves all custom fields from the API and returns them as a parsed JSON object.
658
+
659
+ Args:
660
+ None: This function takes no arguments.
661
+
662
+ Returns:
663
+ The JSON-decoded response content containing the list of custom fields, typically as a Python dict or list, depending on the API response structure.
664
+
665
+ Raises:
666
+ requests.exceptions.HTTPError: Raised if the HTTP request returned an unsuccessful status code.
667
+
668
+ Tags:
669
+ fetch, api_call, data_retrieval
670
+ """
671
+ url = f"{self.base_url}/customfields"
672
+ query_params = {}
673
+ response = self._get(url, params=query_params)
674
+ response.raise_for_status()
675
+ return response.json()
676
+
677
+ def post_customfields(
678
+ self,
679
+ title,
680
+ type,
681
+ spaceId=None,
682
+ sharing=None,
683
+ shareds=None,
684
+ settings=None,
685
+ request_body=None,
686
+ ) -> Any:
687
+ """
688
+ Creates a custom field by sending a POST request to the customfields endpoint with the specified parameters.
689
+
690
+ Args:
691
+ title: The name of the custom field to be created.
692
+ type: The type of the custom field to be created.
693
+ spaceId: Optional identifier of the space to associate with the custom field.
694
+ sharing: Optional sharing settings for the custom field.
695
+ shareds: Optional users or groups the custom field is shared with.
696
+ settings: Optional additional settings for the custom field in string or JSON format.
697
+ request_body: Optional request body payload to include in the POST request.
698
+
699
+ Returns:
700
+ The JSON response data representing the created custom field.
701
+
702
+ Raises:
703
+ ValueError: Raised when either 'title' or 'type' is missing.
704
+
705
+ Tags:
706
+ create, custom-field, management, api-request
707
+ """
708
+ if title is None:
709
+ raise ValueError("Missing required parameter 'title'")
710
+ if type is None:
711
+ raise ValueError("Missing required parameter 'type'")
712
+ url = f"{self.base_url}/customfields"
713
+ query_params = {
714
+ k: v
715
+ for k, v in [
716
+ ("title", title),
717
+ ("type", type),
718
+ ("spaceId", spaceId),
719
+ ("sharing", sharing),
720
+ ("shareds", shareds),
721
+ ("settings", settings),
722
+ ]
723
+ if v is not None
724
+ }
725
+ response = self._post(url, data=request_body, params=query_params)
726
+ response.raise_for_status()
727
+ return response.json()
728
+
729
+ def get_customfields_by_customfieldid(self, customFieldId) -> Any:
730
+ """
731
+ Retrieves details for a custom field by its unique identifier from the API
732
+
733
+ Args:
734
+ customFieldId: The unique identifier of the custom field to retrieve
735
+
736
+ Returns:
737
+ A JSON-decoded response containing the custom field details
738
+
739
+ Raises:
740
+ ValueError: Raised when the 'customFieldId' parameter is missing or None
741
+
742
+ Tags:
743
+ retrieve, api, custom-field
744
+ """
745
+ if customFieldId is None:
746
+ raise ValueError("Missing required parameter 'customFieldId'")
747
+ url = f"{self.base_url}/customfields/{customFieldId}"
748
+ query_params = {}
749
+ response = self._get(url, params=query_params)
750
+ response.raise_for_status()
751
+ return response.json()
752
+
753
+ def put_customfields_by_customfieldid(
754
+ self,
755
+ customFieldId,
756
+ title=None,
757
+ type=None,
758
+ changeScope=None,
759
+ spaceId=None,
760
+ sharing=None,
761
+ addShareds=None,
762
+ removeShareds=None,
763
+ settings=None,
764
+ addMirrors=None,
765
+ removeMirrors=None,
766
+ ) -> Any:
767
+ """
768
+ Updates a custom field specified by its ID with the provided parameters.
769
+
770
+ Args:
771
+ customFieldId: The unique identifier of the custom field to update.
772
+ title: Optional new title for the custom field.
773
+ type: Optional new field type.
774
+ changeScope: Optional scope for tracking or permission changes.
775
+ spaceId: Optional identifier of the space associated with the custom field.
776
+ sharing: Optional sharing configuration or permissions.
777
+ addShareds: Optional list of users or entities to add to the shared list.
778
+ removeShareds: Optional list of users or entities to remove from the shared list.
779
+ settings: Optional dictionary with additional settings for the custom field.
780
+ addMirrors: Optional list of entities to add as mirrors.
781
+ removeMirrors: Optional list of entities to remove as mirrors.
782
+
783
+ Returns:
784
+ The server response as a JSON-decoded object containing the updated custom field data.
785
+
786
+ Raises:
787
+ ValueError: Raised when the required 'customFieldId' parameter is missing.
788
+
789
+ Tags:
790
+ update, custom-field, http-put, management
791
+ """
792
+ if customFieldId is None:
793
+ raise ValueError("Missing required parameter 'customFieldId'")
794
+ url = f"{self.base_url}/customfields/{customFieldId}"
795
+ query_params = {
796
+ k: v
797
+ for k, v in [
798
+ ("title", title),
799
+ ("type", type),
800
+ ("changeScope", changeScope),
801
+ ("spaceId", spaceId),
802
+ ("sharing", sharing),
803
+ ("addShareds", addShareds),
804
+ ("removeShareds", removeShareds),
805
+ ("settings", settings),
806
+ ("addMirrors", addMirrors),
807
+ ("removeMirrors", removeMirrors),
808
+ ]
809
+ if v is not None
810
+ }
811
+ response = self._put(url, data={}, params=query_params)
812
+ response.raise_for_status()
813
+ return response.json()
814
+
815
+ def delete_customfields_by_customfieldid(self, customFieldId) -> Any:
816
+ """
817
+ Deletes a custom field resource identified by its custom field ID.
818
+
819
+ Args:
820
+ customFieldId: The unique identifier of the custom field to delete.
821
+
822
+ Returns:
823
+ The server response as a deserialized JSON object, typically containing the result of the delete operation.
824
+
825
+ Raises:
826
+ ValueError: Raised when the 'customFieldId' parameter is missing.
827
+
828
+ Tags:
829
+ delete, custom-field, management
830
+ """
831
+ if customFieldId is None:
832
+ raise ValueError("Missing required parameter 'customFieldId'")
833
+ url = f"{self.base_url}/customfields/{customFieldId}"
834
+ query_params = {}
835
+ response = self._delete(url, params=query_params)
836
+ response.raise_for_status()
837
+ return response.json()
838
+
839
+ def get_folders(
840
+ self,
841
+ permalink=None,
842
+ descendants=None,
843
+ metadata=None,
844
+ customFields=None,
845
+ updatedDate=None,
846
+ withInvitations=None,
847
+ project=None,
848
+ deleted=None,
849
+ contractTypes=None,
850
+ plainTextCustomFields=None,
851
+ customItemTypes=None,
852
+ pageSize=None,
853
+ nextPageToken=None,
854
+ fields=None,
855
+ ) -> Any:
856
+ """
857
+ Retrieves a list of folders from the API with support for filtering, pagination, and field selection.
858
+
859
+ Args:
860
+ permalink: Filter results by folder permalink.
861
+ descendants: Include descendant folders if True.
862
+ metadata: Filter folders by matching metadata fields.
863
+ customFields: Filter results by custom field values.
864
+ updatedDate: Only return folders updated on or after this date (ISO 8601 format).
865
+ withInvitations: If True, include folders with active invitations.
866
+ project: Filter folders by associated project identifier.
867
+ deleted: Include deleted folders in the response if True.
868
+ contractTypes: Filter folders by contract types.
869
+ plainTextCustomFields: Filter by plain text custom fields.
870
+ customItemTypes: Filter folders by custom item types.
871
+ pageSize: Maximum number of results to return per page.
872
+ nextPageToken: Token to retrieve the next page of results.
873
+ fields: Specify which fields to include in the response.
874
+
875
+ Returns:
876
+ A JSON-decoded response from the API containing folder data and related metadata.
877
+
878
+ Raises:
879
+ requests.HTTPError: Raised if an HTTP error occurs during the API request.
880
+
881
+ Tags:
882
+ retrieve, list, filter, pagination, api-call, folders, metadata
883
+ """
884
+ url = f"{self.base_url}/folders"
885
+ query_params = {
886
+ k: v
887
+ for k, v in [
888
+ ("permalink", permalink),
889
+ ("descendants", descendants),
890
+ ("metadata", metadata),
891
+ ("customFields", customFields),
892
+ ("updatedDate", updatedDate),
893
+ ("withInvitations", withInvitations),
894
+ ("project", project),
895
+ ("deleted", deleted),
896
+ ("contractTypes", contractTypes),
897
+ ("plainTextCustomFields", plainTextCustomFields),
898
+ ("customItemTypes", customItemTypes),
899
+ ("pageSize", pageSize),
900
+ ("nextPageToken", nextPageToken),
901
+ ("fields", fields),
902
+ ]
903
+ if v is not None
904
+ }
905
+ response = self._get(url, params=query_params)
906
+ response.raise_for_status()
907
+ return response.json()
908
+
909
+ def get_folders_by_folderid_folders(
910
+ self,
911
+ folderId,
912
+ permalink=None,
913
+ descendants=None,
914
+ metadata=None,
915
+ customFields=None,
916
+ updatedDate=None,
917
+ withInvitations=None,
918
+ project=None,
919
+ contractTypes=None,
920
+ plainTextCustomFields=None,
921
+ customItemTypes=None,
922
+ pageSize=None,
923
+ nextPageToken=None,
924
+ fields=None,
925
+ ) -> Any:
926
+ """
927
+ Retrieves subfolders of a specified folder, applying optional filters and pagination parameters.
928
+
929
+ Args:
930
+ folderId: The unique identifier of the parent folder whose subfolders are to be retrieved. Required.
931
+ permalink: Filter results to subfolders with the specified permalink.
932
+ descendants: If True, include descendant folders recursively in the results.
933
+ metadata: Filter subfolders by associated metadata.
934
+ customFields: Filter subfolders by custom field values.
935
+ updatedDate: Filter subfolders updated on or after the specified date.
936
+ withInvitations: If True, include invitation information with subfolders.
937
+ project: Filter subfolders belonging to a specific project.
938
+ contractTypes: Filter subfolders by contract types.
939
+ plainTextCustomFields: Filter subfolders by plain text custom fields.
940
+ customItemTypes: Filter subfolders by custom item types.
941
+ pageSize: Maximum number of subfolders to return per request, for pagination.
942
+ nextPageToken: Token for retrieving the next page of results.
943
+ fields: Specify fields to include in the response for each folder.
944
+
945
+ Returns:
946
+ A JSON object containing the list of subfolders matching the criteria, along with pagination tokens and any requested metadata.
947
+
948
+ Raises:
949
+ ValueError: Raised if the required 'folderId' parameter is missing.
950
+
951
+ Tags:
952
+ folder-management, list, filter, pagination
953
+ """
954
+ if folderId is None:
955
+ raise ValueError("Missing required parameter 'folderId'")
956
+ url = f"{self.base_url}/folders/{folderId}/folders"
957
+ query_params = {
958
+ k: v
959
+ for k, v in [
960
+ ("permalink", permalink),
961
+ ("descendants", descendants),
962
+ ("metadata", metadata),
963
+ ("customFields", customFields),
964
+ ("updatedDate", updatedDate),
965
+ ("withInvitations", withInvitations),
966
+ ("project", project),
967
+ ("contractTypes", contractTypes),
968
+ ("plainTextCustomFields", plainTextCustomFields),
969
+ ("customItemTypes", customItemTypes),
970
+ ("pageSize", pageSize),
971
+ ("nextPageToken", nextPageToken),
972
+ ("fields", fields),
973
+ ]
974
+ if v is not None
975
+ }
976
+ response = self._get(url, params=query_params)
977
+ response.raise_for_status()
978
+ return response.json()
979
+
980
+ def post_folders_by_folderid_folders(
981
+ self,
982
+ folderId,
983
+ title,
984
+ description=None,
985
+ shareds=None,
986
+ metadata=None,
987
+ customFields=None,
988
+ customColumns=None,
989
+ project=None,
990
+ userAccessRoles=None,
991
+ withInvitations=None,
992
+ customItemTypeId=None,
993
+ plainTextCustomFields=None,
994
+ fields=None,
995
+ ) -> Any:
996
+ """
997
+ Creates a new subfolder within a specified folder by folder ID, with configurable attributes such as title, description, sharing, metadata, and permissions.
998
+
999
+ Args:
1000
+ folderId: The ID of the parent folder in which to create the new subfolder. Required.
1001
+ title: The title of the new subfolder. Required.
1002
+ description: An optional description for the subfolder.
1003
+ shareds: Optional list of user or group IDs to share the subfolder with.
1004
+ metadata: Optional metadata to associate with the subfolder.
1005
+ customFields: Optional custom fields to set for the subfolder.
1006
+ customColumns: Optional custom columns configuration.
1007
+ project: Optional project identifier to associate with the subfolder.
1008
+ userAccessRoles: Optional list of user access roles to assign to the subfolder.
1009
+ withInvitations: If True, send invitations to shared users or groups. Optional.
1010
+ customItemTypeId: Optional custom item type identifier for the subfolder.
1011
+ plainTextCustomFields: Optional plain text custom fields to set for the subfolder.
1012
+ fields: Optional list of specific fields to include in the response.
1013
+
1014
+ Returns:
1015
+ The newly created subfolder object as returned by the API.
1016
+
1017
+ Raises:
1018
+ ValueError: Raised when either of the required parameters 'folderId' or 'title' is missing.
1019
+
1020
+ Tags:
1021
+ create, subfolder, folder, management
1022
+ """
1023
+ if folderId is None:
1024
+ raise ValueError("Missing required parameter 'folderId'")
1025
+ if title is None:
1026
+ raise ValueError("Missing required parameter 'title'")
1027
+ request_body = {
1028
+ "title": title,
1029
+ "description": description,
1030
+ "shareds": shareds,
1031
+ "metadata": metadata,
1032
+ "customFields": customFields,
1033
+ "customColumns": customColumns,
1034
+ "project": project,
1035
+ "userAccessRoles": userAccessRoles,
1036
+ "withInvitations": withInvitations,
1037
+ "customItemTypeId": customItemTypeId,
1038
+ "plainTextCustomFields": plainTextCustomFields,
1039
+ "fields": fields,
1040
+ }
1041
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1042
+ url = f"{self.base_url}/folders/{folderId}/folders"
1043
+ query_params = {}
1044
+ response = self._post(url, data=request_body, params=query_params)
1045
+ response.raise_for_status()
1046
+ return response.json()
1047
+
1048
+ def delete_folders_by_folderid(self, folderId) -> Any:
1049
+ """
1050
+ Deletes a folder resource identified by its folder ID via an HTTP DELETE request.
1051
+
1052
+ Args:
1053
+ folderId: The unique identifier of the folder to delete. Must not be None.
1054
+
1055
+ Returns:
1056
+ The parsed JSON response from the server if the deletion is successful.
1057
+
1058
+ Raises:
1059
+ ValueError: Raised when the folder ID is missing (i.e., None).
1060
+ HTTPError: Raised if the HTTP request fails.
1061
+
1062
+ Tags:
1063
+ delete, folders, async_job, management
1064
+ """
1065
+ if folderId is None:
1066
+ raise ValueError("Missing required parameter 'folderId'")
1067
+ url = f"{self.base_url}/folders/{folderId}"
1068
+ query_params = {}
1069
+ response = self._delete(url, params=query_params)
1070
+ response.raise_for_status()
1071
+ return response.json()
1072
+
1073
+ def put_folders_by_folderid(
1074
+ self,
1075
+ folderId,
1076
+ title=None,
1077
+ description=None,
1078
+ addParents=None,
1079
+ removeParents=None,
1080
+ addShareds=None,
1081
+ removeShareds=None,
1082
+ metadata=None,
1083
+ restore=None,
1084
+ customFields=None,
1085
+ customColumns=None,
1086
+ clearCustomColumns=None,
1087
+ project=None,
1088
+ addAccessRoles=None,
1089
+ removeAccessRoles=None,
1090
+ withInvitations=None,
1091
+ convertToCustomItemType=None,
1092
+ plainTextCustomFields=None,
1093
+ fields=None,
1094
+ ) -> Any:
1095
+ """
1096
+ Updates a folder's properties and relationships using a PUT request, allowing comprehensive modifications including metadata, access roles, and parent associations.
1097
+
1098
+ Args:
1099
+ folderId: str. The unique identifier of the folder to update (required).
1100
+ title: str, optional. New title for the folder.
1101
+ description: str, optional. Updated description of the folder.
1102
+ addParents: list or str, optional. Parent folder IDs to add to this folder.
1103
+ removeParents: list or str, optional. Parent folder IDs to remove from this folder.
1104
+ addShareds: list or str, optional. Accounts to share this folder with.
1105
+ removeShareds: list or str, optional. Shared accounts to remove from this folder.
1106
+ metadata: dict, optional. Additional metadata to update for the folder.
1107
+ restore: bool, optional. Whether to restore a deleted folder.
1108
+ customFields: dict, optional. Custom fields and their values to set or update.
1109
+ customColumns: dict, optional. Custom columns and their values to set or update.
1110
+ clearCustomColumns: list or str, optional. Custom column fields to clear.
1111
+ project: str, optional. Associated project identifier for the folder.
1112
+ addAccessRoles: list or str, optional. Access role IDs to add to the folder.
1113
+ removeAccessRoles: list or str, optional. Access role IDs to remove from the folder.
1114
+ withInvitations: bool, optional. Whether to send invitations on access role changes.
1115
+ convertToCustomItemType: str, optional. Converts the folder to a specific custom item type.
1116
+ plainTextCustomFields: dict, optional. Plain text fields to update.
1117
+ fields: str or list, optional. Specific fields to include in the response.
1118
+
1119
+ Returns:
1120
+ dict. JSON response containing updated folder information from the API.
1121
+
1122
+ Raises:
1123
+ ValueError: Raised when 'folderId' is not provided.
1124
+ HTTPError: Raised for HTTP request failures (4XX/5XX status codes).
1125
+
1126
+ Tags:
1127
+ update, folder, put-request, async-job, management, metadata, access-control
1128
+ """
1129
+ if folderId is None:
1130
+ raise ValueError("Missing required parameter 'folderId'")
1131
+ request_body = {
1132
+ "title": title,
1133
+ "description": description,
1134
+ "addParents": addParents,
1135
+ "removeParents": removeParents,
1136
+ "addShareds": addShareds,
1137
+ "removeShareds": removeShareds,
1138
+ "metadata": metadata,
1139
+ "restore": restore,
1140
+ "customFields": customFields,
1141
+ "customColumns": customColumns,
1142
+ "clearCustomColumns": clearCustomColumns,
1143
+ "project": project,
1144
+ "addAccessRoles": addAccessRoles,
1145
+ "removeAccessRoles": removeAccessRoles,
1146
+ "withInvitations": withInvitations,
1147
+ "convertToCustomItemType": convertToCustomItemType,
1148
+ "plainTextCustomFields": plainTextCustomFields,
1149
+ "fields": fields,
1150
+ }
1151
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1152
+ url = f"{self.base_url}/folders/{folderId}"
1153
+ query_params = {}
1154
+ response = self._put(url, data=request_body, params=query_params)
1155
+ response.raise_for_status()
1156
+ return response.json()
1157
+
1158
+ def get_tasks(
1159
+ self,
1160
+ descendants=None,
1161
+ title=None,
1162
+ status=None,
1163
+ importance=None,
1164
+ startDate=None,
1165
+ dueDate=None,
1166
+ scheduledDate=None,
1167
+ createdDate=None,
1168
+ updatedDate=None,
1169
+ completedDate=None,
1170
+ authors=None,
1171
+ responsibles=None,
1172
+ responsiblePlaceholders=None,
1173
+ permalink=None,
1174
+ type=None,
1175
+ limit=None,
1176
+ sortField=None,
1177
+ sortOrder=None,
1178
+ subTasks=None,
1179
+ pageSize=None,
1180
+ nextPageToken=None,
1181
+ metadata=None,
1182
+ customField=None,
1183
+ customFields=None,
1184
+ customStatuses=None,
1185
+ withInvitations=None,
1186
+ billingTypes=None,
1187
+ plainTextCustomFields=None,
1188
+ customItemTypes=None,
1189
+ fields=None,
1190
+ ) -> Any:
1191
+ """
1192
+ Retrieves tasks from the API with optional filtering, sorting, pagination, and field selection parameters.
1193
+
1194
+ Args:
1195
+ descendants: Optional; filter tasks by descendant items or folders.
1196
+ title: Optional; filter tasks by title.
1197
+ status: Optional; filter tasks by their status.
1198
+ importance: Optional; filter tasks by importance level.
1199
+ startDate: Optional; filter tasks by their start date.
1200
+ dueDate: Optional; filter tasks by due date.
1201
+ scheduledDate: Optional; filter tasks by scheduled date.
1202
+ createdDate: Optional; filter tasks by creation date.
1203
+ updatedDate: Optional; filter tasks by last updated date.
1204
+ completedDate: Optional; filter tasks by completion date.
1205
+ authors: Optional; filter tasks by author(s).
1206
+ responsibles: Optional; filter tasks by responsible user(s).
1207
+ responsiblePlaceholders: Optional; filter by responsible placeholders.
1208
+ permalink: Optional; filter tasks by their permalink.
1209
+ type: Optional; filter tasks by type.
1210
+ limit: Optional; limit the number of returned tasks.
1211
+ sortField: Optional; field to sort the tasks by.
1212
+ sortOrder: Optional; sort order ('asc' or 'desc').
1213
+ subTasks: Optional; filter tasks by whether they are sub-tasks.
1214
+ pageSize: Optional; number of tasks per page.
1215
+ nextPageToken: Optional; token for retrieving the next page of results.
1216
+ metadata: Optional; include or filter by metadata.
1217
+ customField: Optional; filter by a specific custom field.
1218
+ customFields: Optional; filter tasks by custom fields.
1219
+ customStatuses: Optional; filter tasks by custom workflow statuses.
1220
+ withInvitations: Optional; include tasks with invitations.
1221
+ billingTypes: Optional; filter tasks by billing types.
1222
+ plainTextCustomFields: Optional; specify if custom fields should be plain text.
1223
+ customItemTypes: Optional; filter by custom item types.
1224
+ fields: Optional; select specific fields to include in the result.
1225
+
1226
+ Returns:
1227
+ The JSON-decoded API response containing a list of tasks and related metadata.
1228
+
1229
+ Raises:
1230
+ requests.exceptions.HTTPError: Raised when the API request returns an unsuccessful status code.
1231
+
1232
+ Tags:
1233
+ list, filter, api_call, async_job_support, management
1234
+ """
1235
+ url = f"{self.base_url}/tasks"
1236
+ query_params = {
1237
+ k: v
1238
+ for k, v in [
1239
+ ("descendants", descendants),
1240
+ ("title", title),
1241
+ ("status", status),
1242
+ ("importance", importance),
1243
+ ("startDate", startDate),
1244
+ ("dueDate", dueDate),
1245
+ ("scheduledDate", scheduledDate),
1246
+ ("createdDate", createdDate),
1247
+ ("updatedDate", updatedDate),
1248
+ ("completedDate", completedDate),
1249
+ ("authors", authors),
1250
+ ("responsibles", responsibles),
1251
+ ("responsiblePlaceholders", responsiblePlaceholders),
1252
+ ("permalink", permalink),
1253
+ ("type", type),
1254
+ ("limit", limit),
1255
+ ("sortField", sortField),
1256
+ ("sortOrder", sortOrder),
1257
+ ("subTasks", subTasks),
1258
+ ("pageSize", pageSize),
1259
+ ("nextPageToken", nextPageToken),
1260
+ ("metadata", metadata),
1261
+ ("customField", customField),
1262
+ ("customFields", customFields),
1263
+ ("customStatuses", customStatuses),
1264
+ ("withInvitations", withInvitations),
1265
+ ("billingTypes", billingTypes),
1266
+ ("plainTextCustomFields", plainTextCustomFields),
1267
+ ("customItemTypes", customItemTypes),
1268
+ ("fields", fields),
1269
+ ]
1270
+ if v is not None
1271
+ }
1272
+ response = self._get(url, params=query_params)
1273
+ response.raise_for_status()
1274
+ return response.json()
1275
+
1276
+ def get_tasks_by_taskid(self, taskId, fields=None) -> Any:
1277
+ """
1278
+ Retrieves a task by its ID from the remote service, optionally returning only specified fields.
1279
+
1280
+ Args:
1281
+ taskId: The unique identifier of the task to retrieve.
1282
+ fields: Optional. A comma-separated string specifying which fields to include in the response. If None, all available fields are returned.
1283
+
1284
+ Returns:
1285
+ The JSON-decoded response data containing task details, as returned by the remote API.
1286
+
1287
+ Raises:
1288
+ ValueError: Raised when the required 'taskId' parameter is missing.
1289
+
1290
+ Tags:
1291
+ task, retrieve, api, management
1292
+ """
1293
+ if taskId is None:
1294
+ raise ValueError("Missing required parameter 'taskId'")
1295
+ url = f"{self.base_url}/tasks/{taskId}"
1296
+ query_params = {k: v for k, v in [("fields", fields)] if v is not None}
1297
+ response = self._get(url, params=query_params)
1298
+ response.raise_for_status()
1299
+ return response.json()
1300
+
1301
+ def put_tasks_by_taskid(
1302
+ self,
1303
+ taskId,
1304
+ title=None,
1305
+ description=None,
1306
+ status=None,
1307
+ importance=None,
1308
+ dates=None,
1309
+ addParents=None,
1310
+ removeParents=None,
1311
+ addShareds=None,
1312
+ removeShareds=None,
1313
+ addResponsibles=None,
1314
+ removeResponsibles=None,
1315
+ addResponsiblePlaceholders=None,
1316
+ removeResponsiblePlaceholders=None,
1317
+ addFollowers=None,
1318
+ follow=None,
1319
+ priorityBefore=None,
1320
+ priorityAfter=None,
1321
+ addSuperTasks=None,
1322
+ removeSuperTasks=None,
1323
+ metadata=None,
1324
+ customFields=None,
1325
+ customStatus=None,
1326
+ restore=None,
1327
+ effortAllocation=None,
1328
+ billingType=None,
1329
+ withInvitations=None,
1330
+ convertToCustomItemType=None,
1331
+ plainTextCustomFields=None,
1332
+ fields=None,
1333
+ ) -> Any:
1334
+ """
1335
+ Updates a task's properties and relationships by ID, returning the updated task data.
1336
+
1337
+ Args:
1338
+ taskId: The unique identifier of the task to update (required).
1339
+ title: The new title for the task.
1340
+ description: The new description for the task.
1341
+ status: The new status identifier for the task.
1342
+ importance: The importance level identifier to assign.
1343
+ dates: Dictionary containing task date updates (e.g., due date, start date).
1344
+ addParents: List of parent task IDs to add to this task.
1345
+ removeParents: List of parent task IDs to remove from this task.
1346
+ addShareds: List of user IDs to add as shared users.
1347
+ removeShareds: List of user IDs to remove from shared users.
1348
+ addResponsibles: List of user IDs to add as responsible users.
1349
+ removeResponsibles: List of user IDs to remove from responsible users.
1350
+ addResponsiblePlaceholders: Placeholder IDs to add to responsible users.
1351
+ removeResponsiblePlaceholders: Placeholder IDs to remove from responsible users.
1352
+ addFollowers: User IDs to add as followers.
1353
+ follow: If True/False, follows or unfollows the task.
1354
+ priorityBefore: Task ID before which to prioritize this task.
1355
+ priorityAfter: Task ID after which to prioritize this task.
1356
+ addSuperTasks: Task IDs to add as super tasks.
1357
+ removeSuperTasks: Task IDs to remove from super tasks.
1358
+ metadata: Arbitrary metadata key-value pairs to associate.
1359
+ customFields: List of custom field update objects.
1360
+ customStatus: Custom status identifier to apply.
1361
+ restore: If True, restores a deleted task.
1362
+ effortAllocation: Effort allocation data objects.
1363
+ billingType: Billing type identifier to set.
1364
+ withInvitations: If True, sends invitations to new shared/responsible users.
1365
+ convertToCustomItemType: Identifier to convert task to custom item type.
1366
+ plainTextCustomFields: Plain text values for custom fields.
1367
+ fields: List of fields to include in the response.
1368
+
1369
+ Returns:
1370
+ Dictionary containing updated task details from the server response.
1371
+
1372
+ Raises:
1373
+ ValueError: When taskId parameter is not provided.
1374
+ HTTPError: When the API request fails (e.g., invalid parameters or server errors).
1375
+
1376
+ Tags:
1377
+ update, task-management, async, api, rest, batch
1378
+ """
1379
+ if taskId is None:
1380
+ raise ValueError("Missing required parameter 'taskId'")
1381
+ request_body = {
1382
+ "title": title,
1383
+ "description": description,
1384
+ "status": status,
1385
+ "importance": importance,
1386
+ "dates": dates,
1387
+ "addParents": addParents,
1388
+ "removeParents": removeParents,
1389
+ "addShareds": addShareds,
1390
+ "removeShareds": removeShareds,
1391
+ "addResponsibles": addResponsibles,
1392
+ "removeResponsibles": removeResponsibles,
1393
+ "addResponsiblePlaceholders": addResponsiblePlaceholders,
1394
+ "removeResponsiblePlaceholders": removeResponsiblePlaceholders,
1395
+ "addFollowers": addFollowers,
1396
+ "follow": follow,
1397
+ "priorityBefore": priorityBefore,
1398
+ "priorityAfter": priorityAfter,
1399
+ "addSuperTasks": addSuperTasks,
1400
+ "removeSuperTasks": removeSuperTasks,
1401
+ "metadata": metadata,
1402
+ "customFields": customFields,
1403
+ "customStatus": customStatus,
1404
+ "restore": restore,
1405
+ "effortAllocation": effortAllocation,
1406
+ "billingType": billingType,
1407
+ "withInvitations": withInvitations,
1408
+ "convertToCustomItemType": convertToCustomItemType,
1409
+ "plainTextCustomFields": plainTextCustomFields,
1410
+ "fields": fields,
1411
+ }
1412
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1413
+ url = f"{self.base_url}/tasks/{taskId}"
1414
+ query_params = {}
1415
+ response = self._put(url, data=request_body, params=query_params)
1416
+ response.raise_for_status()
1417
+ return response.json()
1418
+
1419
+ def delete_tasks_by_taskid(self, taskId) -> Any:
1420
+ """
1421
+ Deletes a task identified by the given task ID via an HTTP DELETE request and returns the response as a JSON object.
1422
+
1423
+ Args:
1424
+ taskId: The unique identifier of the task to be deleted. Must not be None.
1425
+
1426
+ Returns:
1427
+ A JSON object containing the API response to the delete operation.
1428
+
1429
+ Raises:
1430
+ ValueError: Raised when the required parameter 'taskId' is None.
1431
+ HTTPError: Raised if the HTTP DELETE request fails (e.g., invalid task ID or server error).
1432
+
1433
+ Tags:
1434
+ delete, http, async_job, management
1435
+ """
1436
+ if taskId is None:
1437
+ raise ValueError("Missing required parameter 'taskId'")
1438
+ url = f"{self.base_url}/tasks/{taskId}"
1439
+ query_params = {}
1440
+ response = self._delete(url, params=query_params)
1441
+ response.raise_for_status()
1442
+ return response.json()
1443
+
1444
+ def post_folders_by_folderid_tasks(
1445
+ self,
1446
+ folderId,
1447
+ title,
1448
+ description=None,
1449
+ status=None,
1450
+ importance=None,
1451
+ dates=None,
1452
+ shareds=None,
1453
+ parents=None,
1454
+ responsibles=None,
1455
+ responsiblePlaceholders=None,
1456
+ followers=None,
1457
+ follow=None,
1458
+ priorityBefore=None,
1459
+ priorityAfter=None,
1460
+ superTasks=None,
1461
+ metadata=None,
1462
+ customFields=None,
1463
+ customStatus=None,
1464
+ effortAllocation=None,
1465
+ billingType=None,
1466
+ withInvitations=None,
1467
+ customItemTypeId=None,
1468
+ plainTextCustomFields=None,
1469
+ fields=None,
1470
+ ) -> Any:
1471
+ """
1472
+ Creates a new task in a specified folder with configurable attributes including title, description, assignments, and custom fields.
1473
+
1474
+ Args:
1475
+ folderId: str or int. Required ID of the folder where the task is created.
1476
+ title: str. Required title of the task.
1477
+ description: str, optional. Detailed task description.
1478
+ status: str, optional. Task status (e.g., 'active', 'completed').
1479
+ importance: str or int, optional. Importance level of the task.
1480
+ dates: dict or list, optional. Date-related details (e.g., start/due dates).
1481
+ shareds: list, optional. Users to share the task with.
1482
+ parents: list, optional. Parent task IDs if this is a subtask.
1483
+ responsibles: list, optional. Users responsible for the task.
1484
+ responsiblePlaceholders: list, optional. Placeholder users assigned as responsible.
1485
+ followers: list, optional. Users to follow task updates.
1486
+ follow: bool, optional. Whether the current user should follow the task.
1487
+ priorityBefore: str or int, optional. ID of task to prioritize before.
1488
+ priorityAfter: str or int, optional. ID of task to prioritize after.
1489
+ superTasks: list, optional. IDs of super tasks this task belongs to.
1490
+ metadata: dict, optional. Arbitrary metadata attached to the task.
1491
+ customFields: dict or list, optional. Custom field values.
1492
+ customStatus: str, optional. Custom status value.
1493
+ effortAllocation: dict or list, optional. Effort allocation details.
1494
+ billingType: str, optional. Billing details/type.
1495
+ withInvitations: bool, optional. Send invitations to added users.
1496
+ customItemTypeId: str or int, optional. Custom item type identifier.
1497
+ plainTextCustomFields: dict or list, optional. Plain text custom fields.
1498
+ fields: list or str, optional. Fields to include in the API response.
1499
+
1500
+ Returns:
1501
+ dict. JSON response containing details of the created task.
1502
+
1503
+ Raises:
1504
+ ValueError: If 'folderId' or 'title' parameters are missing.
1505
+ HTTPError: If the API request fails (via response.raise_for_status()).
1506
+
1507
+ Tags:
1508
+ create, task-management, async-job, api-integration
1509
+ """
1510
+ if folderId is None:
1511
+ raise ValueError("Missing required parameter 'folderId'")
1512
+ if title is None:
1513
+ raise ValueError("Missing required parameter 'title'")
1514
+ request_body = {
1515
+ "title": title,
1516
+ "description": description,
1517
+ "status": status,
1518
+ "importance": importance,
1519
+ "dates": dates,
1520
+ "shareds": shareds,
1521
+ "parents": parents,
1522
+ "responsibles": responsibles,
1523
+ "responsiblePlaceholders": responsiblePlaceholders,
1524
+ "followers": followers,
1525
+ "follow": follow,
1526
+ "priorityBefore": priorityBefore,
1527
+ "priorityAfter": priorityAfter,
1528
+ "superTasks": superTasks,
1529
+ "metadata": metadata,
1530
+ "customFields": customFields,
1531
+ "customStatus": customStatus,
1532
+ "effortAllocation": effortAllocation,
1533
+ "billingType": billingType,
1534
+ "withInvitations": withInvitations,
1535
+ "customItemTypeId": customItemTypeId,
1536
+ "plainTextCustomFields": plainTextCustomFields,
1537
+ "fields": fields,
1538
+ }
1539
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1540
+ url = f"{self.base_url}/folders/{folderId}/tasks"
1541
+ query_params = {}
1542
+ response = self._post(url, data=request_body, params=query_params)
1543
+ response.raise_for_status()
1544
+ return response.json()
1545
+
1546
+ def list_tools(self):
1547
+ return [
1548
+ self.get_contacts,
1549
+ self.get_contacts_by_contactid,
1550
+ self.put_contacts_by_contactid,
1551
+ self.get_users_by_userid,
1552
+ self.put_users_by_userid,
1553
+ self.get_groups,
1554
+ self.post_groups,
1555
+ self.get_groups_by_groupid,
1556
+ self.put_groups_by_groupid,
1557
+ self.delete_groups_by_groupid,
1558
+ self.put_groups_bulk,
1559
+ self.get_invitations,
1560
+ self.post_invitations,
1561
+ self.put_invitations_by_invitationid,
1562
+ self.delete_invitations_by_invitationid,
1563
+ self.get_a_ccount,
1564
+ self.put_a_ccount,
1565
+ self.get_workflows,
1566
+ self.post_workflows,
1567
+ self.put_workflows_by_workflowid,
1568
+ self.get_customfields,
1569
+ self.post_customfields,
1570
+ self.get_customfields_by_customfieldid,
1571
+ self.put_customfields_by_customfieldid,
1572
+ self.delete_customfields_by_customfieldid,
1573
+ self.get_folders,
1574
+ self.get_folders_by_folderid_folders,
1575
+ self.post_folders_by_folderid_folders,
1576
+ self.delete_folders_by_folderid,
1577
+ self.put_folders_by_folderid,
1578
+ self.get_tasks,
1579
+ self.get_tasks_by_taskid,
1580
+ self.put_tasks_by_taskid,
1581
+ self.delete_tasks_by_taskid,
1582
+ self.post_folders_by_folderid_tasks,
1583
+ ]