@l7mp/tivadar-ai-api-sdk 0.1.4 → 0.1.6

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 (71) hide show
  1. package/dist/api-client.d.ts +23 -7
  2. package/dist/api-client.js +35 -6
  3. package/dist/apis/CalendarApi.d.ts +64 -48
  4. package/dist/apis/CalendarApi.js +152 -87
  5. package/dist/apis/CallsApi.d.ts +92 -0
  6. package/dist/apis/CallsApi.js +256 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/api-client.d.ts +23 -7
  10. package/dist/esm/api-client.js +35 -6
  11. package/dist/esm/apis/CalendarApi.d.ts +64 -48
  12. package/dist/esm/apis/CalendarApi.js +153 -88
  13. package/dist/esm/apis/CallsApi.d.ts +92 -0
  14. package/dist/esm/apis/CallsApi.js +252 -0
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/Calendar.d.ts +6 -0
  18. package/dist/esm/models/Calendar.js +2 -0
  19. package/dist/esm/models/CalendarCreate.d.ts +32 -0
  20. package/dist/esm/models/CalendarCreate.js +43 -0
  21. package/dist/esm/models/CalendarEventCreate.d.ts +0 -6
  22. package/dist/esm/models/CalendarEventCreate.js +0 -4
  23. package/dist/esm/models/CalendarEventListResponse.d.ts +33 -0
  24. package/dist/esm/models/CalendarEventListResponse.js +44 -0
  25. package/dist/esm/models/CalendarEventUpdate.d.ts +0 -6
  26. package/dist/esm/models/CalendarEventUpdate.js +0 -2
  27. package/dist/esm/models/CalendarUpdate.d.ts +32 -0
  28. package/dist/esm/models/CalendarUpdate.js +41 -0
  29. package/dist/esm/models/Call.d.ts +64 -0
  30. package/dist/esm/models/Call.js +55 -0
  31. package/dist/esm/models/CallCreate.d.ts +52 -0
  32. package/dist/esm/models/CallCreate.js +47 -0
  33. package/dist/esm/models/CallUpdate.d.ts +52 -0
  34. package/dist/esm/models/CallUpdate.js +47 -0
  35. package/dist/esm/models/index.d.ts +6 -2
  36. package/dist/esm/models/index.js +6 -2
  37. package/dist/models/Calendar.d.ts +6 -0
  38. package/dist/models/Calendar.js +2 -0
  39. package/dist/models/CalendarCreate.d.ts +32 -0
  40. package/dist/models/CalendarCreate.js +50 -0
  41. package/dist/models/CalendarEventCreate.d.ts +0 -6
  42. package/dist/models/CalendarEventCreate.js +0 -4
  43. package/dist/models/CalendarEventListResponse.d.ts +33 -0
  44. package/dist/models/CalendarEventListResponse.js +51 -0
  45. package/dist/models/CalendarEventUpdate.d.ts +0 -6
  46. package/dist/models/CalendarEventUpdate.js +0 -2
  47. package/dist/models/CalendarUpdate.d.ts +32 -0
  48. package/dist/models/CalendarUpdate.js +48 -0
  49. package/dist/models/Call.d.ts +64 -0
  50. package/dist/models/Call.js +62 -0
  51. package/dist/models/CallCreate.d.ts +52 -0
  52. package/dist/models/CallCreate.js +54 -0
  53. package/dist/models/CallUpdate.d.ts +52 -0
  54. package/dist/models/CallUpdate.js +54 -0
  55. package/dist/models/index.d.ts +6 -2
  56. package/dist/models/index.js +6 -2
  57. package/package.json +2 -3
  58. package/src/api-client.ts +52 -12
  59. package/src/apis/CalendarApi.ts +227 -107
  60. package/src/apis/CallsApi.ts +352 -0
  61. package/src/apis/index.ts +1 -0
  62. package/src/models/Calendar.ts +8 -0
  63. package/src/models/CalendarCreate.ts +66 -0
  64. package/src/models/CalendarEventCreate.ts +0 -9
  65. package/src/models/CalendarEventListResponse.ts +74 -0
  66. package/src/models/CalendarEventUpdate.ts +0 -8
  67. package/src/models/CalendarUpdate.ts +65 -0
  68. package/src/models/Call.ts +107 -0
  69. package/src/models/CallCreate.ts +89 -0
  70. package/src/models/CallUpdate.ts +89 -0
  71. package/src/models/index.ts +6 -2
