universal-mcp 0.1.8rc2__py3-none-any.whl → 0.1.8rc3__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.
- universal_mcp/__init__.py +0 -2
- universal_mcp/analytics.py +75 -0
- universal_mcp/applications/application.py +27 -5
- universal_mcp/applications/calendly/app.py +413 -160
- universal_mcp/applications/coda/README.md +133 -0
- universal_mcp/applications/coda/__init__.py +0 -0
- universal_mcp/applications/coda/app.py +3704 -0
- universal_mcp/applications/e2b/app.py +6 -7
- universal_mcp/applications/firecrawl/app.py +1 -1
- universal_mcp/applications/github/app.py +41 -42
- universal_mcp/applications/google_calendar/app.py +20 -20
- universal_mcp/applications/google_docs/app.py +22 -29
- universal_mcp/applications/google_drive/app.py +53 -59
- universal_mcp/applications/google_mail/app.py +40 -40
- universal_mcp/applications/google_sheet/app.py +44 -51
- universal_mcp/applications/markitdown/app.py +4 -4
- universal_mcp/applications/notion/app.py +93 -83
- universal_mcp/applications/perplexity/app.py +5 -5
- universal_mcp/applications/reddit/app.py +32 -32
- universal_mcp/applications/resend/app.py +4 -4
- universal_mcp/applications/serpapi/app.py +4 -4
- universal_mcp/applications/tavily/app.py +4 -4
- universal_mcp/applications/wrike/app.py +566 -226
- universal_mcp/applications/youtube/app.py +626 -166
- universal_mcp/applications/zenquotes/app.py +3 -3
- universal_mcp/exceptions.py +1 -0
- universal_mcp/integrations/__init__.py +11 -2
- universal_mcp/integrations/integration.py +2 -2
- universal_mcp/logger.py +3 -56
- universal_mcp/servers/__init__.py +2 -1
- universal_mcp/servers/server.py +76 -77
- universal_mcp/stores/store.py +5 -3
- universal_mcp/tools/__init__.py +1 -1
- universal_mcp/tools/adapters.py +4 -1
- universal_mcp/tools/func_metadata.py +5 -6
- universal_mcp/tools/tools.py +108 -51
- universal_mcp/utils/docgen.py +121 -69
- universal_mcp/utils/docstring_parser.py +44 -21
- universal_mcp/utils/dump_app_tools.py +33 -23
- universal_mcp/utils/openapi.py +121 -47
- {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/METADATA +2 -2
- universal_mcp-0.1.8rc3.dist-info/RECORD +75 -0
- universal_mcp-0.1.8rc2.dist-info/RECORD +0 -71
- {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.8rc2.dist-info → universal_mcp-0.1.8rc3.dist-info}/entry_points.txt +0 -0
@@ -8,15 +8,15 @@ class CalendlyApp(APIApplication):
|
|
8
8
|
def __init__(self, integration: Integration = None, **kwargs) -> None:
|
9
9
|
"""
|
10
10
|
Initializes a new instance of the Calendly API application with the specified integration and additional configuration options.
|
11
|
-
|
11
|
+
|
12
12
|
Args:
|
13
13
|
integration: An optional Integration object to associate with the Calendly API application. Defaults to None.
|
14
14
|
**kwargs: Arbitrary keyword arguments that are passed to the superclass initializer for additional configuration.
|
15
|
-
|
15
|
+
|
16
16
|
Returns:
|
17
17
|
None
|
18
18
|
"""
|
19
|
-
super().__init__(name=
|
19
|
+
super().__init__(name="calendly", integration=integration, **kwargs)
|
20
20
|
self.base_url = "https://api.calendly.com"
|
21
21
|
|
22
22
|
def _get_headers(self):
|
@@ -29,12 +29,14 @@ class CalendlyApp(APIApplication):
|
|
29
29
|
return {
|
30
30
|
"Authorization": f"Bearer {credentials['access_token']}",
|
31
31
|
"Content-Type": "application/json",
|
32
|
-
}
|
32
|
+
}
|
33
33
|
|
34
|
-
def list_event_invitees(
|
34
|
+
def list_event_invitees(
|
35
|
+
self, uuid, status=None, sort=None, email=None, page_token=None, count=None
|
36
|
+
) -> dict[str, Any]:
|
35
37
|
"""
|
36
38
|
Retrieves a list of invitees for a specific scheduled event, optionally filtered and paginated by status, email, sorting order, and paging parameters.
|
37
|
-
|
39
|
+
|
38
40
|
Args:
|
39
41
|
uuid: str. The unique identifier of the scheduled event for which to list invitees.
|
40
42
|
status: Optional[str]. Filter invitees by their invitation status (e.g., accepted, declined, pending).
|
@@ -42,14 +44,24 @@ class CalendlyApp(APIApplication):
|
|
42
44
|
email: Optional[str]. Filter invitees by their email address.
|
43
45
|
page_token: Optional[str]. A token indicating the page of results to retrieve for pagination.
|
44
46
|
count: Optional[int]. The maximum number of invitees to return per page.
|
45
|
-
|
47
|
+
|
46
48
|
Returns:
|
47
49
|
dict[str, Any]: A dictionary containing the list of event invitees and pagination details, as returned by the API.
|
48
50
|
"""
|
49
51
|
if uuid is None:
|
50
52
|
raise ValueError("Missing required parameter 'uuid'")
|
51
53
|
url = f"{self.base_url}/scheduled_events/{uuid}/invitees"
|
52
|
-
query_params = {
|
54
|
+
query_params = {
|
55
|
+
k: v
|
56
|
+
for k, v in [
|
57
|
+
("status", status),
|
58
|
+
("sort", sort),
|
59
|
+
("email", email),
|
60
|
+
("page_token", page_token),
|
61
|
+
("count", count),
|
62
|
+
]
|
63
|
+
if v is not None
|
64
|
+
}
|
53
65
|
response = self._get(url, params=query_params)
|
54
66
|
response.raise_for_status()
|
55
67
|
return response.json()
|
@@ -57,10 +69,10 @@ class CalendlyApp(APIApplication):
|
|
57
69
|
def get_event(self, uuid) -> dict[str, Any]:
|
58
70
|
"""
|
59
71
|
Retrieves the details of a scheduled event given its UUID.
|
60
|
-
|
72
|
+
|
61
73
|
Args:
|
62
74
|
uuid: str. The unique identifier of the scheduled event to retrieve.
|
63
|
-
|
75
|
+
|
64
76
|
Returns:
|
65
77
|
dict[str, Any]: A dictionary containing the scheduled event details as returned by the API.
|
66
78
|
"""
|
@@ -75,11 +87,11 @@ class CalendlyApp(APIApplication):
|
|
75
87
|
def get_event_invitee(self, event_uuid, invitee_uuid) -> dict[str, Any]:
|
76
88
|
"""
|
77
89
|
Retrieves details about a specific invitee for a given scheduled event.
|
78
|
-
|
90
|
+
|
79
91
|
Args:
|
80
92
|
event_uuid: The unique identifier of the scheduled event.
|
81
93
|
invitee_uuid: The unique identifier of the invitee to retrieve.
|
82
|
-
|
94
|
+
|
83
95
|
Returns:
|
84
96
|
A dictionary containing invitee details as returned by the API.
|
85
97
|
"""
|
@@ -93,10 +105,22 @@ class CalendlyApp(APIApplication):
|
|
93
105
|
response.raise_for_status()
|
94
106
|
return response.json()
|
95
107
|
|
96
|
-
def list_events(
|
108
|
+
def list_events(
|
109
|
+
self,
|
110
|
+
user=None,
|
111
|
+
organization=None,
|
112
|
+
invitee_email=None,
|
113
|
+
status=None,
|
114
|
+
sort=None,
|
115
|
+
min_start_time=None,
|
116
|
+
max_start_time=None,
|
117
|
+
page_token=None,
|
118
|
+
count=None,
|
119
|
+
group=None,
|
120
|
+
) -> dict[str, Any]:
|
97
121
|
"""
|
98
122
|
Retrieves a list of scheduled events filtered by optional user, organization, invitee email, status, date range, sorting, and pagination criteria.
|
99
|
-
|
123
|
+
|
100
124
|
Args:
|
101
125
|
user: Optional[str]: The user identifier to filter events by a specific user.
|
102
126
|
organization: Optional[str]: The organization identifier to filter events by a specific organization.
|
@@ -108,12 +132,27 @@ class CalendlyApp(APIApplication):
|
|
108
132
|
page_token: Optional[str]: Token for fetching the next page of results.
|
109
133
|
count: Optional[int]: The maximum number of events to return.
|
110
134
|
group: Optional[str]: Group identifier to filter events by group.
|
111
|
-
|
135
|
+
|
112
136
|
Returns:
|
113
137
|
dict[str, Any]: A dictionary containing the list of scheduled events and associated metadata.
|
114
138
|
"""
|
115
139
|
url = f"{self.base_url}/scheduled_events"
|
116
|
-
query_params = {
|
140
|
+
query_params = {
|
141
|
+
k: v
|
142
|
+
for k, v in [
|
143
|
+
("user", user),
|
144
|
+
("organization", organization),
|
145
|
+
("invitee_email", invitee_email),
|
146
|
+
("status", status),
|
147
|
+
("sort", sort),
|
148
|
+
("min_start_time", min_start_time),
|
149
|
+
("max_start_time", max_start_time),
|
150
|
+
("page_token", page_token),
|
151
|
+
("count", count),
|
152
|
+
("group", group),
|
153
|
+
]
|
154
|
+
if v is not None
|
155
|
+
}
|
117
156
|
response = self._get(url, params=query_params)
|
118
157
|
response.raise_for_status()
|
119
158
|
return response.json()
|
@@ -121,10 +160,10 @@ class CalendlyApp(APIApplication):
|
|
121
160
|
def get_event_type(self, uuid) -> dict[str, Any]:
|
122
161
|
"""
|
123
162
|
Retrieves the event type details for the specified UUID from the API.
|
124
|
-
|
163
|
+
|
125
164
|
Args:
|
126
165
|
uuid: str. The unique identifier of the event type to retrieve.
|
127
|
-
|
166
|
+
|
128
167
|
Returns:
|
129
168
|
dict. A dictionary containing the event type details as returned by the API.
|
130
169
|
"""
|
@@ -136,10 +175,20 @@ class CalendlyApp(APIApplication):
|
|
136
175
|
response.raise_for_status()
|
137
176
|
return response.json()
|
138
177
|
|
139
|
-
def list_user_sevent_types(
|
178
|
+
def list_user_sevent_types(
|
179
|
+
self,
|
180
|
+
active=None,
|
181
|
+
organization=None,
|
182
|
+
user=None,
|
183
|
+
user_availability_schedule=None,
|
184
|
+
sort=None,
|
185
|
+
admin_managed=None,
|
186
|
+
page_token=None,
|
187
|
+
count=None,
|
188
|
+
) -> dict[str, Any]:
|
140
189
|
"""
|
141
190
|
Retrieves a list of user event types with optional filtering, sorting, and pagination parameters.
|
142
|
-
|
191
|
+
|
143
192
|
Args:
|
144
193
|
active: Optional; filter event types by active status (bool or compatible).
|
145
194
|
organization: Optional; filter event types by organization identifier.
|
@@ -149,12 +198,25 @@ class CalendlyApp(APIApplication):
|
|
149
198
|
admin_managed: Optional; filter event types managed by an admin (bool or compatible).
|
150
199
|
page_token: Optional; token for paginating through result pages.
|
151
200
|
count: Optional; maximum number of event types to return.
|
152
|
-
|
201
|
+
|
153
202
|
Returns:
|
154
203
|
A dictionary containing the list of user event types and associated pagination or metadata information.
|
155
204
|
"""
|
156
205
|
url = f"{self.base_url}/event_types"
|
157
|
-
query_params = {
|
206
|
+
query_params = {
|
207
|
+
k: v
|
208
|
+
for k, v in [
|
209
|
+
("active", active),
|
210
|
+
("organization", organization),
|
211
|
+
("user", user),
|
212
|
+
("user_availability_schedule", user_availability_schedule),
|
213
|
+
("sort", sort),
|
214
|
+
("admin_managed", admin_managed),
|
215
|
+
("page_token", page_token),
|
216
|
+
("count", count),
|
217
|
+
]
|
218
|
+
if v is not None
|
219
|
+
}
|
158
220
|
response = self._get(url, params=query_params)
|
159
221
|
response.raise_for_status()
|
160
222
|
return response.json()
|
@@ -162,10 +224,10 @@ class CalendlyApp(APIApplication):
|
|
162
224
|
def get_user(self, uuid) -> dict[str, Any]:
|
163
225
|
"""
|
164
226
|
Retrieves detailed user information for a given UUID from the remote API.
|
165
|
-
|
227
|
+
|
166
228
|
Args:
|
167
229
|
uuid: The unique identifier (UUID) of the user to retrieve.
|
168
|
-
|
230
|
+
|
169
231
|
Returns:
|
170
232
|
A dictionary containing the user's details as returned by the API.
|
171
233
|
"""
|
@@ -177,13 +239,15 @@ class CalendlyApp(APIApplication):
|
|
177
239
|
response.raise_for_status()
|
178
240
|
return response.json()
|
179
241
|
|
180
|
-
def get_current_user(
|
242
|
+
def get_current_user(
|
243
|
+
self,
|
244
|
+
) -> dict[str, Any]:
|
181
245
|
"""
|
182
246
|
Retrieves information about the currently authenticated user from the API.
|
183
|
-
|
247
|
+
|
184
248
|
Args:
|
185
249
|
self: Instance of the class containing API connection details and HTTP methods.
|
186
|
-
|
250
|
+
|
187
251
|
Returns:
|
188
252
|
A dictionary containing the current user's information as returned by the API.
|
189
253
|
"""
|
@@ -193,10 +257,12 @@ class CalendlyApp(APIApplication):
|
|
193
257
|
response.raise_for_status()
|
194
258
|
return response.json()
|
195
259
|
|
196
|
-
def list_organization_invitations(
|
260
|
+
def list_organization_invitations(
|
261
|
+
self, uuid, count=None, page_token=None, sort=None, email=None, status=None
|
262
|
+
) -> dict[str, Any]:
|
197
263
|
"""
|
198
264
|
Retrieves a paginated list of invitations for a specified organization, with optional filtering and sorting.
|
199
|
-
|
265
|
+
|
200
266
|
Args:
|
201
267
|
uuid: str. Unique identifier of the organization whose invitations are to be listed.
|
202
268
|
count: Optional[int]. Maximum number of invitations to return per page.
|
@@ -204,14 +270,24 @@ class CalendlyApp(APIApplication):
|
|
204
270
|
sort: Optional[str]. Sorting criteria for the invitations (e.g., by date or status).
|
205
271
|
email: Optional[str]. Filter invitations sent to a specific email address.
|
206
272
|
status: Optional[str]. Filter invitations by their status (e.g., pending, accepted, expired).
|
207
|
-
|
273
|
+
|
208
274
|
Returns:
|
209
275
|
dict[str, Any]: A dictionary containing the list of organization invitations and pagination information.
|
210
276
|
"""
|
211
277
|
if uuid is None:
|
212
278
|
raise ValueError("Missing required parameter 'uuid'")
|
213
279
|
url = f"{self.base_url}/organizations/{uuid}/invitations"
|
214
|
-
query_params = {
|
280
|
+
query_params = {
|
281
|
+
k: v
|
282
|
+
for k, v in [
|
283
|
+
("count", count),
|
284
|
+
("page_token", page_token),
|
285
|
+
("sort", sort),
|
286
|
+
("email", email),
|
287
|
+
("status", status),
|
288
|
+
]
|
289
|
+
if v is not None
|
290
|
+
}
|
215
291
|
response = self._get(url, params=query_params)
|
216
292
|
response.raise_for_status()
|
217
293
|
return response.json()
|
@@ -219,18 +295,18 @@ class CalendlyApp(APIApplication):
|
|
219
295
|
def invite_user_to_organization(self, uuid, email=None) -> dict[str, Any]:
|
220
296
|
"""
|
221
297
|
Sends an invitation to a specified email address to join an organization identified by its UUID.
|
222
|
-
|
298
|
+
|
223
299
|
Args:
|
224
300
|
uuid: str. The unique identifier of the organization to which the user is being invited.
|
225
301
|
email: Optional[str]. The email address of the user to invite. If None, the invite is created without an email.
|
226
|
-
|
302
|
+
|
227
303
|
Returns:
|
228
304
|
dict[str, Any]. A dictionary containing the JSON response from the API after sending the invitation.
|
229
305
|
"""
|
230
306
|
if uuid is None:
|
231
307
|
raise ValueError("Missing required parameter 'uuid'")
|
232
308
|
request_body = {
|
233
|
-
|
309
|
+
"email": email,
|
234
310
|
}
|
235
311
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
236
312
|
url = f"{self.base_url}/organizations/{uuid}/invitations"
|
@@ -242,11 +318,11 @@ class CalendlyApp(APIApplication):
|
|
242
318
|
def get_organization_invitation(self, org_uuid, uuid) -> dict[str, Any]:
|
243
319
|
"""
|
244
320
|
Retrieves a specific invitation for an organization using its unique identifiers.
|
245
|
-
|
321
|
+
|
246
322
|
Args:
|
247
323
|
org_uuid: str. The unique identifier of the organization whose invitation is to be retrieved.
|
248
324
|
uuid: str. The unique identifier of the invitation to fetch.
|
249
|
-
|
325
|
+
|
250
326
|
Returns:
|
251
327
|
dict. A dictionary containing the invitation details as returned by the API.
|
252
328
|
"""
|
@@ -263,11 +339,11 @@ class CalendlyApp(APIApplication):
|
|
263
339
|
def revoke_user_sorganization_invitation(self, org_uuid, uuid) -> Any:
|
264
340
|
"""
|
265
341
|
Revokes a user's invitation to an organization by deleting the specified invitation resource.
|
266
|
-
|
342
|
+
|
267
343
|
Args:
|
268
344
|
org_uuid: The unique identifier of the organization from which the user's invitation will be revoked.
|
269
345
|
uuid: The unique identifier of the invitation to be revoked.
|
270
|
-
|
346
|
+
|
271
347
|
Returns:
|
272
348
|
The JSON response from the API after successfully revoking the invitation.
|
273
349
|
"""
|
@@ -284,10 +360,10 @@ class CalendlyApp(APIApplication):
|
|
284
360
|
def get_organization_membership(self, uuid) -> dict[str, Any]:
|
285
361
|
"""
|
286
362
|
Retrieves the membership information for a specified organization membership UUID.
|
287
|
-
|
363
|
+
|
288
364
|
Args:
|
289
365
|
uuid: str. The unique identifier of the organization membership to retrieve.
|
290
|
-
|
366
|
+
|
291
367
|
Returns:
|
292
368
|
dict. A dictionary containing the organization membership details as returned by the API.
|
293
369
|
"""
|
@@ -302,10 +378,10 @@ class CalendlyApp(APIApplication):
|
|
302
378
|
def remove_user_from_organization(self, uuid) -> Any:
|
303
379
|
"""
|
304
380
|
Removes a user from the organization by deleting their membership using the specified UUID.
|
305
|
-
|
381
|
+
|
306
382
|
Args:
|
307
383
|
uuid: str. The unique identifier of the organization membership to remove.
|
308
|
-
|
384
|
+
|
309
385
|
Returns:
|
310
386
|
dict. The response data from the organization membership removal request.
|
311
387
|
"""
|
@@ -317,22 +393,34 @@ class CalendlyApp(APIApplication):
|
|
317
393
|
response.raise_for_status()
|
318
394
|
return response.json()
|
319
395
|
|
320
|
-
def list_organization_memberships(
|
396
|
+
def list_organization_memberships(
|
397
|
+
self, page_token=None, count=None, email=None, organization=None, user=None
|
398
|
+
) -> dict[str, Any]:
|
321
399
|
"""
|
322
400
|
Retrieves a list of organization memberships, optionally filtered by pagination, email, organization, or user parameters.
|
323
|
-
|
401
|
+
|
324
402
|
Args:
|
325
403
|
page_token: Optional; A string token to specify the page of results to retrieve for pagination.
|
326
404
|
count: Optional; An integer specifying the maximum number of memberships to return.
|
327
405
|
email: Optional; A string to filter memberships by user email address.
|
328
406
|
organization: Optional; A string to filter memberships by organization identifier.
|
329
407
|
user: Optional; A string to filter memberships by user identifier.
|
330
|
-
|
408
|
+
|
331
409
|
Returns:
|
332
410
|
A dictionary containing the organization membership data returned by the API.
|
333
411
|
"""
|
334
412
|
url = f"{self.base_url}/organization_memberships"
|
335
|
-
query_params = {
|
413
|
+
query_params = {
|
414
|
+
k: v
|
415
|
+
for k, v in [
|
416
|
+
("page_token", page_token),
|
417
|
+
("count", count),
|
418
|
+
("email", email),
|
419
|
+
("organization", organization),
|
420
|
+
("user", user),
|
421
|
+
]
|
422
|
+
if v is not None
|
423
|
+
}
|
336
424
|
response = self._get(url, params=query_params)
|
337
425
|
response.raise_for_status()
|
338
426
|
return response.json()
|
@@ -340,10 +428,10 @@ class CalendlyApp(APIApplication):
|
|
340
428
|
def get_webhook_subscription(self, webhook_uuid) -> dict[str, Any]:
|
341
429
|
"""
|
342
430
|
Retrieves the details of a webhook subscription identified by its UUID.
|
343
|
-
|
431
|
+
|
344
432
|
Args:
|
345
433
|
webhook_uuid: The unique identifier (UUID) of the webhook subscription to retrieve.
|
346
|
-
|
434
|
+
|
347
435
|
Returns:
|
348
436
|
A dictionary containing the webhook subscription details as returned by the API.
|
349
437
|
"""
|
@@ -358,10 +446,10 @@ class CalendlyApp(APIApplication):
|
|
358
446
|
def delete_webhook_subscription(self, webhook_uuid) -> Any:
|
359
447
|
"""
|
360
448
|
Deletes a webhook subscription identified by its UUID.
|
361
|
-
|
449
|
+
|
362
450
|
Args:
|
363
451
|
webhook_uuid: The unique identifier (UUID) of the webhook subscription to delete.
|
364
|
-
|
452
|
+
|
365
453
|
Returns:
|
366
454
|
The JSON-decoded response from the server after deleting the webhook subscription.
|
367
455
|
"""
|
@@ -373,10 +461,18 @@ class CalendlyApp(APIApplication):
|
|
373
461
|
response.raise_for_status()
|
374
462
|
return response.json()
|
375
463
|
|
376
|
-
def list_webhook_subscriptions(
|
464
|
+
def list_webhook_subscriptions(
|
465
|
+
self,
|
466
|
+
organization=None,
|
467
|
+
user=None,
|
468
|
+
page_token=None,
|
469
|
+
count=None,
|
470
|
+
sort=None,
|
471
|
+
scope=None,
|
472
|
+
) -> dict[str, Any]:
|
377
473
|
"""
|
378
474
|
Retrieves a list of webhook subscriptions, optionally filtered and paginated based on input criteria.
|
379
|
-
|
475
|
+
|
380
476
|
Args:
|
381
477
|
organization: Optional; str or None. Identifier of the organization to filter subscriptions by organization.
|
382
478
|
user: Optional; str or None. Identifier of the user to filter subscriptions created by a specific user.
|
@@ -384,20 +480,40 @@ class CalendlyApp(APIApplication):
|
|
384
480
|
count: Optional; int or None. Maximum number of subscriptions to return in the response.
|
385
481
|
sort: Optional; str or None. Sorting order for the returned subscriptions.
|
386
482
|
scope: Optional; str or None. Scope to filter webhook subscriptions.
|
387
|
-
|
483
|
+
|
388
484
|
Returns:
|
389
485
|
dict: A dictionary containing the list of webhook subscriptions matching the query parameters and any associated metadata (e.g., paging info).
|
390
486
|
"""
|
391
487
|
url = f"{self.base_url}/webhook_subscriptions"
|
392
|
-
query_params = {
|
488
|
+
query_params = {
|
489
|
+
k: v
|
490
|
+
for k, v in [
|
491
|
+
("organization", organization),
|
492
|
+
("user", user),
|
493
|
+
("page_token", page_token),
|
494
|
+
("count", count),
|
495
|
+
("sort", sort),
|
496
|
+
("scope", scope),
|
497
|
+
]
|
498
|
+
if v is not None
|
499
|
+
}
|
393
500
|
response = self._get(url, params=query_params)
|
394
501
|
response.raise_for_status()
|
395
502
|
return response.json()
|
396
503
|
|
397
|
-
def create_webhook_subscription(
|
504
|
+
def create_webhook_subscription(
|
505
|
+
self,
|
506
|
+
events=None,
|
507
|
+
group=None,
|
508
|
+
organization=None,
|
509
|
+
scope=None,
|
510
|
+
signing_key=None,
|
511
|
+
url=None,
|
512
|
+
user=None,
|
513
|
+
) -> dict[str, Any]:
|
398
514
|
"""
|
399
515
|
Creates a new webhook subscription with the specified parameters and returns the subscription details as a dictionary.
|
400
|
-
|
516
|
+
|
401
517
|
Args:
|
402
518
|
events: Optional[list[str]]; A list of event names that will trigger the webhook.
|
403
519
|
group: Optional[str]; The group identifier to which the webhook is scoped.
|
@@ -406,18 +522,18 @@ class CalendlyApp(APIApplication):
|
|
406
522
|
signing_key: Optional[str]; The key used to sign webhook payloads for verification.
|
407
523
|
url: Optional[str]; The URL endpoint to which the webhook events will be delivered.
|
408
524
|
user: Optional[str]; The user identifier associated with this webhook subscription.
|
409
|
-
|
525
|
+
|
410
526
|
Returns:
|
411
527
|
dict[str, Any]: A dictionary containing the details of the created webhook subscription as returned by the API.
|
412
528
|
"""
|
413
529
|
request_body = {
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
530
|
+
"events": events,
|
531
|
+
"group": group,
|
532
|
+
"organization": organization,
|
533
|
+
"scope": scope,
|
534
|
+
"signing_key": signing_key,
|
535
|
+
"url": url,
|
536
|
+
"user": user,
|
421
537
|
}
|
422
538
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
423
539
|
url = f"{self.base_url}/webhook_subscriptions"
|
@@ -426,22 +542,24 @@ class CalendlyApp(APIApplication):
|
|
426
542
|
response.raise_for_status()
|
427
543
|
return response.json()
|
428
544
|
|
429
|
-
def create_single_use_scheduling_link(
|
545
|
+
def create_single_use_scheduling_link(
|
546
|
+
self, max_event_count=None, owner=None, owner_type=None
|
547
|
+
) -> dict[str, Any]:
|
430
548
|
"""
|
431
549
|
Creates a single-use scheduling link by sending a POST request with optional restrictions.
|
432
|
-
|
550
|
+
|
433
551
|
Args:
|
434
552
|
max_event_count: Optional; int or None. The maximum number of events that can be scheduled using the link.
|
435
553
|
owner: Optional; str or None. The identifier for the owner of the scheduling link.
|
436
554
|
owner_type: Optional; str or None. The type of the owner (e.g., 'user', 'team').
|
437
|
-
|
555
|
+
|
438
556
|
Returns:
|
439
557
|
dict[str, Any]: The response data from the scheduling link creation API as a dictionary.
|
440
558
|
"""
|
441
559
|
request_body = {
|
442
|
-
|
443
|
-
|
444
|
-
|
560
|
+
"max_event_count": max_event_count,
|
561
|
+
"owner": owner,
|
562
|
+
"owner_type": owner_type,
|
445
563
|
}
|
446
564
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
447
565
|
url = f"{self.base_url}/scheduling_links"
|
@@ -453,15 +571,15 @@ class CalendlyApp(APIApplication):
|
|
453
571
|
def delete_invitee_data(self, emails=None) -> dict[str, Any]:
|
454
572
|
"""
|
455
573
|
Deletes invitee data for the specified email addresses by sending a POST request to the data compliance API.
|
456
|
-
|
574
|
+
|
457
575
|
Args:
|
458
576
|
emails: Optional list of email addresses (list[str] or None) to identify the invitees whose data should be deleted. If None, no emails are included in the request.
|
459
|
-
|
577
|
+
|
460
578
|
Returns:
|
461
579
|
A dictionary containing the JSON response from the API indicating the result of the deletion request.
|
462
580
|
"""
|
463
581
|
request_body = {
|
464
|
-
|
582
|
+
"emails": emails,
|
465
583
|
}
|
466
584
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
467
585
|
url = f"{self.base_url}/data_compliance/deletion/invitees"
|
@@ -470,20 +588,22 @@ class CalendlyApp(APIApplication):
|
|
470
588
|
response.raise_for_status()
|
471
589
|
return response.json()
|
472
590
|
|
473
|
-
def delete_scheduled_event_data(
|
591
|
+
def delete_scheduled_event_data(
|
592
|
+
self, end_time=None, start_time=None
|
593
|
+
) -> dict[str, Any]:
|
474
594
|
"""
|
475
595
|
Deletes scheduled event data within the specified time range by sending a deletion request to the data compliance service.
|
476
|
-
|
596
|
+
|
477
597
|
Args:
|
478
598
|
end_time: Optional; The end of the time interval for which scheduled event data should be deleted. If None, no upper bound is set.
|
479
599
|
start_time: Optional; The start of the time interval for which scheduled event data should be deleted. If None, no lower bound is set.
|
480
|
-
|
600
|
+
|
481
601
|
Returns:
|
482
602
|
A dictionary containing the response from the data compliance deletion endpoint.
|
483
603
|
"""
|
484
604
|
request_body = {
|
485
|
-
|
486
|
-
|
605
|
+
"end_time": end_time,
|
606
|
+
"start_time": start_time,
|
487
607
|
}
|
488
608
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
489
609
|
url = f"{self.base_url}/data_compliance/deletion/events"
|
@@ -495,10 +615,10 @@ class CalendlyApp(APIApplication):
|
|
495
615
|
def get_invitee_no_show(self, uuid) -> dict[str, Any]:
|
496
616
|
"""
|
497
617
|
Retrieves details about an invitee who did not show up for a scheduled event, identified by a unique UUID.
|
498
|
-
|
618
|
+
|
499
619
|
Args:
|
500
620
|
uuid: The unique identifier (UUID) of the invitee no-show to retrieve.
|
501
|
-
|
621
|
+
|
502
622
|
Returns:
|
503
623
|
A dictionary containing details of the invitee no-show record.
|
504
624
|
"""
|
@@ -513,10 +633,10 @@ class CalendlyApp(APIApplication):
|
|
513
633
|
def delete_invitee_no_show(self, uuid) -> Any:
|
514
634
|
"""
|
515
635
|
Deletes an invitee no-show record identified by the given UUID.
|
516
|
-
|
636
|
+
|
517
637
|
Args:
|
518
638
|
uuid: The unique identifier (UUID) of the invitee no-show to delete. Must not be None.
|
519
|
-
|
639
|
+
|
520
640
|
Returns:
|
521
641
|
The response data as a JSON object after successfully deleting the invitee no-show record.
|
522
642
|
"""
|
@@ -531,15 +651,15 @@ class CalendlyApp(APIApplication):
|
|
531
651
|
def create_invitee_no_show(self, invitee=None) -> dict[str, Any]:
|
532
652
|
"""
|
533
653
|
Creates an invitee no-show record by sending a POST request to the invitee_no_shows endpoint.
|
534
|
-
|
654
|
+
|
535
655
|
Args:
|
536
656
|
invitee: Optional; information about the invitee to be included in the request body. If None, the invitee field is omitted.
|
537
|
-
|
657
|
+
|
538
658
|
Returns:
|
539
659
|
A dictionary containing the server's JSON response to the creation request.
|
540
660
|
"""
|
541
661
|
request_body = {
|
542
|
-
|
662
|
+
"invitee": invitee,
|
543
663
|
}
|
544
664
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
545
665
|
url = f"{self.base_url}/invitee_no_shows"
|
@@ -551,10 +671,10 @@ class CalendlyApp(APIApplication):
|
|
551
671
|
def get_group(self, uuid) -> dict[str, Any]:
|
552
672
|
"""
|
553
673
|
Retrieves information for a group identified by its UUID from the server.
|
554
|
-
|
674
|
+
|
555
675
|
Args:
|
556
676
|
uuid: The unique identifier (UUID) of the group to retrieve.
|
557
|
-
|
677
|
+
|
558
678
|
Returns:
|
559
679
|
A dictionary containing the group's details as returned by the server.
|
560
680
|
"""
|
@@ -566,20 +686,30 @@ class CalendlyApp(APIApplication):
|
|
566
686
|
response.raise_for_status()
|
567
687
|
return response.json()
|
568
688
|
|
569
|
-
def list_groups(
|
689
|
+
def list_groups(
|
690
|
+
self, organization=None, page_token=None, count=None
|
691
|
+
) -> dict[str, Any]:
|
570
692
|
"""
|
571
693
|
Retrieves a list of groups from the API, optionally filtered by organization and paginated using a page token and count.
|
572
|
-
|
694
|
+
|
573
695
|
Args:
|
574
696
|
organization: Optional; a string specifying the organization to filter the groups by.
|
575
697
|
page_token: Optional; a string token indicating the page of results to retrieve for pagination.
|
576
698
|
count: Optional; an integer specifying the maximum number of groups to return.
|
577
|
-
|
699
|
+
|
578
700
|
Returns:
|
579
701
|
A dictionary containing the JSON response from the API with the list of groups and any relevant pagination details.
|
580
702
|
"""
|
581
703
|
url = f"{self.base_url}/groups"
|
582
|
-
query_params = {
|
704
|
+
query_params = {
|
705
|
+
k: v
|
706
|
+
for k, v in [
|
707
|
+
("organization", organization),
|
708
|
+
("page_token", page_token),
|
709
|
+
("count", count),
|
710
|
+
]
|
711
|
+
if v is not None
|
712
|
+
}
|
583
713
|
response = self._get(url, params=query_params)
|
584
714
|
response.raise_for_status()
|
585
715
|
return response.json()
|
@@ -587,10 +717,10 @@ class CalendlyApp(APIApplication):
|
|
587
717
|
def get_group_relationship(self, uuid) -> dict[str, Any]:
|
588
718
|
"""
|
589
719
|
Retrieves the relationship information for a group specified by UUID from the API.
|
590
|
-
|
720
|
+
|
591
721
|
Args:
|
592
722
|
uuid: The unique identifier (UUID) of the group whose relationship data is to be retrieved.
|
593
|
-
|
723
|
+
|
594
724
|
Returns:
|
595
725
|
A dictionary containing the group relationship information as returned by the API.
|
596
726
|
"""
|
@@ -602,22 +732,34 @@ class CalendlyApp(APIApplication):
|
|
602
732
|
response.raise_for_status()
|
603
733
|
return response.json()
|
604
734
|
|
605
|
-
def list_group_relationships(
|
735
|
+
def list_group_relationships(
|
736
|
+
self, count=None, page_token=None, organization=None, owner=None, group=None
|
737
|
+
) -> dict[str, Any]:
|
606
738
|
"""
|
607
739
|
Retrieves a list of group relationships from the server, optionally filtered by pagination and various group ownership parameters.
|
608
|
-
|
740
|
+
|
609
741
|
Args:
|
610
742
|
count: Optional; Maximum number of records to retrieve. Used for pagination.
|
611
743
|
page_token: Optional; Token indicating the page of results to retrieve. Used for pagination.
|
612
744
|
organization: Optional; Filter relationships to a specific organization.
|
613
745
|
owner: Optional; Filter relationships by the owner's identifier.
|
614
746
|
group: Optional; Filter relationships by the group's identifier.
|
615
|
-
|
747
|
+
|
616
748
|
Returns:
|
617
749
|
A dictionary containing the JSON response from the server, typically including metadata and a list of group relationships.
|
618
750
|
"""
|
619
751
|
url = f"{self.base_url}/group_relationships"
|
620
|
-
query_params = {
|
752
|
+
query_params = {
|
753
|
+
k: v
|
754
|
+
for k, v in [
|
755
|
+
("count", count),
|
756
|
+
("page_token", page_token),
|
757
|
+
("organization", organization),
|
758
|
+
("owner", owner),
|
759
|
+
("group", group),
|
760
|
+
]
|
761
|
+
if v is not None
|
762
|
+
}
|
621
763
|
response = self._get(url, params=query_params)
|
622
764
|
response.raise_for_status()
|
623
765
|
return response.json()
|
@@ -625,10 +767,10 @@ class CalendlyApp(APIApplication):
|
|
625
767
|
def get_routing_form(self, uuid) -> dict[str, Any]:
|
626
768
|
"""
|
627
769
|
Retrieves a routing form by its unique identifier from the server.
|
628
|
-
|
770
|
+
|
629
771
|
Args:
|
630
772
|
uuid: The unique identifier of the routing form to retrieve.
|
631
|
-
|
773
|
+
|
632
774
|
Returns:
|
633
775
|
A dictionary representing the routing form data retrieved from the server.
|
634
776
|
"""
|
@@ -640,21 +782,32 @@ class CalendlyApp(APIApplication):
|
|
640
782
|
response.raise_for_status()
|
641
783
|
return response.json()
|
642
784
|
|
643
|
-
def list_routing_forms(
|
785
|
+
def list_routing_forms(
|
786
|
+
self, organization=None, count=None, page_token=None, sort=None
|
787
|
+
) -> dict[str, Any]:
|
644
788
|
"""
|
645
789
|
Retrieves a paginated list of routing forms from the API, optionally filtered and sorted by organization, count, page token, or sort order.
|
646
|
-
|
790
|
+
|
647
791
|
Args:
|
648
792
|
organization: Optional[str]. The organization identifier to filter the routing forms by. If None, no filtering by organization is applied.
|
649
793
|
count: Optional[int]. The maximum number of routing forms to return. If None, the default API pagination size is used.
|
650
794
|
page_token: Optional[str]. A token indicating the page of results to retrieve for pagination. If None, retrieves the first page.
|
651
795
|
sort: Optional[str]. The sorting order to apply to the results. If None, uses the API's default sorting.
|
652
|
-
|
796
|
+
|
653
797
|
Returns:
|
654
798
|
dict[str, Any]: A dictionary containing the list of routing forms and associated metadata as provided by the API response.
|
655
799
|
"""
|
656
800
|
url = f"{self.base_url}/routing_forms"
|
657
|
-
query_params = {
|
801
|
+
query_params = {
|
802
|
+
k: v
|
803
|
+
for k, v in [
|
804
|
+
("organization", organization),
|
805
|
+
("count", count),
|
806
|
+
("page_token", page_token),
|
807
|
+
("sort", sort),
|
808
|
+
]
|
809
|
+
if v is not None
|
810
|
+
}
|
658
811
|
response = self._get(url, params=query_params)
|
659
812
|
response.raise_for_status()
|
660
813
|
return response.json()
|
@@ -662,10 +815,10 @@ class CalendlyApp(APIApplication):
|
|
662
815
|
def get_routing_form_submission(self, uuid) -> dict[str, Any]:
|
663
816
|
"""
|
664
817
|
Retrieves a routing form submission by its unique identifier (UUID) from the configured API endpoint.
|
665
|
-
|
818
|
+
|
666
819
|
Args:
|
667
820
|
uuid: The unique identifier of the routing form submission to retrieve. Must not be None.
|
668
|
-
|
821
|
+
|
669
822
|
Returns:
|
670
823
|
A dictionary containing the routing form submission data retrieved from the API.
|
671
824
|
"""
|
@@ -677,47 +830,80 @@ class CalendlyApp(APIApplication):
|
|
677
830
|
response.raise_for_status()
|
678
831
|
return response.json()
|
679
832
|
|
680
|
-
def list_routing_form_submissions(
|
833
|
+
def list_routing_form_submissions(
|
834
|
+
self, form=None, count=None, page_token=None, sort=None
|
835
|
+
) -> dict[str, Any]:
|
681
836
|
"""
|
682
837
|
Retrieves a list of routing form submissions, optionally filtered and paginated based on provided parameters.
|
683
|
-
|
838
|
+
|
684
839
|
Args:
|
685
840
|
form: Optional; the identifier of the form to filter submissions by (default is None).
|
686
841
|
count: Optional; the maximum number of submissions to return (default is None).
|
687
842
|
page_token: Optional; token for pagination to retrieve the next set of results (default is None).
|
688
843
|
sort: Optional; sorting preference for the submissions (default is None).
|
689
|
-
|
844
|
+
|
690
845
|
Returns:
|
691
846
|
A dictionary containing the retrieved routing form submissions and related metadata.
|
692
847
|
"""
|
693
848
|
url = f"{self.base_url}/routing_form_submissions"
|
694
|
-
query_params = {
|
849
|
+
query_params = {
|
850
|
+
k: v
|
851
|
+
for k, v in [
|
852
|
+
("form", form),
|
853
|
+
("count", count),
|
854
|
+
("page_token", page_token),
|
855
|
+
("sort", sort),
|
856
|
+
]
|
857
|
+
if v is not None
|
858
|
+
}
|
695
859
|
response = self._get(url, params=query_params)
|
696
860
|
response.raise_for_status()
|
697
861
|
return response.json()
|
698
862
|
|
699
|
-
def list_event_type_available_times(
|
863
|
+
def list_event_type_available_times(
|
864
|
+
self, event_type=None, start_time=None, end_time=None
|
865
|
+
) -> dict[str, Any]:
|
700
866
|
"""
|
701
867
|
Retrieves available times for a specified event type within an optional date and time range.
|
702
|
-
|
868
|
+
|
703
869
|
Args:
|
704
870
|
event_type: Optional; the type of event to filter available times for. If None, retrieves times for all event types.
|
705
871
|
start_time: Optional; the earliest datetime to include in the results, in an accepted string or datetime format. If None, no lower bound is applied.
|
706
872
|
end_time: Optional; the latest datetime to include in the results, in an accepted string or datetime format. If None, no upper bound is applied.
|
707
|
-
|
873
|
+
|
708
874
|
Returns:
|
709
875
|
A dictionary containing the available times for the specified event type within the given range, as returned by the API.
|
710
876
|
"""
|
711
877
|
url = f"{self.base_url}/event_type_available_times"
|
712
|
-
query_params = {
|
878
|
+
query_params = {
|
879
|
+
k: v
|
880
|
+
for k, v in [
|
881
|
+
("event_type", event_type),
|
882
|
+
("start_time", start_time),
|
883
|
+
("end_time", end_time),
|
884
|
+
]
|
885
|
+
if v is not None
|
886
|
+
}
|
713
887
|
response = self._get(url, params=query_params)
|
714
888
|
response.raise_for_status()
|
715
889
|
return response.json()
|
716
890
|
|
717
|
-
def list_activity_log_entries(
|
891
|
+
def list_activity_log_entries(
|
892
|
+
self,
|
893
|
+
organization=None,
|
894
|
+
search_term=None,
|
895
|
+
actor=None,
|
896
|
+
sort=None,
|
897
|
+
min_occurred_at=None,
|
898
|
+
max_occurred_at=None,
|
899
|
+
page_token=None,
|
900
|
+
count=None,
|
901
|
+
namespace=None,
|
902
|
+
action=None,
|
903
|
+
) -> dict[str, Any]:
|
718
904
|
"""
|
719
905
|
Retrieves a list of activity log entries with optional filtering, sorting, and pagination.
|
720
|
-
|
906
|
+
|
721
907
|
Args:
|
722
908
|
organization: Optional; organization identifier to filter log entries by a specific organization.
|
723
909
|
search_term: Optional; term to search for in the activity log entries.
|
@@ -729,20 +915,47 @@ class CalendlyApp(APIApplication):
|
|
729
915
|
count: Optional; maximum number of entries to return.
|
730
916
|
namespace: Optional; filter results by a specific namespace.
|
731
917
|
action: Optional; filter results by a specific action performed.
|
732
|
-
|
918
|
+
|
733
919
|
Returns:
|
734
920
|
A dictionary containing a list of activity log entries and any associated pagination metadata.
|
735
921
|
"""
|
736
922
|
url = f"{self.base_url}/activity_log_entries"
|
737
|
-
query_params = {
|
923
|
+
query_params = {
|
924
|
+
k: v
|
925
|
+
for k, v in [
|
926
|
+
("organization", organization),
|
927
|
+
("search_term", search_term),
|
928
|
+
("actor", actor),
|
929
|
+
("sort", sort),
|
930
|
+
("min_occurred_at", min_occurred_at),
|
931
|
+
("max_occurred_at", max_occurred_at),
|
932
|
+
("page_token", page_token),
|
933
|
+
("count", count),
|
934
|
+
("namespace", namespace),
|
935
|
+
("action", action),
|
936
|
+
]
|
937
|
+
if v is not None
|
938
|
+
}
|
738
939
|
response = self._get(url, params=query_params)
|
739
940
|
response.raise_for_status()
|
740
941
|
return response.json()
|
741
942
|
|
742
|
-
def create_share(
|
943
|
+
def create_share(
|
944
|
+
self,
|
945
|
+
availability_rule=None,
|
946
|
+
duration=None,
|
947
|
+
end_date=None,
|
948
|
+
event_type=None,
|
949
|
+
hide_location=None,
|
950
|
+
location_configurations=None,
|
951
|
+
max_booking_time=None,
|
952
|
+
name=None,
|
953
|
+
period_type=None,
|
954
|
+
start_date=None,
|
955
|
+
) -> dict[str, Any]:
|
743
956
|
"""
|
744
957
|
Creates a new share with the specified configuration parameters by making a POST request to the shares API endpoint.
|
745
|
-
|
958
|
+
|
746
959
|
Args:
|
747
960
|
availability_rule: Optional; rule defining the availability for the share.
|
748
961
|
duration: Optional; duration of the event or booking in minutes.
|
@@ -754,21 +967,21 @@ class CalendlyApp(APIApplication):
|
|
754
967
|
name: Optional; name of the share.
|
755
968
|
period_type: Optional; type of period (e.g., recurring, single).
|
756
969
|
start_date: Optional; start date for the share's availability.
|
757
|
-
|
970
|
+
|
758
971
|
Returns:
|
759
972
|
A dictionary containing the JSON response from the API with details of the created share.
|
760
973
|
"""
|
761
974
|
request_body = {
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
975
|
+
"availability_rule": availability_rule,
|
976
|
+
"duration": duration,
|
977
|
+
"end_date": end_date,
|
978
|
+
"event_type": event_type,
|
979
|
+
"hide_location": hide_location,
|
980
|
+
"location_configurations": location_configurations,
|
981
|
+
"max_booking_time": max_booking_time,
|
982
|
+
"name": name,
|
983
|
+
"period_type": period_type,
|
984
|
+
"start_date": start_date,
|
772
985
|
}
|
773
986
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
774
987
|
url = f"{self.base_url}/shares"
|
@@ -777,20 +990,30 @@ class CalendlyApp(APIApplication):
|
|
777
990
|
response.raise_for_status()
|
778
991
|
return response.json()
|
779
992
|
|
780
|
-
def list_user_busy_times(
|
993
|
+
def list_user_busy_times(
|
994
|
+
self, user=None, start_time=None, end_time=None
|
995
|
+
) -> dict[str, Any]:
|
781
996
|
"""
|
782
997
|
Retrieves a list of busy time intervals for a specified user within an optional date range.
|
783
|
-
|
998
|
+
|
784
999
|
Args:
|
785
1000
|
user: Optional; The identifier of the user whose busy times are to be listed. If None, retrieves busy times for all users.
|
786
1001
|
start_time: Optional; The start of the time range (ISO 8601 format). Only busy times starting at or after this time are included. If None, no lower bound is applied.
|
787
1002
|
end_time: Optional; The end of the time range (ISO 8601 format). Only busy times ending before or at this time are included. If None, no upper bound is applied.
|
788
|
-
|
1003
|
+
|
789
1004
|
Returns:
|
790
1005
|
A dictionary containing the user's busy time intervals and related metadata as returned by the API.
|
791
1006
|
"""
|
792
1007
|
url = f"{self.base_url}/user_busy_times"
|
793
|
-
query_params = {
|
1008
|
+
query_params = {
|
1009
|
+
k: v
|
1010
|
+
for k, v in [
|
1011
|
+
("user", user),
|
1012
|
+
("start_time", start_time),
|
1013
|
+
("end_time", end_time),
|
1014
|
+
]
|
1015
|
+
if v is not None
|
1016
|
+
}
|
794
1017
|
response = self._get(url, params=query_params)
|
795
1018
|
response.raise_for_status()
|
796
1019
|
return response.json()
|
@@ -798,10 +1021,10 @@ class CalendlyApp(APIApplication):
|
|
798
1021
|
def get_user_availability_schedule(self, uuid) -> dict[str, Any]:
|
799
1022
|
"""
|
800
1023
|
Retrieves the availability schedule for a user identified by the given UUID.
|
801
|
-
|
1024
|
+
|
802
1025
|
Args:
|
803
1026
|
uuid: str. The UUID of the user whose availability schedule is to be retrieved.
|
804
|
-
|
1027
|
+
|
805
1028
|
Returns:
|
806
1029
|
dict[str, Any]: A dictionary containing the user's availability schedule as returned by the API.
|
807
1030
|
"""
|
@@ -816,41 +1039,60 @@ class CalendlyApp(APIApplication):
|
|
816
1039
|
def list_user_availability_schedules(self, user=None) -> dict[str, Any]:
|
817
1040
|
"""
|
818
1041
|
Retrieves a list of user availability schedules from the API, optionally filtering by a specific user.
|
819
|
-
|
1042
|
+
|
820
1043
|
Args:
|
821
1044
|
user: Optional; a string representing the user identifier to filter the availability schedules. If None, schedules for all users are retrieved.
|
822
|
-
|
1045
|
+
|
823
1046
|
Returns:
|
824
1047
|
A dictionary containing the availability schedules returned by the API.
|
825
1048
|
"""
|
826
1049
|
url = f"{self.base_url}/user_availability_schedules"
|
827
|
-
query_params = {k: v for k, v in [(
|
1050
|
+
query_params = {k: v for k, v in [("user", user)] if v is not None}
|
828
1051
|
response = self._get(url, params=query_params)
|
829
1052
|
response.raise_for_status()
|
830
1053
|
return response.json()
|
831
1054
|
|
832
|
-
def list_event_type_hosts(
|
1055
|
+
def list_event_type_hosts(
|
1056
|
+
self, event_type=None, count=None, page_token=None
|
1057
|
+
) -> dict[str, Any]:
|
833
1058
|
"""
|
834
1059
|
Retrieves a list of event type hosts based on provided filter, count, and pagination parameters.
|
835
|
-
|
1060
|
+
|
836
1061
|
Args:
|
837
1062
|
event_type: Optional; a string specifying the event type to filter hosts by.
|
838
1063
|
count: Optional; an integer indicating the maximum number of hosts to return.
|
839
1064
|
page_token: Optional; a string token to retrieve the next page of results for pagination.
|
840
|
-
|
1065
|
+
|
841
1066
|
Returns:
|
842
1067
|
A dictionary containing the JSON response with event type hosts data, which may include host details and pagination information.
|
843
1068
|
"""
|
844
1069
|
url = f"{self.base_url}/event_type_memberships"
|
845
|
-
query_params = {
|
1070
|
+
query_params = {
|
1071
|
+
k: v
|
1072
|
+
for k, v in [
|
1073
|
+
("event_type", event_type),
|
1074
|
+
("count", count),
|
1075
|
+
("page_token", page_token),
|
1076
|
+
]
|
1077
|
+
if v is not None
|
1078
|
+
}
|
846
1079
|
response = self._get(url, params=query_params)
|
847
1080
|
response.raise_for_status()
|
848
1081
|
return response.json()
|
849
1082
|
|
850
|
-
def create_one_off_event_type(
|
1083
|
+
def create_one_off_event_type(
|
1084
|
+
self,
|
1085
|
+
co_hosts=None,
|
1086
|
+
date_setting=None,
|
1087
|
+
duration=None,
|
1088
|
+
host=None,
|
1089
|
+
location=None,
|
1090
|
+
name=None,
|
1091
|
+
timezone=None,
|
1092
|
+
) -> dict[str, Any]:
|
851
1093
|
"""
|
852
1094
|
Creates a one-off event type with specified parameters and returns the created event type details.
|
853
|
-
|
1095
|
+
|
854
1096
|
Args:
|
855
1097
|
co_hosts: Optional; a list or identifier(s) representing additional hosts for the event.
|
856
1098
|
date_setting: Optional; the date configuration for the event (e.g., specific date, date range, or recurrence settings).
|
@@ -859,18 +1101,18 @@ class CalendlyApp(APIApplication):
|
|
859
1101
|
location: Optional; the location information for the event (e.g., physical address or online meeting link).
|
860
1102
|
name: Optional; the name or title of the event.
|
861
1103
|
timezone: Optional; the timezone in which the event will take place.
|
862
|
-
|
1104
|
+
|
863
1105
|
Returns:
|
864
1106
|
A dictionary containing the details of the created one-off event type as returned by the API.
|
865
1107
|
"""
|
866
1108
|
request_body = {
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
1109
|
+
"co_hosts": co_hosts,
|
1110
|
+
"date_setting": date_setting,
|
1111
|
+
"duration": duration,
|
1112
|
+
"host": host,
|
1113
|
+
"location": location,
|
1114
|
+
"name": name,
|
1115
|
+
"timezone": timezone,
|
874
1116
|
}
|
875
1117
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
876
1118
|
url = f"{self.base_url}/one_off_event_types"
|
@@ -879,21 +1121,32 @@ class CalendlyApp(APIApplication):
|
|
879
1121
|
response.raise_for_status()
|
880
1122
|
return response.json()
|
881
1123
|
|
882
|
-
def get_sample_webhook_data(
|
1124
|
+
def get_sample_webhook_data(
|
1125
|
+
self, event=None, organization=None, user=None, scope=None
|
1126
|
+
) -> dict[str, Any]:
|
883
1127
|
"""
|
884
1128
|
Retrieves sample webhook data from the API using optional filtering parameters.
|
885
|
-
|
1129
|
+
|
886
1130
|
Args:
|
887
1131
|
event: Optional; a string specifying the event type to filter the webhook data.
|
888
1132
|
organization: Optional; a string representing the organization identifier to filter the data.
|
889
1133
|
user: Optional; a string identifying the user to filter the webhook data.
|
890
1134
|
scope: Optional; a string indicating the scope to filter the webhook data.
|
891
|
-
|
1135
|
+
|
892
1136
|
Returns:
|
893
1137
|
A dictionary containing the JSON response with sample webhook data from the API.
|
894
1138
|
"""
|
895
1139
|
url = f"{self.base_url}/sample_webhook_data"
|
896
|
-
query_params = {
|
1140
|
+
query_params = {
|
1141
|
+
k: v
|
1142
|
+
for k, v in [
|
1143
|
+
("event", event),
|
1144
|
+
("organization", organization),
|
1145
|
+
("user", user),
|
1146
|
+
("scope", scope),
|
1147
|
+
]
|
1148
|
+
if v is not None
|
1149
|
+
}
|
897
1150
|
response = self._get(url, params=query_params)
|
898
1151
|
response.raise_for_status()
|
899
1152
|
return response.json()
|
@@ -901,10 +1154,10 @@ class CalendlyApp(APIApplication):
|
|
901
1154
|
def list_tools(self):
|
902
1155
|
"""
|
903
1156
|
Returns a list of method references for various event, user, group, organization, and webhook operations supported by this instance.
|
904
|
-
|
1157
|
+
|
905
1158
|
Args:
|
906
1159
|
None: This method does not accept any parameters.
|
907
|
-
|
1160
|
+
|
908
1161
|
Returns:
|
909
1162
|
List of callable method references available on this instance for performing event, user, group, organization, and webhook operations.
|
910
1163
|
"""
|
@@ -950,5 +1203,5 @@ class CalendlyApp(APIApplication):
|
|
950
1203
|
self.list_user_availability_schedules,
|
951
1204
|
self.list_event_type_hosts,
|
952
1205
|
self.create_one_off_event_type,
|
953
|
-
self.get_sample_webhook_data
|
1206
|
+
self.get_sample_webhook_data,
|
954
1207
|
]
|