@@ -16,72 +16,89 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  Calendar,
19
+ CalendarCreate,
19
20
  CalendarEvent,
20
21
  CalendarEventCreate,
21
- CalendarEventResponse,
22
+ CalendarEventListResponse,
22
23
  CalendarEventUpdate,
23
24
  CalendarListResponse,
25
+ CalendarUpdate,
24
26
  } from '../models/index';
25
27
  import {
26
28
  CalendarFromJSON,
27
29
  CalendarToJSON,
30
+ CalendarCreateFromJSON,
31
+ CalendarCreateToJSON,
28
32
  CalendarEventFromJSON,
29
33
  CalendarEventToJSON,
30
34
  CalendarEventCreateFromJSON,
31
35
  CalendarEventCreateToJSON,
32
- CalendarEventResponseFromJSON,
33
- CalendarEventResponseToJSON,
36
+ CalendarEventListResponseFromJSON,
37
+ CalendarEventListResponseToJSON,
34
38
  CalendarEventUpdateFromJSON,
35
39
  CalendarEventUpdateToJSON,
36
40
  CalendarListResponseFromJSON,
37
41
  CalendarListResponseToJSON,
42
+ CalendarUpdateFromJSON,
43
+ CalendarUpdateToJSON,
38
44
  } from '../models/index';
39
45
 
40
- export interface OrganizationsOrganizationIdCalendarsGetRequest {
46
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdDeleteRequest {
41
47
  organizationId: string;
48
+ calendarId: string;
42
49
  }
43
50
 
44
- export interface OrganizationsOrganizationIdEventsEventIdDeleteRequest {
51
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRequest {
45
52
  organizationId: string;
53
+ calendarId: string;
46
54
  eventId: string;
47
55
  }
48
56
 
49
- export interface OrganizationsOrganizationIdEventsEventIdGetRequest {
57
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRequest {
50
58
  organizationId: string;
59
+ calendarId: string;
51
60
  eventId: string;
52
61
  }
53
62
 
54
- export interface OrganizationsOrganizationIdEventsEventIdPutRequest {
63
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRequest {
55
64
  organizationId: string;
65
+ calendarId: string;
56
66
  eventId: string;
57
67
  calendarEventUpdate: CalendarEventUpdate;
58
68
  }
59
69
 
60
- export interface OrganizationsOrganizationIdEventsGetRequest {
70
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdEventsGetRequest {
61
71
  organizationId: string;
72
+ calendarId: string;
62
73
  start: Date;
63
74
  end: Date;
64
- calendarIds?: string;
65
75
  }
66
76
 
67
- export interface OrganizationsOrganizationIdEventsPostRequest {
77
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdEventsPostRequest {
68
78
  organizationId: string;
79
+ calendarId: string;
69
80
  calendarEventCreate: CalendarEventCreate;
70
81
  }
71
82
 
72
- export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRequest {
83
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdGetRequest {
73
84
  organizationId: string;
74
- voiceAgentId: string;
85
+ calendarId: string;
75
86
  }
76
87
 
77
- export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRequest {
88
+ export interface OrganizationsOrganizationIdCalendarsCalendarIdPutRequest {
78
89
  organizationId: string;
79
- voiceAgentId: string;
90
+ calendarId: string;
91
+ calendarUpdate: CalendarUpdate;
80
92
  }
81
93
 
82
- export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRequest {
94
+ export interface OrganizationsOrganizationIdCalendarsGetRequest {
83
95
  organizationId: string;
84
- voiceAgentId: string;
96
+ voiceAgentId?: string;
97
+ }
98
+
99
+ export interface OrganizationsOrganizationIdCalendarsPostRequest {
100
+ organizationId: string;
101
+ calendarCreate: CalendarCreate;
85
102
  }
86
103
 
87
104
  /**
@@ -90,14 +107,21 @@ export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostR
90
107
  export class CalendarApi extends runtime.BaseAPI {
91
108
 
92
109
  /**
93
- * Returns all calendars with agent information. Each calendar is associated with an agent.
94
- * List all calendars in the organization
110
+ * Deletes the calendar and all associated events.
111
+ * Delete a calendar
95
112
  */
96
- async organizationsOrganizationIdCalendarsGetRaw(requestParameters: OrganizationsOrganizationIdCalendarsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarListResponse>> {
113
+ async organizationsOrganizationIdCalendarsCalendarIdDeleteRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
97
114
  if (requestParameters['organizationId'] == null) {
98
115
  throw new runtime.RequiredError(
99
116
  'organizationId',
100
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsGet().'
117
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdDelete().'
118
+ );
119
+ }
120
+
121
+ if (requestParameters['calendarId'] == null) {
122
+ throw new runtime.RequiredError(
123
+ 'calendarId',
124
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdDelete().'
101
125
  );
102
126
  }
103
127
 
@@ -114,43 +138,50 @@ export class CalendarApi extends runtime.BaseAPI {
114
138
  }
115
139
  }
116
140
 
117
- let urlPath = `/organizations/{organizationId}/calendars`;
141
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
118
142
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
143
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
119
144
 
120
145
  const response = await this.request({
121
146
  path: urlPath,
122
- method: 'GET',
147
+ method: 'DELETE',
123
148
  headers: headerParameters,
124
149
  query: queryParameters,
125
150
  }, initOverrides);
126
151
 
127
- return new runtime.JSONApiResponse(response, (jsonValue) => CalendarListResponseFromJSON(jsonValue));
152
+ return new runtime.VoidApiResponse(response);
128
153
  }
129
154
 
130
155
  /**
131
- * Returns all calendars with agent information. Each calendar is associated with an agent.
132
- * List all calendars in the organization
156
+ * Deletes the calendar and all associated events.
157
+ * Delete a calendar
133
158
  */
134
- async organizationsOrganizationIdCalendarsGet(requestParameters: OrganizationsOrganizationIdCalendarsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarListResponse> {
135
- const response = await this.organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides);
136
- return await response.value();
159
+ async organizationsOrganizationIdCalendarsCalendarIdDelete(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
160
+ await this.organizationsOrganizationIdCalendarsCalendarIdDeleteRaw(requestParameters, initOverrides);
137
161
  }
138
162
 
139
163
  /**
140
164
  * Delete a calendar event
141
165
  */
142
- async organizationsOrganizationIdEventsEventIdDeleteRaw(requestParameters: OrganizationsOrganizationIdEventsEventIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
166
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
143
167
  if (requestParameters['organizationId'] == null) {
144
168
  throw new runtime.RequiredError(
145
169
  'organizationId',
146
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdDelete().'
170
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().'
171
+ );
172
+ }
173
+
174
+ if (requestParameters['calendarId'] == null) {
175
+ throw new runtime.RequiredError(
176
+ 'calendarId',
177
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().'
147
178
  );
148
179
  }
149
180
 
150
181
  if (requestParameters['eventId'] == null) {
151
182
  throw new runtime.RequiredError(
152
183
  'eventId',
153
- 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdDelete().'
184
+ 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().'
154
185
  );
155
186
  }
156
187
 
@@ -167,8 +198,9 @@ export class CalendarApi extends runtime.BaseAPI {
167
198
  }
168
199
  }
169
200
 
170
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
201
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
171
202
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
203
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
172
204
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
173
205
 
174
206
  const response = await this.request({
@@ -184,25 +216,32 @@ export class CalendarApi extends runtime.BaseAPI {
184
216
  /**
185
217
  * Delete a calendar event
186
218
  */
187
- async organizationsOrganizationIdEventsEventIdDelete(requestParameters: OrganizationsOrganizationIdEventsEventIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
188
- await this.organizationsOrganizationIdEventsEventIdDeleteRaw(requestParameters, initOverrides);
219
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
220
+ await this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRaw(requestParameters, initOverrides);
189
221
  }
190
222
 
191
223
  /**
192
224
  * Get a single calendar event
193
225
  */
194
- async organizationsOrganizationIdEventsEventIdGetRaw(requestParameters: OrganizationsOrganizationIdEventsEventIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
226
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
195
227
  if (requestParameters['organizationId'] == null) {
196
228
  throw new runtime.RequiredError(
197
229
  'organizationId',
198
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdGet().'
230
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().'
231
+ );
232
+ }
233
+
234
+ if (requestParameters['calendarId'] == null) {
235
+ throw new runtime.RequiredError(
236
+ 'calendarId',
237
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().'
199
238
  );
200
239
  }
201
240
 
202
241
  if (requestParameters['eventId'] == null) {
203
242
  throw new runtime.RequiredError(
204
243
  'eventId',
205
- 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdGet().'
244
+ 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().'
206
245
  );
207
246
  }
208
247
 
@@ -219,8 +258,9 @@ export class CalendarApi extends runtime.BaseAPI {
219
258
  }
220
259
  }
221
260
 
222
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
261
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
223
262
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
263
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
224
264
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
225
265
 
226
266
  const response = await this.request({
@@ -236,8 +276,8 @@ export class CalendarApi extends runtime.BaseAPI {
236
276
  /**
237
277
  * Get a single calendar event
238
278
  */
239
- async organizationsOrganizationIdEventsEventIdGet(requestParameters: OrganizationsOrganizationIdEventsEventIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
240
- const response = await this.organizationsOrganizationIdEventsEventIdGetRaw(requestParameters, initOverrides);
279
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
280
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRaw(requestParameters, initOverrides);
241
281
  return await response.value();
242
282
  }
243
283
 
@@ -245,25 +285,32 @@ export class CalendarApi extends runtime.BaseAPI {
245
285
  * Partial update - only provided fields will be modified
246
286
  * Update a calendar event
247
287
  */
248
- async organizationsOrganizationIdEventsEventIdPutRaw(requestParameters: OrganizationsOrganizationIdEventsEventIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
288
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
249
289
  if (requestParameters['organizationId'] == null) {
250
290
  throw new runtime.RequiredError(
251
291
  'organizationId',
252
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().'
292
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().'
293
+ );
294
+ }
295
+
296
+ if (requestParameters['calendarId'] == null) {
297
+ throw new runtime.RequiredError(
298
+ 'calendarId',
299
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().'
253
300
  );
254
301
  }
255
302
 
256
303
  if (requestParameters['eventId'] == null) {
257
304
  throw new runtime.RequiredError(
258
305
  'eventId',
259
- 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().'
306
+ 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().'
260
307
  );
261
308
  }
262
309
 
263
310
  if (requestParameters['calendarEventUpdate'] == null) {
264
311
  throw new runtime.RequiredError(
265
312
  'calendarEventUpdate',
266
- 'Required parameter "calendarEventUpdate" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().'
313
+ 'Required parameter "calendarEventUpdate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().'
267
314
  );
268
315
  }
269
316
 
@@ -282,8 +329,9 @@ export class CalendarApi extends runtime.BaseAPI {
282
329
  }
283
330
  }
284
331
 
285
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
332
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
286
333
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
334
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
287
335
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
288
336
 
289
337
  const response = await this.request({
@@ -301,34 +349,40 @@ export class CalendarApi extends runtime.BaseAPI {
301
349
  * Partial update - only provided fields will be modified
302
350
  * Update a calendar event
303
351
  */
304
- async organizationsOrganizationIdEventsEventIdPut(requestParameters: OrganizationsOrganizationIdEventsEventIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
305
- const response = await this.organizationsOrganizationIdEventsEventIdPutRaw(requestParameters, initOverrides);
352
+ async organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
353
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRaw(requestParameters, initOverrides);
306
354
  return await response.value();
307
355
  }
308
356
 
309
357
  /**
310
- * Returns events and their associated calendars. Optionally filter by specific calendar IDs.
311
358
  * List calendar events within a date range
312
359
  */
313
- async organizationsOrganizationIdEventsGetRaw(requestParameters: OrganizationsOrganizationIdEventsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEventResponse>> {
360
+ async organizationsOrganizationIdCalendarsCalendarIdEventsGetRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEventListResponse>> {
314
361
  if (requestParameters['organizationId'] == null) {
315
362
  throw new runtime.RequiredError(
316
363
  'organizationId',
317
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsGet().'
364
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().'
365
+ );
366
+ }
367
+
368
+ if (requestParameters['calendarId'] == null) {
369
+ throw new runtime.RequiredError(
370
+ 'calendarId',
371
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().'
318
372
  );
319
373
  }
320
374
 
321
375
  if (requestParameters['start'] == null) {
322
376
  throw new runtime.RequiredError(
323
377
  'start',
324
- 'Required parameter "start" was null or undefined when calling organizationsOrganizationIdEventsGet().'
378
+ 'Required parameter "start" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().'
325
379
  );
326
380
  }
327
381
 
328
382
  if (requestParameters['end'] == null) {
329
383
  throw new runtime.RequiredError(
330
384
  'end',
331
- 'Required parameter "end" was null or undefined when calling organizationsOrganizationIdEventsGet().'
385
+ 'Required parameter "end" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().'
332
386
  );
333
387
  }
334
388
 
@@ -342,10 +396,6 @@ export class CalendarApi extends runtime.BaseAPI {
342
396
  queryParameters['end'] = (requestParameters['end'] as any).toISOString();
343
397
  }
344
398
 
345
- if (requestParameters['calendarIds'] != null) {
346
- queryParameters['calendar_ids'] = requestParameters['calendarIds'];
347
- }
348
-
349
399
  const headerParameters: runtime.HTTPHeaders = {};
350
400
 
351
401
  if (this.configuration && this.configuration.accessToken) {
@@ -357,8 +407,9 @@ export class CalendarApi extends runtime.BaseAPI {
357
407
  }
358
408
  }
359
409
 
360
- let urlPath = `/organizations/{organizationId}/events`;
410
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events`;
361
411
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
412
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
362
413
 
363
414
  const response = await this.request({
364
415
  path: urlPath,
@@ -367,33 +418,39 @@ export class CalendarApi extends runtime.BaseAPI {
367
418
  query: queryParameters,
368
419
  }, initOverrides);
369
420
 
370
- return new runtime.JSONApiResponse(response, (jsonValue) => CalendarEventResponseFromJSON(jsonValue));
421
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarEventListResponseFromJSON(jsonValue));
371
422
  }
372
423
 
373
424
  /**
374
- * Returns events and their associated calendars. Optionally filter by specific calendar IDs.
375
425
  * List calendar events within a date range
376
426
  */
377
- async organizationsOrganizationIdEventsGet(requestParameters: OrganizationsOrganizationIdEventsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEventResponse> {
378
- const response = await this.organizationsOrganizationIdEventsGetRaw(requestParameters, initOverrides);
427
+ async organizationsOrganizationIdCalendarsCalendarIdEventsGet(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEventListResponse> {
428
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdEventsGetRaw(requestParameters, initOverrides);
379
429
  return await response.value();
380
430
  }
381
431
 
382
432
  /**
383
433
  * Create a new calendar event
384
434
  */
385
- async organizationsOrganizationIdEventsPostRaw(requestParameters: OrganizationsOrganizationIdEventsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
435
+ async organizationsOrganizationIdCalendarsCalendarIdEventsPostRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarEvent>> {
386
436
  if (requestParameters['organizationId'] == null) {
387
437
  throw new runtime.RequiredError(
388
438
  'organizationId',
389
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsPost().'
439
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().'
440
+ );
441
+ }
442
+
443
+ if (requestParameters['calendarId'] == null) {
444
+ throw new runtime.RequiredError(
445
+ 'calendarId',
446
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().'
390
447
  );
391
448
  }
392
449
 
393
450
  if (requestParameters['calendarEventCreate'] == null) {
394
451
  throw new runtime.RequiredError(
395
452
  'calendarEventCreate',
396
- 'Required parameter "calendarEventCreate" was null or undefined when calling organizationsOrganizationIdEventsPost().'
453
+ 'Required parameter "calendarEventCreate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().'
397
454
  );
398
455
  }
399
456
 
@@ -412,8 +469,9 @@ export class CalendarApi extends runtime.BaseAPI {
412
469
  }
413
470
  }
414
471
 
415
- let urlPath = `/organizations/{organizationId}/events`;
472
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events`;
416
473
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
474
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
417
475
 
418
476
  const response = await this.request({
419
477
  path: urlPath,
@@ -429,27 +487,26 @@ export class CalendarApi extends runtime.BaseAPI {
429
487
  /**
430
488
  * Create a new calendar event
431
489
  */
432
- async organizationsOrganizationIdEventsPost(requestParameters: OrganizationsOrganizationIdEventsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
433
- const response = await this.organizationsOrganizationIdEventsPostRaw(requestParameters, initOverrides);
490
+ async organizationsOrganizationIdCalendarsCalendarIdEventsPost(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdEventsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarEvent> {
491
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdEventsPostRaw(requestParameters, initOverrides);
434
492
  return await response.value();
435
493
  }
436
494
 
437
495
  /**
438
- * Deletes the calendar and all associated events for the specified voice agent.
439
- * Delete calendar for a voice agent
496
+ * Get a calendar by ID
440
497
  */
441
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
498
+ async organizationsOrganizationIdCalendarsCalendarIdGetRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Calendar>> {
442
499
  if (requestParameters['organizationId'] == null) {
443
500
  throw new runtime.RequiredError(
444
501
  'organizationId',
445
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete().'
502
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdGet().'
446
503
  );
447
504
  }
448
505
 
449
- if (requestParameters['voiceAgentId'] == null) {
506
+ if (requestParameters['calendarId'] == null) {
450
507
  throw new runtime.RequiredError(
451
- 'voiceAgentId',
452
- 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete().'
508
+ 'calendarId',
509
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdGet().'
453
510
  );
454
511
  }
455
512
 
@@ -466,49 +523,111 @@ export class CalendarApi extends runtime.BaseAPI {
466
523
  }
467
524
  }
468
525
 
469
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
526
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
470
527
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
471
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
528
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
472
529
 
473
530
  const response = await this.request({
474
531
  path: urlPath,
475
- method: 'DELETE',
532
+ method: 'GET',
476
533
  headers: headerParameters,
477
534
  query: queryParameters,
478
535
  }, initOverrides);
479
536
 
480
- return new runtime.VoidApiResponse(response);
537
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
481
538
  }
482
539
 
483
540
  /**
484
- * Deletes the calendar and all associated events for the specified voice agent.
485
- * Delete calendar for a voice agent
541
+ * Get a calendar by ID
486
542
  */
487
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
488
- await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRaw(requestParameters, initOverrides);
543
+ async organizationsOrganizationIdCalendarsCalendarIdGet(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Calendar> {
544
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdGetRaw(requestParameters, initOverrides);
545
+ return await response.value();
489
546
  }
490
547
 
491
548
  /**
492
- * Returns the calendar associated with a specific voice agent.
493
- * Get calendar for a voice agent
549
+ * Re-assign the calendar to a different voice agent in the same organization.
550
+ * Update a calendar
494
551
  */
495
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Calendar>> {
552
+ async organizationsOrganizationIdCalendarsCalendarIdPutRaw(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Calendar>> {
496
553
  if (requestParameters['organizationId'] == null) {
497
554
  throw new runtime.RequiredError(
498
555
  'organizationId',
499
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet().'
556
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().'
557
+ );
558
+ }
559
+
560
+ if (requestParameters['calendarId'] == null) {
561
+ throw new runtime.RequiredError(
562
+ 'calendarId',
563
+ 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().'
564
+ );
565
+ }
566
+
567
+ if (requestParameters['calendarUpdate'] == null) {
568
+ throw new runtime.RequiredError(
569
+ 'calendarUpdate',
570
+ 'Required parameter "calendarUpdate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().'
500
571
  );
501
572
  }
502
573
 
503
- if (requestParameters['voiceAgentId'] == null) {
574
+ const queryParameters: any = {};
575
+
576
+ const headerParameters: runtime.HTTPHeaders = {};
577
+
578
+ headerParameters['Content-Type'] = 'application/json';
579
+
580
+ if (this.configuration && this.configuration.accessToken) {
581
+ const token = this.configuration.accessToken;
582
+ const tokenString = await token("bearerAuth", []);
583
+
584
+ if (tokenString) {
585
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
586
+ }
587
+ }
588
+
589
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
590
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
591
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
592
+
593
+ const response = await this.request({
594
+ path: urlPath,
595
+ method: 'PUT',
596
+ headers: headerParameters,
597
+ query: queryParameters,
598
+ body: CalendarUpdateToJSON(requestParameters['calendarUpdate']),
599
+ }, initOverrides);
600
+
601
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
602
+ }
603
+
604
+ /**
605
+ * Re-assign the calendar to a different voice agent in the same organization.
606
+ * Update a calendar
607
+ */
608
+ async organizationsOrganizationIdCalendarsCalendarIdPut(requestParameters: OrganizationsOrganizationIdCalendarsCalendarIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Calendar> {
609
+ const response = await this.organizationsOrganizationIdCalendarsCalendarIdPutRaw(requestParameters, initOverrides);
610
+ return await response.value();
611
+ }
612
+
613
+ /**
614
+ * Returns all calendars with agent information. Optionally filter by voice_agent_id.
615
+ * List all calendars in the organization
616
+ */
617
+ async organizationsOrganizationIdCalendarsGetRaw(requestParameters: OrganizationsOrganizationIdCalendarsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CalendarListResponse>> {
618
+ if (requestParameters['organizationId'] == null) {
504
619
  throw new runtime.RequiredError(
505
- 'voiceAgentId',
506
- 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet().'
620
+ 'organizationId',
621
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsGet().'
507
622
  );
508
623
  }
509
624
 
510
625
  const queryParameters: any = {};
511
626
 
627
+ if (requestParameters['voiceAgentId'] != null) {
628
+ queryParameters['voice_agent_id'] = requestParameters['voiceAgentId'];
629
+ }
630
+
512
631
  const headerParameters: runtime.HTTPHeaders = {};
513
632
 
514
633
  if (this.configuration && this.configuration.accessToken) {
@@ -520,9 +639,8 @@ export class CalendarApi extends runtime.BaseAPI {
520
639
  }
521
640
  }
522
641
 
523
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
642
+ let urlPath = `/organizations/{organizationId}/calendars`;
524
643
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
525
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
526
644
 
527
645
  const response = await this.request({
528
646
  path: urlPath,
@@ -531,34 +649,34 @@ export class CalendarApi extends runtime.BaseAPI {
531
649
  query: queryParameters,
532
650
  }, initOverrides);
533
651
 
534
- return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
652
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarListResponseFromJSON(jsonValue));
535
653
  }
536
654
 
537
655
  /**
538
- * Returns the calendar associated with a specific voice agent.
539
- * Get calendar for a voice agent
656
+ * Returns all calendars with agent information. Optionally filter by voice_agent_id.
657
+ * List all calendars in the organization
540
658
  */
541
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Calendar> {
542
- const response = await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRaw(requestParameters, initOverrides);
659
+ async organizationsOrganizationIdCalendarsGet(requestParameters: OrganizationsOrganizationIdCalendarsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CalendarListResponse> {
660
+ const response = await this.organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides);
543
661
  return await response.value();
544
662
  }
545
663
 
546
664
  /**
547
- * Creates a new calendar for the specified voice agent. Only one calendar per agent is allowed.
665
+ * Creates a new calendar linked to the specified voice agent. Only one calendar per agent is allowed.
548
666
  * Create a calendar for a voice agent
549
667
  */
550
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Calendar>> {
668
+ async organizationsOrganizationIdCalendarsPostRaw(requestParameters: OrganizationsOrganizationIdCalendarsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Calendar>> {
551
669
  if (requestParameters['organizationId'] == null) {
552
670
  throw new runtime.RequiredError(
553
671
  'organizationId',
554
- 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost().'
672
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsPost().'
555
673
  );
556
674
  }
557
675
 
558
- if (requestParameters['voiceAgentId'] == null) {
676
+ if (requestParameters['calendarCreate'] == null) {
559
677
  throw new runtime.RequiredError(
560
- 'voiceAgentId',
561
- 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost().'
678
+ 'calendarCreate',
679
+ 'Required parameter "calendarCreate" was null or undefined when calling organizationsOrganizationIdCalendarsPost().'
562
680
  );
563
681
  }
564
682
 
@@ -566,6 +684,8 @@ export class CalendarApi extends runtime.BaseAPI {
566
684
 
567
685
  const headerParameters: runtime.HTTPHeaders = {};
568
686
 
687
+ headerParameters['Content-Type'] = 'application/json';
688
+
569
689
  if (this.configuration && this.configuration.accessToken) {
570
690
  const token = this.configuration.accessToken;
571
691
  const tokenString = await token("bearerAuth", []);
@@ -575,26 +695,26 @@ export class CalendarApi extends runtime.BaseAPI {
575
695
  }
576
696
  }
577
697
 
578
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
698
+ let urlPath = `/organizations/{organizationId}/calendars`;
579
699
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
580
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
581
700
 
582
701
  const response = await this.request({
583
702
  path: urlPath,
584
703
  method: 'POST',
585
704
  headers: headerParameters,
586
705
  query: queryParameters,
706
+ body: CalendarCreateToJSON(requestParameters['calendarCreate']),
587
707
  }, initOverrides);
588
708
 
589
709
  return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
590
710
  }
591
711
 
592
712
  /**
593
- * Creates a new calendar for the specified voice agent. Only one calendar per agent is allowed.
713
+ * Creates a new calendar linked to the specified voice agent. Only one calendar per agent is allowed.
594
714
  * Create a calendar for a voice agent
595
715
  */
596
- async organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Calendar> {
597
- const response = await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRaw(requestParameters, initOverrides);
716
+ async organizationsOrganizationIdCalendarsPost(requestParameters: OrganizationsOrganizationIdCalendarsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Calendar> {
717
+ const response = await this.organizationsOrganizationIdCalendarsPostRaw(requestParameters, initOverrides);
598
718
  return await response.value();
599
719
  }
600
720