@hostinger/mail-sdk 1.19.0

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 (78) hide show
  1. package/.github/workflows/build-release.yaml +135 -0
  2. package/CODEOWNERS +1 -0
  3. package/README.md +9 -0
  4. package/api.ts +3791 -0
  5. package/base.ts +83 -0
  6. package/common.ts +111 -0
  7. package/configuration.ts +72 -0
  8. package/dist/api.d.ts +2457 -0
  9. package/dist/api.js +2484 -0
  10. package/dist/base.d.ts +63 -0
  11. package/dist/base.js +62 -0
  12. package/dist/common.d.ts +47 -0
  13. package/dist/common.js +118 -0
  14. package/dist/configuration.d.ts +51 -0
  15. package/dist/configuration.js +37 -0
  16. package/dist/esm/api.d.ts +2457 -0
  17. package/dist/esm/api.js +2457 -0
  18. package/dist/esm/base.d.ts +63 -0
  19. package/dist/esm/base.js +57 -0
  20. package/dist/esm/common.d.ts +47 -0
  21. package/dist/esm/common.js +109 -0
  22. package/dist/esm/configuration.d.ts +51 -0
  23. package/dist/esm/configuration.js +33 -0
  24. package/dist/esm/index.d.ts +10 -0
  25. package/dist/esm/index.js +12 -0
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.js +28 -0
  28. package/docs/AccountApi.md +55 -0
  29. package/docs/Error.md +25 -0
  30. package/docs/FoldersApi.md +259 -0
  31. package/docs/MessagesApi.md +860 -0
  32. package/docs/Pagination.md +27 -0
  33. package/docs/QuotaApi.md +63 -0
  34. package/docs/SendApi.md +68 -0
  35. package/docs/V1FolderMessagesCollection.md +23 -0
  36. package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
  37. package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
  38. package/docs/V1FolderMessagesFlagsRequest.md +23 -0
  39. package/docs/V1FolderMessagesMessage.md +47 -0
  40. package/docs/V1FolderMessagesMessageAddress.md +23 -0
  41. package/docs/V1FolderMessagesMessageAttachment.md +31 -0
  42. package/docs/V1FolderMessagesMessageText.md +23 -0
  43. package/docs/V1FolderMessagesMessageTextResource.md +21 -0
  44. package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
  45. package/docs/V1FolderMessagesMoveRequest.md +21 -0
  46. package/docs/V1FolderMessagesResource.md +21 -0
  47. package/docs/V1FolderMessagesSearchRequest.md +45 -0
  48. package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
  49. package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
  50. package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
  51. package/docs/V1FoldersCollection.md +23 -0
  52. package/docs/V1FoldersCreateRequest.md +21 -0
  53. package/docs/V1FoldersFolder.md +31 -0
  54. package/docs/V1FoldersResource.md +21 -0
  55. package/docs/V1FoldersUpdateRequest.md +21 -0
  56. package/docs/V1MeMailbox.md +23 -0
  57. package/docs/V1MeResource.md +21 -0
  58. package/docs/V1MeResourceData.md +22 -0
  59. package/docs/V1QuotaQuota.md +29 -0
  60. package/docs/V1QuotaQuotaResource.md +27 -0
  61. package/docs/V1QuotaResource.md +21 -0
  62. package/docs/V1SendAttachment.md +29 -0
  63. package/docs/V1SendMessageRef.md +23 -0
  64. package/docs/V1SendRequest.md +39 -0
  65. package/docs/V1WebhooksCollection.md +23 -0
  66. package/docs/V1WebhooksCreateRequest.md +29 -0
  67. package/docs/V1WebhooksResource.md +21 -0
  68. package/docs/V1WebhooksResourceWithSecret.md +21 -0
  69. package/docs/V1WebhooksTestResult.md +21 -0
  70. package/docs/V1WebhooksTestResultData.md +24 -0
  71. package/docs/V1WebhooksUpdateRequest.md +29 -0
  72. package/docs/V1WebhooksWebhook.md +39 -0
  73. package/docs/V1WebhooksWebhookWithSecret.md +41 -0
  74. package/docs/WebhooksApi.md +439 -0
  75. package/index.ts +15 -0
  76. package/package.json +34 -0
  77. package/tsconfig.esm.json +7 -0
  78. package/tsconfig.json +18 -0
package/api.ts ADDED
@@ -0,0 +1,3791 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Hostinger Mail API
5
+ *
6
+ * API Version: 1.1.0
7
+ *
8
+ * NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
9
+ * If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
10
+ */
11
+
12
+
13
+ import type { Configuration } from './configuration';
14
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
15
+ import globalAxios from 'axios';
16
+ // Some imports not used depending on template conditions
17
+ // @ts-ignore
18
+ import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
19
+ import type { RequestArgs } from './base';
20
+ // @ts-ignore
21
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
22
+
23
+ /**
24
+ * Standard error envelope. Frontend translations key off `code`, never off `error`.
25
+ * @export
26
+ * @interface ModelError
27
+ */
28
+ export interface ModelError {
29
+ /**
30
+ * Human-readable error message.
31
+ * @type {string}
32
+ * @memberof ModelError
33
+ */
34
+ 'error': string;
35
+ /**
36
+ * Machine-readable error code in SCREAMING_SNAKE_CASE.
37
+ * @type {string}
38
+ * @memberof ModelError
39
+ */
40
+ 'code': string;
41
+ /**
42
+ * Additional structured context for the error. May be omitted.
43
+ * @type {{ [key: string]: any; }}
44
+ * @memberof ModelError
45
+ */
46
+ 'params': { [key: string]: any; };
47
+ }
48
+ /**
49
+ * Pagination metadata for paginated collections.
50
+ * @export
51
+ * @interface Pagination
52
+ */
53
+ export interface Pagination {
54
+ /**
55
+ * Current page number (1-based).
56
+ * @type {number}
57
+ * @memberof Pagination
58
+ */
59
+ 'page': number;
60
+ /**
61
+ * Items per page.
62
+ * @type {number}
63
+ * @memberof Pagination
64
+ */
65
+ 'perPage': number;
66
+ /**
67
+ * Total number of items across all pages.
68
+ * @type {number}
69
+ * @memberof Pagination
70
+ */
71
+ 'total': number;
72
+ /**
73
+ * Total number of pages.
74
+ * @type {number}
75
+ * @memberof Pagination
76
+ */
77
+ 'totalPages': number;
78
+ }
79
+ /**
80
+ * Paginated list of messages.
81
+ * @export
82
+ * @interface V1FolderMessagesCollection
83
+ */
84
+ export interface V1FolderMessagesCollection {
85
+ /**
86
+ *
87
+ * @type {Array<V1FolderMessagesMessage>}
88
+ * @memberof V1FolderMessagesCollection
89
+ */
90
+ 'data': Array<V1FolderMessagesMessage>;
91
+ /**
92
+ *
93
+ * @type {Pagination}
94
+ * @memberof V1FolderMessagesCollection
95
+ */
96
+ 'pagination': Pagination;
97
+ }
98
+ /**
99
+ * Body for permanently deleting multiple messages.
100
+ * @export
101
+ * @interface V1FolderMessagesDeleteBulkRequest
102
+ */
103
+ export interface V1FolderMessagesDeleteBulkRequest {
104
+ /**
105
+ * Message UIDs to delete. 1-100 entries, each > 0.
106
+ * @type {Array<number>}
107
+ * @memberof V1FolderMessagesDeleteBulkRequest
108
+ */
109
+ 'uids': Array<number>;
110
+ }
111
+ /**
112
+ * Add and/or remove flags on multiple messages. At least one of addFlags or removeFlags must be set.
113
+ * @export
114
+ * @interface V1FolderMessagesFlagsBulkRequest
115
+ */
116
+ export interface V1FolderMessagesFlagsBulkRequest {
117
+ /**
118
+ * Message UIDs to update. 1-100 entries, each > 0.
119
+ * @type {Array<number>}
120
+ * @memberof V1FolderMessagesFlagsBulkRequest
121
+ */
122
+ 'uids': Array<number>;
123
+ /**
124
+ *
125
+ * @type {Array<string>}
126
+ * @memberof V1FolderMessagesFlagsBulkRequest
127
+ */
128
+ 'addFlags': Array<string>;
129
+ /**
130
+ *
131
+ * @type {Array<string>}
132
+ * @memberof V1FolderMessagesFlagsBulkRequest
133
+ */
134
+ 'removeFlags': Array<string>;
135
+ }
136
+ /**
137
+ * Add and/or remove flags on a message. At least one of addFlags or removeFlags must be set.
138
+ * @export
139
+ * @interface V1FolderMessagesFlagsRequest
140
+ */
141
+ export interface V1FolderMessagesFlagsRequest {
142
+ /**
143
+ *
144
+ * @type {Array<string>}
145
+ * @memberof V1FolderMessagesFlagsRequest
146
+ */
147
+ 'addFlags': Array<string>;
148
+ /**
149
+ *
150
+ * @type {Array<string>}
151
+ * @memberof V1FolderMessagesFlagsRequest
152
+ */
153
+ 'removeFlags': Array<string>;
154
+ }
155
+ /**
156
+ * A message in a folder of the managed mailbox.
157
+ * @export
158
+ * @interface V1FolderMessagesMessage
159
+ */
160
+ export interface V1FolderMessagesMessage {
161
+ /**
162
+ *
163
+ * @type {number}
164
+ * @memberof V1FolderMessagesMessage
165
+ */
166
+ 'uid': number;
167
+ /**
168
+ *
169
+ * @type {string}
170
+ * @memberof V1FolderMessagesMessage
171
+ */
172
+ 'path': string;
173
+ /**
174
+ *
175
+ * @type {string}
176
+ * @memberof V1FolderMessagesMessage
177
+ */
178
+ 'date': string;
179
+ /**
180
+ *
181
+ * @type {Array<string>}
182
+ * @memberof V1FolderMessagesMessage
183
+ */
184
+ 'flags': Array<string>;
185
+ /**
186
+ *
187
+ * @type {boolean}
188
+ * @memberof V1FolderMessagesMessage
189
+ */
190
+ 'unseen': boolean;
191
+ /**
192
+ *
193
+ * @type {number}
194
+ * @memberof V1FolderMessagesMessage
195
+ */
196
+ 'size': number;
197
+ /**
198
+ *
199
+ * @type {string}
200
+ * @memberof V1FolderMessagesMessage
201
+ */
202
+ 'subject': string | null;
203
+ /**
204
+ *
205
+ * @type {V1FolderMessagesMessageAddress}
206
+ * @memberof V1FolderMessagesMessage
207
+ */
208
+ 'from': V1FolderMessagesMessageAddress | null;
209
+ /**
210
+ *
211
+ * @type {Array<V1FolderMessagesMessageAddress>}
212
+ * @memberof V1FolderMessagesMessage
213
+ */
214
+ 'to': Array<V1FolderMessagesMessageAddress>;
215
+ /**
216
+ *
217
+ * @type {Array<V1FolderMessagesMessageAddress>}
218
+ * @memberof V1FolderMessagesMessage
219
+ */
220
+ 'cc': Array<V1FolderMessagesMessageAddress>;
221
+ /**
222
+ *
223
+ * @type {Array<V1FolderMessagesMessageAddress>}
224
+ * @memberof V1FolderMessagesMessage
225
+ */
226
+ 'bcc': Array<V1FolderMessagesMessageAddress>;
227
+ /**
228
+ *
229
+ * @type {string}
230
+ * @memberof V1FolderMessagesMessage
231
+ */
232
+ 'messageId': string | null;
233
+ /**
234
+ *
235
+ * @type {string}
236
+ * @memberof V1FolderMessagesMessage
237
+ */
238
+ 'inReplyTo': string | null;
239
+ /**
240
+ *
241
+ * @type {Array<V1FolderMessagesMessageAttachment>}
242
+ * @memberof V1FolderMessagesMessage
243
+ */
244
+ 'attachments': Array<V1FolderMessagesMessageAttachment>;
245
+ }
246
+ /**
247
+ * A single email address with optional display name.
248
+ * @export
249
+ * @interface V1FolderMessagesMessageAddress
250
+ */
251
+ export interface V1FolderMessagesMessageAddress {
252
+ /**
253
+ *
254
+ * @type {string}
255
+ * @memberof V1FolderMessagesMessageAddress
256
+ */
257
+ 'name': string;
258
+ /**
259
+ *
260
+ * @type {string}
261
+ * @memberof V1FolderMessagesMessageAddress
262
+ */
263
+ 'address': string;
264
+ }
265
+ /**
266
+ * Attachment metadata attached to a message.
267
+ * @export
268
+ * @interface V1FolderMessagesMessageAttachment
269
+ */
270
+ export interface V1FolderMessagesMessageAttachment {
271
+ /**
272
+ * Opaque attachment identifier. Use as the {attachmentId} path parameter on the download endpoint.
273
+ * @type {string}
274
+ * @memberof V1FolderMessagesMessageAttachment
275
+ */
276
+ 'id': string;
277
+ /**
278
+ *
279
+ * @type {string}
280
+ * @memberof V1FolderMessagesMessageAttachment
281
+ */
282
+ 'contentType': string;
283
+ /**
284
+ *
285
+ * @type {number}
286
+ * @memberof V1FolderMessagesMessageAttachment
287
+ */
288
+ 'sizeBytes': number;
289
+ /**
290
+ *
291
+ * @type {boolean}
292
+ * @memberof V1FolderMessagesMessageAttachment
293
+ */
294
+ 'inline': boolean;
295
+ /**
296
+ *
297
+ * @type {string}
298
+ * @memberof V1FolderMessagesMessageAttachment
299
+ */
300
+ 'filename': string | null;
301
+ /**
302
+ *
303
+ * @type {string}
304
+ * @memberof V1FolderMessagesMessageAttachment
305
+ */
306
+ 'contentId': string | null;
307
+ }
308
+ /**
309
+ * Rendered text and HTML parts of a message.
310
+ * @export
311
+ * @interface V1FolderMessagesMessageText
312
+ */
313
+ export interface V1FolderMessagesMessageText {
314
+ /**
315
+ *
316
+ * @type {string}
317
+ * @memberof V1FolderMessagesMessageText
318
+ */
319
+ 'text': string;
320
+ /**
321
+ *
322
+ * @type {string}
323
+ * @memberof V1FolderMessagesMessageText
324
+ */
325
+ 'html': string;
326
+ }
327
+ /**
328
+ * Single message text payload.
329
+ * @export
330
+ * @interface V1FolderMessagesMessageTextResource
331
+ */
332
+ export interface V1FolderMessagesMessageTextResource {
333
+ /**
334
+ *
335
+ * @type {V1FolderMessagesMessageText}
336
+ * @memberof V1FolderMessagesMessageTextResource
337
+ */
338
+ 'data': V1FolderMessagesMessageText;
339
+ }
340
+ /**
341
+ * Body for moving multiple messages to a target folder.
342
+ * @export
343
+ * @interface V1FolderMessagesMoveBulkRequest
344
+ */
345
+ export interface V1FolderMessagesMoveBulkRequest {
346
+ /**
347
+ * Message UIDs to move. 1-100 entries, each > 0.
348
+ * @type {Array<number>}
349
+ * @memberof V1FolderMessagesMoveBulkRequest
350
+ */
351
+ 'uids': Array<number>;
352
+ /**
353
+ * Destination folder path.
354
+ * @type {string}
355
+ * @memberof V1FolderMessagesMoveBulkRequest
356
+ */
357
+ 'targetFolder': string;
358
+ }
359
+ /**
360
+ * Body for moving a single message to a target folder.
361
+ * @export
362
+ * @interface V1FolderMessagesMoveRequest
363
+ */
364
+ export interface V1FolderMessagesMoveRequest {
365
+ /**
366
+ * Destination folder path.
367
+ * @type {string}
368
+ * @memberof V1FolderMessagesMoveRequest
369
+ */
370
+ 'targetFolder': string;
371
+ }
372
+ /**
373
+ * Single message payload.
374
+ * @export
375
+ * @interface V1FolderMessagesResource
376
+ */
377
+ export interface V1FolderMessagesResource {
378
+ /**
379
+ *
380
+ * @type {V1FolderMessagesMessage}
381
+ * @memberof V1FolderMessagesResource
382
+ */
383
+ 'data': V1FolderMessagesMessage;
384
+ }
385
+ /**
386
+ * Search criteria. All fields optional; combine to narrow results.
387
+ * @export
388
+ * @interface V1FolderMessagesSearchRequest
389
+ */
390
+ export interface V1FolderMessagesSearchRequest {
391
+ /**
392
+ *
393
+ * @type {string}
394
+ * @memberof V1FolderMessagesSearchRequest
395
+ */
396
+ 'since': string;
397
+ /**
398
+ *
399
+ * @type {string}
400
+ * @memberof V1FolderMessagesSearchRequest
401
+ */
402
+ 'before': string;
403
+ /**
404
+ *
405
+ * @type {Array<string>}
406
+ * @memberof V1FolderMessagesSearchRequest
407
+ */
408
+ 'flags': Array<string>;
409
+ /**
410
+ *
411
+ * @type {string}
412
+ * @memberof V1FolderMessagesSearchRequest
413
+ */
414
+ 'uid': string;
415
+ /**
416
+ *
417
+ * @type {string}
418
+ * @memberof V1FolderMessagesSearchRequest
419
+ */
420
+ 'subject': string;
421
+ /**
422
+ *
423
+ * @type {string}
424
+ * @memberof V1FolderMessagesSearchRequest
425
+ */
426
+ 'from': string;
427
+ /**
428
+ *
429
+ * @type {string}
430
+ * @memberof V1FolderMessagesSearchRequest
431
+ */
432
+ 'to': string;
433
+ /**
434
+ *
435
+ * @type {string}
436
+ * @memberof V1FolderMessagesSearchRequest
437
+ */
438
+ 'cc': string;
439
+ /**
440
+ *
441
+ * @type {string}
442
+ * @memberof V1FolderMessagesSearchRequest
443
+ */
444
+ 'body': string;
445
+ /**
446
+ *
447
+ * @type {string}
448
+ * @memberof V1FolderMessagesSearchRequest
449
+ */
450
+ 'header': string;
451
+ /**
452
+ *
453
+ * @type {number}
454
+ * @memberof V1FolderMessagesSearchRequest
455
+ */
456
+ 'larger': number;
457
+ /**
458
+ *
459
+ * @type {number}
460
+ * @memberof V1FolderMessagesSearchRequest
461
+ */
462
+ 'smaller': number;
463
+ /**
464
+ *
465
+ * @type {string}
466
+ * @memberof V1FolderMessagesSearchRequest
467
+ */
468
+ 'text': string;
469
+ }
470
+ /**
471
+ * Per-UID outcome of a bulk flag update. 200 when every UID succeeded, 207 when at least one failed.
472
+ * @export
473
+ * @interface V1FolderMessagesUpdateFlagsResult
474
+ */
475
+ export interface V1FolderMessagesUpdateFlagsResult {
476
+ /**
477
+ *
478
+ * @type {V1FolderMessagesUpdateFlagsResultData}
479
+ * @memberof V1FolderMessagesUpdateFlagsResult
480
+ */
481
+ 'data': V1FolderMessagesUpdateFlagsResultData;
482
+ }
483
+ /**
484
+ *
485
+ * @export
486
+ * @interface V1FolderMessagesUpdateFlagsResultData
487
+ */
488
+ export interface V1FolderMessagesUpdateFlagsResultData {
489
+ /**
490
+ *
491
+ * @type {Array<number>}
492
+ * @memberof V1FolderMessagesUpdateFlagsResultData
493
+ */
494
+ 'successful': Array<number>;
495
+ /**
496
+ *
497
+ * @type {Array<V1FolderMessagesUpdateFlagsResultDataFailedInner>}
498
+ * @memberof V1FolderMessagesUpdateFlagsResultData
499
+ */
500
+ 'failed': Array<V1FolderMessagesUpdateFlagsResultDataFailedInner>;
501
+ }
502
+ /**
503
+ *
504
+ * @export
505
+ * @interface V1FolderMessagesUpdateFlagsResultDataFailedInner
506
+ */
507
+ export interface V1FolderMessagesUpdateFlagsResultDataFailedInner {
508
+ /**
509
+ *
510
+ * @type {number}
511
+ * @memberof V1FolderMessagesUpdateFlagsResultDataFailedInner
512
+ */
513
+ 'uid': number;
514
+ /**
515
+ *
516
+ * @type {string}
517
+ * @memberof V1FolderMessagesUpdateFlagsResultDataFailedInner
518
+ */
519
+ 'reason': string;
520
+ }
521
+ /**
522
+ * Paginated list of folders.
523
+ * @export
524
+ * @interface V1FoldersCollection
525
+ */
526
+ export interface V1FoldersCollection {
527
+ /**
528
+ *
529
+ * @type {Array<V1FoldersFolder>}
530
+ * @memberof V1FoldersCollection
531
+ */
532
+ 'data': Array<V1FoldersFolder>;
533
+ /**
534
+ *
535
+ * @type {Pagination}
536
+ * @memberof V1FoldersCollection
537
+ */
538
+ 'pagination': Pagination;
539
+ }
540
+ /**
541
+ * Body for creating a folder.
542
+ * @export
543
+ * @interface V1FoldersCreateRequest
544
+ */
545
+ export interface V1FoldersCreateRequest {
546
+ /**
547
+ * Folder name. Length 1-100 after trimming.
548
+ * @type {string}
549
+ * @memberof V1FoldersCreateRequest
550
+ */
551
+ 'name': string;
552
+ }
553
+ /**
554
+ * A folder (IMAP mailbox) in the managed mailbox.
555
+ * @export
556
+ * @interface V1FoldersFolder
557
+ */
558
+ export interface V1FoldersFolder {
559
+ /**
560
+ * Full hierarchical folder path including the delimiter.
561
+ * @type {string}
562
+ * @memberof V1FoldersFolder
563
+ */
564
+ 'path': string;
565
+ /**
566
+ * Leaf name of the folder.
567
+ * @type {string}
568
+ * @memberof V1FoldersFolder
569
+ */
570
+ 'name': string;
571
+ /**
572
+ * Hierarchy delimiter used by the IMAP server.
573
+ * @type {string}
574
+ * @memberof V1FoldersFolder
575
+ */
576
+ 'delimiter': string;
577
+ /**
578
+ * IMAP SPECIAL-USE attribute (RFC 6154). `null` for regular folders.
579
+ * @type {string}
580
+ * @memberof V1FoldersFolder
581
+ */
582
+ 'specialUse': string | null;
583
+ /**
584
+ * Total number of messages in the folder.
585
+ * @type {number}
586
+ * @memberof V1FoldersFolder
587
+ */
588
+ 'messageCount': number;
589
+ /**
590
+ * Number of unread messages in the folder.
591
+ * @type {number}
592
+ * @memberof V1FoldersFolder
593
+ */
594
+ 'unreadCount': number;
595
+ }
596
+ /**
597
+ * Single folder payload.
598
+ * @export
599
+ * @interface V1FoldersResource
600
+ */
601
+ export interface V1FoldersResource {
602
+ /**
603
+ *
604
+ * @type {V1FoldersFolder}
605
+ * @memberof V1FoldersResource
606
+ */
607
+ 'data': V1FoldersFolder;
608
+ }
609
+ /**
610
+ * Body for renaming a folder.
611
+ * @export
612
+ * @interface V1FoldersUpdateRequest
613
+ */
614
+ export interface V1FoldersUpdateRequest {
615
+ /**
616
+ * New folder name. Length 1-100 after trimming.
617
+ * @type {string}
618
+ * @memberof V1FoldersUpdateRequest
619
+ */
620
+ 'name': string;
621
+ }
622
+ /**
623
+ * A mailbox the authenticated API token can manage.
624
+ * @export
625
+ * @interface V1MeMailbox
626
+ */
627
+ export interface V1MeMailbox {
628
+ /**
629
+ * Unique identifier of the mailbox.
630
+ * @type {string}
631
+ * @memberof V1MeMailbox
632
+ */
633
+ 'resourceId': string;
634
+ /**
635
+ * Email address of the mailbox.
636
+ * @type {string}
637
+ * @memberof V1MeMailbox
638
+ */
639
+ 'address': string;
640
+ }
641
+ /**
642
+ * Authenticated account payload.
643
+ * @export
644
+ * @interface V1MeResource
645
+ */
646
+ export interface V1MeResource {
647
+ /**
648
+ *
649
+ * @type {V1MeResourceData}
650
+ * @memberof V1MeResource
651
+ */
652
+ 'data': V1MeResourceData;
653
+ }
654
+ /**
655
+ *
656
+ * @export
657
+ * @interface V1MeResourceData
658
+ */
659
+ export interface V1MeResourceData {
660
+ /**
661
+ * Identifier of the order this API token is scoped to.
662
+ * @type {string}
663
+ * @memberof V1MeResourceData
664
+ */
665
+ 'orderResourceId': string;
666
+ /**
667
+ * Mailboxes that the authenticated API token can manage.
668
+ * @type {Array<V1MeMailbox>}
669
+ * @memberof V1MeResourceData
670
+ */
671
+ 'mailboxes': Array<V1MeMailbox>;
672
+ }
673
+ /**
674
+ * Storage and message quota usage for the managed mailbox.
675
+ * @export
676
+ * @interface V1QuotaQuota
677
+ */
678
+ export interface V1QuotaQuota {
679
+ /**
680
+ * Per-resource quota breakdown reported by the IMAP server.
681
+ * @type {Array<V1QuotaQuotaResource>}
682
+ * @memberof V1QuotaQuota
683
+ */
684
+ 'quotas': Array<V1QuotaQuotaResource>;
685
+ /**
686
+ * Aggregate storage usage across all resources, in bytes.
687
+ * @type {number}
688
+ * @memberof V1QuotaQuota
689
+ */
690
+ 'totalUsage': number;
691
+ /**
692
+ * Aggregate storage limit across all resources, in bytes.
693
+ * @type {number}
694
+ * @memberof V1QuotaQuota
695
+ */
696
+ 'totalLimit': number;
697
+ /**
698
+ * Aggregate storage usage as a percentage of the total limit.
699
+ * @type {number}
700
+ * @memberof V1QuotaQuota
701
+ */
702
+ 'totalPercentage': number;
703
+ /**
704
+ * Whether the IMAP server reports quota information for this mailbox.
705
+ * @type {boolean}
706
+ * @memberof V1QuotaQuota
707
+ */
708
+ 'supported': boolean;
709
+ }
710
+ /**
711
+ * Usage and limit for a single IMAP quota resource.
712
+ * @export
713
+ * @interface V1QuotaQuotaResource
714
+ */
715
+ export interface V1QuotaQuotaResource {
716
+ /**
717
+ * Name of the quota resource as reported by the IMAP server.
718
+ * @type {string}
719
+ * @memberof V1QuotaQuotaResource
720
+ */
721
+ 'resourceName': string;
722
+ /**
723
+ * Current usage of the resource (bytes for STORAGE, count for MESSAGE).
724
+ * @type {number}
725
+ * @memberof V1QuotaQuotaResource
726
+ */
727
+ 'usage': number;
728
+ /**
729
+ * Maximum allowed value for the resource (bytes for STORAGE, count for MESSAGE).
730
+ * @type {number}
731
+ * @memberof V1QuotaQuotaResource
732
+ */
733
+ 'limit': number;
734
+ /**
735
+ * Usage as a percentage of the limit.
736
+ * @type {number}
737
+ * @memberof V1QuotaQuotaResource
738
+ */
739
+ 'percentage': number;
740
+ }
741
+ /**
742
+ * Mailbox quota payload.
743
+ * @export
744
+ * @interface V1QuotaResource
745
+ */
746
+ export interface V1QuotaResource {
747
+ /**
748
+ *
749
+ * @type {V1QuotaQuota}
750
+ * @memberof V1QuotaResource
751
+ */
752
+ 'data': V1QuotaQuota;
753
+ }
754
+ /**
755
+ * Attachment payload for outgoing mail. Supports regular attachments and inline images linked via Content-ID.
756
+ * @export
757
+ * @interface V1SendAttachment
758
+ */
759
+ export interface V1SendAttachment {
760
+ /**
761
+ *
762
+ * @type {string}
763
+ * @memberof V1SendAttachment
764
+ */
765
+ 'filename': string;
766
+ /**
767
+ * Attachment body. Base64-encoded by default; set encoding to switch.
768
+ * @type {string}
769
+ * @memberof V1SendAttachment
770
+ */
771
+ 'content': string;
772
+ /**
773
+ *
774
+ * @type {string}
775
+ * @memberof V1SendAttachment
776
+ */
777
+ 'contentType': string;
778
+ /**
779
+ * Content-ID for inline images. Reference from HTML as <img src=\"cid:logo\">.
780
+ * @type {string}
781
+ * @memberof V1SendAttachment
782
+ */
783
+ 'cid': string;
784
+ /**
785
+ * Encoding of content. Defaults to base64.
786
+ * @type {string}
787
+ * @memberof V1SendAttachment
788
+ */
789
+ 'encoding': string;
790
+ }
791
+ /**
792
+ * Reference to a source message by UID within a folder, used for reply/forward threading. Both fields are required.
793
+ * @export
794
+ * @interface V1SendMessageRef
795
+ */
796
+ export interface V1SendMessageRef {
797
+ /**
798
+ * UID of the source message.
799
+ * @type {number}
800
+ * @memberof V1SendMessageRef
801
+ */
802
+ 'uid': number;
803
+ /**
804
+ * Folder containing the source message.
805
+ * @type {string}
806
+ * @memberof V1SendMessageRef
807
+ */
808
+ 'folder': string;
809
+ }
810
+ /**
811
+ * Outgoing message payload. At least one of to, cc, or bcc must be present.
812
+ * @export
813
+ * @interface V1SendRequest
814
+ */
815
+ export interface V1SendRequest {
816
+ /**
817
+ *
818
+ * @type {Array<string>}
819
+ * @memberof V1SendRequest
820
+ */
821
+ 'to': Array<string>;
822
+ /**
823
+ *
824
+ * @type {string}
825
+ * @memberof V1SendRequest
826
+ */
827
+ 'displayName': string;
828
+ /**
829
+ *
830
+ * @type {Array<string>}
831
+ * @memberof V1SendRequest
832
+ */
833
+ 'cc': Array<string>;
834
+ /**
835
+ *
836
+ * @type {Array<string>}
837
+ * @memberof V1SendRequest
838
+ */
839
+ 'bcc': Array<string>;
840
+ /**
841
+ *
842
+ * @type {string}
843
+ * @memberof V1SendRequest
844
+ */
845
+ 'subject': string;
846
+ /**
847
+ *
848
+ * @type {string}
849
+ * @memberof V1SendRequest
850
+ */
851
+ 'text': string;
852
+ /**
853
+ *
854
+ * @type {string}
855
+ * @memberof V1SendRequest
856
+ */
857
+ 'html': string;
858
+ /**
859
+ *
860
+ * @type {Array<V1SendAttachment>}
861
+ * @memberof V1SendRequest
862
+ */
863
+ 'attachments': Array<V1SendAttachment>;
864
+ /**
865
+ * Source message this is a reply to. Copies its Message-Id/References into In-Reply-To/References and flags it \\Answered. Mutually exclusive with forwardOf.
866
+ * @type {V1SendMessageRef}
867
+ * @memberof V1SendRequest
868
+ */
869
+ 'inReplyTo': V1SendMessageRef;
870
+ /**
871
+ * Source message this forwards. Copies its Message-Id/References into In-Reply-To/References and flags it $forwarded. Mutually exclusive with inReplyTo.
872
+ * @type {V1SendMessageRef}
873
+ * @memberof V1SendRequest
874
+ */
875
+ 'forwardOf': V1SendMessageRef;
876
+ }
877
+ /**
878
+ * Paginated list of webhooks.
879
+ * @export
880
+ * @interface V1WebhooksCollection
881
+ */
882
+ export interface V1WebhooksCollection {
883
+ /**
884
+ *
885
+ * @type {Array<V1WebhooksWebhook>}
886
+ * @memberof V1WebhooksCollection
887
+ */
888
+ 'data': Array<V1WebhooksWebhook>;
889
+ /**
890
+ *
891
+ * @type {Pagination}
892
+ * @memberof V1WebhooksCollection
893
+ */
894
+ 'pagination': Pagination;
895
+ }
896
+ /**
897
+ * Body for creating a webhook.
898
+ * @export
899
+ * @interface V1WebhooksCreateRequest
900
+ */
901
+ export interface V1WebhooksCreateRequest {
902
+ /**
903
+ *
904
+ * @type {string}
905
+ * @memberof V1WebhooksCreateRequest
906
+ */
907
+ 'name': string;
908
+ /**
909
+ *
910
+ * @type {string}
911
+ * @memberof V1WebhooksCreateRequest
912
+ */
913
+ 'description': string | null;
914
+ /**
915
+ *
916
+ * @type {Array<string>}
917
+ * @memberof V1WebhooksCreateRequest
918
+ */
919
+ 'events': Array<V1WebhooksCreateRequestEventsEnum>;
920
+ /**
921
+ *
922
+ * @type {string}
923
+ * @memberof V1WebhooksCreateRequest
924
+ */
925
+ 'status': V1WebhooksCreateRequestStatusEnum;
926
+ /**
927
+ *
928
+ * @type {string}
929
+ * @memberof V1WebhooksCreateRequest
930
+ */
931
+ 'url': string;
932
+ }
933
+
934
+ export const V1WebhooksCreateRequestEventsEnum = {
935
+ MessageReceived: 'message.received'
936
+ } as const;
937
+
938
+ export type V1WebhooksCreateRequestEventsEnum = typeof V1WebhooksCreateRequestEventsEnum[keyof typeof V1WebhooksCreateRequestEventsEnum];
939
+ export const V1WebhooksCreateRequestStatusEnum = {
940
+ Active: 'active',
941
+ Paused: 'paused',
942
+ Disabled: 'disabled'
943
+ } as const;
944
+
945
+ export type V1WebhooksCreateRequestStatusEnum = typeof V1WebhooksCreateRequestStatusEnum[keyof typeof V1WebhooksCreateRequestStatusEnum];
946
+
947
+ /**
948
+ * Single webhook payload.
949
+ * @export
950
+ * @interface V1WebhooksResource
951
+ */
952
+ export interface V1WebhooksResource {
953
+ /**
954
+ *
955
+ * @type {V1WebhooksWebhook}
956
+ * @memberof V1WebhooksResource
957
+ */
958
+ 'data': V1WebhooksWebhook;
959
+ }
960
+ /**
961
+ * Single webhook payload including the one-time secret.
962
+ * @export
963
+ * @interface V1WebhooksResourceWithSecret
964
+ */
965
+ export interface V1WebhooksResourceWithSecret {
966
+ /**
967
+ *
968
+ * @type {V1WebhooksWebhookWithSecret}
969
+ * @memberof V1WebhooksResourceWithSecret
970
+ */
971
+ 'data': V1WebhooksWebhookWithSecret;
972
+ }
973
+ /**
974
+ * Result of a webhook test delivery.
975
+ * @export
976
+ * @interface V1WebhooksTestResult
977
+ */
978
+ export interface V1WebhooksTestResult {
979
+ /**
980
+ *
981
+ * @type {V1WebhooksTestResultData}
982
+ * @memberof V1WebhooksTestResult
983
+ */
984
+ 'data': V1WebhooksTestResultData;
985
+ }
986
+ /**
987
+ *
988
+ * @export
989
+ * @interface V1WebhooksTestResultData
990
+ */
991
+ export interface V1WebhooksTestResultData {
992
+ /**
993
+ *
994
+ * @type {number}
995
+ * @memberof V1WebhooksTestResultData
996
+ */
997
+ 'httpStatus': number;
998
+ /**
999
+ *
1000
+ * @type {boolean}
1001
+ * @memberof V1WebhooksTestResultData
1002
+ */
1003
+ 'success': boolean;
1004
+ /**
1005
+ *
1006
+ * @type {string}
1007
+ * @memberof V1WebhooksTestResultData
1008
+ */
1009
+ 'error': string | null;
1010
+ }
1011
+ /**
1012
+ * Body for partially updating a webhook. All fields optional; only present fields are applied.
1013
+ * @export
1014
+ * @interface V1WebhooksUpdateRequest
1015
+ */
1016
+ export interface V1WebhooksUpdateRequest {
1017
+ /**
1018
+ *
1019
+ * @type {string}
1020
+ * @memberof V1WebhooksUpdateRequest
1021
+ */
1022
+ 'name': string;
1023
+ /**
1024
+ *
1025
+ * @type {string}
1026
+ * @memberof V1WebhooksUpdateRequest
1027
+ */
1028
+ 'description': string | null;
1029
+ /**
1030
+ *
1031
+ * @type {Array<string>}
1032
+ * @memberof V1WebhooksUpdateRequest
1033
+ */
1034
+ 'events': Array<V1WebhooksUpdateRequestEventsEnum>;
1035
+ /**
1036
+ *
1037
+ * @type {string}
1038
+ * @memberof V1WebhooksUpdateRequest
1039
+ */
1040
+ 'status': V1WebhooksUpdateRequestStatusEnum;
1041
+ /**
1042
+ *
1043
+ * @type {string}
1044
+ * @memberof V1WebhooksUpdateRequest
1045
+ */
1046
+ 'url': string;
1047
+ }
1048
+
1049
+ export const V1WebhooksUpdateRequestEventsEnum = {
1050
+ MessageReceived: 'message.received'
1051
+ } as const;
1052
+
1053
+ export type V1WebhooksUpdateRequestEventsEnum = typeof V1WebhooksUpdateRequestEventsEnum[keyof typeof V1WebhooksUpdateRequestEventsEnum];
1054
+ export const V1WebhooksUpdateRequestStatusEnum = {
1055
+ Active: 'active',
1056
+ Paused: 'paused',
1057
+ Disabled: 'disabled'
1058
+ } as const;
1059
+
1060
+ export type V1WebhooksUpdateRequestStatusEnum = typeof V1WebhooksUpdateRequestStatusEnum[keyof typeof V1WebhooksUpdateRequestStatusEnum];
1061
+
1062
+ /**
1063
+ * Webhook configured for a managed mailbox.
1064
+ * @export
1065
+ * @interface V1WebhooksWebhook
1066
+ */
1067
+ export interface V1WebhooksWebhook {
1068
+ /**
1069
+ * Unique webhook identifier (UUID v7).
1070
+ * @type {string}
1071
+ * @memberof V1WebhooksWebhook
1072
+ */
1073
+ 'id': string;
1074
+ /**
1075
+ * Resource ID of the mailbox this webhook is attached to.
1076
+ * @type {string}
1077
+ * @memberof V1WebhooksWebhook
1078
+ */
1079
+ 'accountResourceId': string;
1080
+ /**
1081
+ * Email address of the mailbox.
1082
+ * @type {string}
1083
+ * @memberof V1WebhooksWebhook
1084
+ */
1085
+ 'mailbox': string;
1086
+ /**
1087
+ *
1088
+ * @type {string}
1089
+ * @memberof V1WebhooksWebhook
1090
+ */
1091
+ 'name': string;
1092
+ /**
1093
+ *
1094
+ * @type {string}
1095
+ * @memberof V1WebhooksWebhook
1096
+ */
1097
+ 'description': string | null;
1098
+ /**
1099
+ *
1100
+ * @type {Array<string>}
1101
+ * @memberof V1WebhooksWebhook
1102
+ */
1103
+ 'events': Array<V1WebhooksWebhookEventsEnum>;
1104
+ /**
1105
+ *
1106
+ * @type {string}
1107
+ * @memberof V1WebhooksWebhook
1108
+ */
1109
+ 'status': V1WebhooksWebhookStatusEnum;
1110
+ /**
1111
+ *
1112
+ * @type {string}
1113
+ * @memberof V1WebhooksWebhook
1114
+ */
1115
+ 'url': string;
1116
+ /**
1117
+ *
1118
+ * @type {string}
1119
+ * @memberof V1WebhooksWebhook
1120
+ */
1121
+ 'createdAt': string;
1122
+ /**
1123
+ *
1124
+ * @type {string}
1125
+ * @memberof V1WebhooksWebhook
1126
+ */
1127
+ 'updatedAt': string;
1128
+ }
1129
+
1130
+ export const V1WebhooksWebhookEventsEnum = {
1131
+ MessageReceived: 'message.received'
1132
+ } as const;
1133
+
1134
+ export type V1WebhooksWebhookEventsEnum = typeof V1WebhooksWebhookEventsEnum[keyof typeof V1WebhooksWebhookEventsEnum];
1135
+ export const V1WebhooksWebhookStatusEnum = {
1136
+ Active: 'active',
1137
+ Paused: 'paused',
1138
+ Disabled: 'disabled'
1139
+ } as const;
1140
+
1141
+ export type V1WebhooksWebhookStatusEnum = typeof V1WebhooksWebhookStatusEnum[keyof typeof V1WebhooksWebhookStatusEnum];
1142
+
1143
+ /**
1144
+ * Webhook payload that includes the one-time `secret`. Returned at creation and after secret regeneration. The secret is delivered as a bearer token on every webhook request (`Authorization: Bearer <secret>`); store it securely as it is not returned again.
1145
+ * @export
1146
+ * @interface V1WebhooksWebhookWithSecret
1147
+ */
1148
+ export interface V1WebhooksWebhookWithSecret {
1149
+ /**
1150
+ * Unique webhook identifier (UUID v7).
1151
+ * @type {string}
1152
+ * @memberof V1WebhooksWebhookWithSecret
1153
+ */
1154
+ 'id': string;
1155
+ /**
1156
+ * Resource ID of the mailbox this webhook is attached to.
1157
+ * @type {string}
1158
+ * @memberof V1WebhooksWebhookWithSecret
1159
+ */
1160
+ 'accountResourceId': string;
1161
+ /**
1162
+ * Email address of the mailbox.
1163
+ * @type {string}
1164
+ * @memberof V1WebhooksWebhookWithSecret
1165
+ */
1166
+ 'mailbox': string;
1167
+ /**
1168
+ *
1169
+ * @type {string}
1170
+ * @memberof V1WebhooksWebhookWithSecret
1171
+ */
1172
+ 'name': string;
1173
+ /**
1174
+ *
1175
+ * @type {string}
1176
+ * @memberof V1WebhooksWebhookWithSecret
1177
+ */
1178
+ 'description': string | null;
1179
+ /**
1180
+ *
1181
+ * @type {Array<string>}
1182
+ * @memberof V1WebhooksWebhookWithSecret
1183
+ */
1184
+ 'events': Array<V1WebhooksWebhookWithSecretEventsEnum>;
1185
+ /**
1186
+ *
1187
+ * @type {string}
1188
+ * @memberof V1WebhooksWebhookWithSecret
1189
+ */
1190
+ 'status': V1WebhooksWebhookWithSecretStatusEnum;
1191
+ /**
1192
+ *
1193
+ * @type {string}
1194
+ * @memberof V1WebhooksWebhookWithSecret
1195
+ */
1196
+ 'url': string;
1197
+ /**
1198
+ *
1199
+ * @type {string}
1200
+ * @memberof V1WebhooksWebhookWithSecret
1201
+ */
1202
+ 'createdAt': string;
1203
+ /**
1204
+ *
1205
+ * @type {string}
1206
+ * @memberof V1WebhooksWebhookWithSecret
1207
+ */
1208
+ 'updatedAt': string;
1209
+ /**
1210
+ *
1211
+ * @type {string}
1212
+ * @memberof V1WebhooksWebhookWithSecret
1213
+ */
1214
+ 'secret': string;
1215
+ }
1216
+
1217
+ export const V1WebhooksWebhookWithSecretEventsEnum = {
1218
+ MessageReceived: 'message.received'
1219
+ } as const;
1220
+
1221
+ export type V1WebhooksWebhookWithSecretEventsEnum = typeof V1WebhooksWebhookWithSecretEventsEnum[keyof typeof V1WebhooksWebhookWithSecretEventsEnum];
1222
+ export const V1WebhooksWebhookWithSecretStatusEnum = {
1223
+ Active: 'active',
1224
+ Paused: 'paused',
1225
+ Disabled: 'disabled'
1226
+ } as const;
1227
+
1228
+ export type V1WebhooksWebhookWithSecretStatusEnum = typeof V1WebhooksWebhookWithSecretStatusEnum[keyof typeof V1WebhooksWebhookWithSecretStatusEnum];
1229
+
1230
+
1231
+ /**
1232
+ * AccountApi - axios parameter creator
1233
+ * @export
1234
+ */
1235
+ export const AccountApiAxiosParamCreator = function (configuration?: Configuration) {
1236
+ return {
1237
+ /**
1238
+ * Returns the authenticated account and the mailboxes it can manage.
1239
+ * @summary Get the authenticated account
1240
+ * @param {*} [options] Override http request option.
1241
+ * @throws {RequiredError}
1242
+ */
1243
+ getCurrentAccount: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1244
+ const localVarPath = `/api/v1/me`;
1245
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1246
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1247
+ let baseOptions;
1248
+ if (configuration) {
1249
+ baseOptions = configuration.baseOptions;
1250
+ }
1251
+
1252
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1253
+ const localVarHeaderParameter = {} as any;
1254
+ const localVarQueryParameter = {} as any;
1255
+
1256
+ // authentication BearerAuth required
1257
+ // http bearer authentication required
1258
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1259
+
1260
+
1261
+
1262
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1263
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1264
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1265
+
1266
+ return {
1267
+ url: toPathString(localVarUrlObj),
1268
+ options: localVarRequestOptions,
1269
+ };
1270
+ },
1271
+ }
1272
+ };
1273
+
1274
+ /**
1275
+ * AccountApi - functional programming interface
1276
+ * @export
1277
+ */
1278
+ export const AccountApiFp = function(configuration?: Configuration) {
1279
+ const localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration)
1280
+ return {
1281
+ /**
1282
+ * Returns the authenticated account and the mailboxes it can manage.
1283
+ * @summary Get the authenticated account
1284
+ * @param {*} [options] Override http request option.
1285
+ * @throws {RequiredError}
1286
+ */
1287
+ async getCurrentAccount(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1MeResource>> {
1288
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCurrentAccount(options);
1289
+ const localVarOperationServerBasePath = operationServerMap['AccountApi.getCurrentAccount']?.[0]?.url;
1290
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1291
+ },
1292
+ }
1293
+ };
1294
+
1295
+ /**
1296
+ * AccountApi - factory interface
1297
+ * @export
1298
+ */
1299
+ export const AccountApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1300
+ const localVarFp = AccountApiFp(configuration)
1301
+ return {
1302
+ /**
1303
+ * Returns the authenticated account and the mailboxes it can manage.
1304
+ * @summary Get the authenticated account
1305
+ * @param {*} [options] Override http request option.
1306
+ * @throws {RequiredError}
1307
+ */
1308
+ getCurrentAccount(options?: RawAxiosRequestConfig): AxiosPromise<V1MeResource> {
1309
+ return localVarFp.getCurrentAccount(options).then((request) => request(axios, basePath));
1310
+ },
1311
+ };
1312
+ };
1313
+
1314
+ /**
1315
+ * AccountApi - object-oriented interface
1316
+ * @export
1317
+ * @class AccountApi
1318
+ * @extends {BaseAPI}
1319
+ */
1320
+ export class AccountApi extends BaseAPI {
1321
+ /**
1322
+ * Returns the authenticated account and the mailboxes it can manage.
1323
+ * @summary Get the authenticated account
1324
+ * @param {*} [options] Override http request option.
1325
+ * @throws {RequiredError}
1326
+ * @memberof AccountApi
1327
+ */
1328
+ public getCurrentAccount(options?: RawAxiosRequestConfig) {
1329
+ return AccountApiFp(this.configuration).getCurrentAccount(options).then((request) => request(this.axios, this.basePath));
1330
+ }
1331
+ }
1332
+
1333
+
1334
+
1335
+ /**
1336
+ * FoldersApi - axios parameter creator
1337
+ * @export
1338
+ */
1339
+ export const FoldersApiAxiosParamCreator = function (configuration?: Configuration) {
1340
+ return {
1341
+ /**
1342
+ * Create a new folder in the managed mailbox.
1343
+ * @summary Create folder
1344
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1345
+ * @param {V1FoldersCreateRequest} v1FoldersCreateRequest
1346
+ * @param {*} [options] Override http request option.
1347
+ * @throws {RequiredError}
1348
+ */
1349
+ createFolder: async (mailboxResourceId: string, v1FoldersCreateRequest: V1FoldersCreateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1350
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1351
+ assertParamExists('createFolder', 'mailboxResourceId', mailboxResourceId)
1352
+ // verify required parameter 'v1FoldersCreateRequest' is not null or undefined
1353
+ assertParamExists('createFolder', 'v1FoldersCreateRequest', v1FoldersCreateRequest)
1354
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders`
1355
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
1356
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1357
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1358
+ let baseOptions;
1359
+ if (configuration) {
1360
+ baseOptions = configuration.baseOptions;
1361
+ }
1362
+
1363
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1364
+ const localVarHeaderParameter = {} as any;
1365
+ const localVarQueryParameter = {} as any;
1366
+
1367
+ // authentication BearerAuth required
1368
+ // http bearer authentication required
1369
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1370
+
1371
+
1372
+
1373
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1374
+
1375
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1376
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1377
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1378
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FoldersCreateRequest, localVarRequestOptions, configuration)
1379
+
1380
+ return {
1381
+ url: toPathString(localVarUrlObj),
1382
+ options: localVarRequestOptions,
1383
+ };
1384
+ },
1385
+ /**
1386
+ * Delete a folder and all of its subfolders.
1387
+ * @summary Delete folder
1388
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1389
+ * @param {string} folder Folder path to delete (URL-encoded).
1390
+ * @param {*} [options] Override http request option.
1391
+ * @throws {RequiredError}
1392
+ */
1393
+ deleteFolder: async (mailboxResourceId: string, folder: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1394
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1395
+ assertParamExists('deleteFolder', 'mailboxResourceId', mailboxResourceId)
1396
+ // verify required parameter 'folder' is not null or undefined
1397
+ assertParamExists('deleteFolder', 'folder', folder)
1398
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}`
1399
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1400
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
1401
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1402
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1403
+ let baseOptions;
1404
+ if (configuration) {
1405
+ baseOptions = configuration.baseOptions;
1406
+ }
1407
+
1408
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
1409
+ const localVarHeaderParameter = {} as any;
1410
+ const localVarQueryParameter = {} as any;
1411
+
1412
+ // authentication BearerAuth required
1413
+ // http bearer authentication required
1414
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1415
+
1416
+
1417
+
1418
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1419
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1420
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1421
+
1422
+ return {
1423
+ url: toPathString(localVarUrlObj),
1424
+ options: localVarRequestOptions,
1425
+ };
1426
+ },
1427
+ /**
1428
+ * Retrieve a paginated list of folders in the managed mailbox.
1429
+ * @summary List folders
1430
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1431
+ * @param {number} [page] Page number (1-based).
1432
+ * @param {number} [perPage] Items per page (max 100).
1433
+ * @param {*} [options] Override http request option.
1434
+ * @throws {RequiredError}
1435
+ */
1436
+ listFolders: async (mailboxResourceId: string, page?: number, perPage?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1437
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1438
+ assertParamExists('listFolders', 'mailboxResourceId', mailboxResourceId)
1439
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders`
1440
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
1441
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1442
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1443
+ let baseOptions;
1444
+ if (configuration) {
1445
+ baseOptions = configuration.baseOptions;
1446
+ }
1447
+
1448
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1449
+ const localVarHeaderParameter = {} as any;
1450
+ const localVarQueryParameter = {} as any;
1451
+
1452
+ // authentication BearerAuth required
1453
+ // http bearer authentication required
1454
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1455
+
1456
+ if (page !== undefined) {
1457
+ localVarQueryParameter['page'] = page;
1458
+ }
1459
+
1460
+ if (perPage !== undefined) {
1461
+ localVarQueryParameter['perPage'] = perPage;
1462
+ }
1463
+
1464
+
1465
+
1466
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1467
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1468
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1469
+
1470
+ return {
1471
+ url: toPathString(localVarUrlObj),
1472
+ options: localVarRequestOptions,
1473
+ };
1474
+ },
1475
+ /**
1476
+ * Rename an existing folder.
1477
+ * @summary Update folder
1478
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1479
+ * @param {string} folder Current folder path (URL-encoded).
1480
+ * @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
1481
+ * @param {*} [options] Override http request option.
1482
+ * @throws {RequiredError}
1483
+ */
1484
+ updateFolder: async (mailboxResourceId: string, folder: string, v1FoldersUpdateRequest: V1FoldersUpdateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1485
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1486
+ assertParamExists('updateFolder', 'mailboxResourceId', mailboxResourceId)
1487
+ // verify required parameter 'folder' is not null or undefined
1488
+ assertParamExists('updateFolder', 'folder', folder)
1489
+ // verify required parameter 'v1FoldersUpdateRequest' is not null or undefined
1490
+ assertParamExists('updateFolder', 'v1FoldersUpdateRequest', v1FoldersUpdateRequest)
1491
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}`
1492
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1493
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
1494
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1495
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1496
+ let baseOptions;
1497
+ if (configuration) {
1498
+ baseOptions = configuration.baseOptions;
1499
+ }
1500
+
1501
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
1502
+ const localVarHeaderParameter = {} as any;
1503
+ const localVarQueryParameter = {} as any;
1504
+
1505
+ // authentication BearerAuth required
1506
+ // http bearer authentication required
1507
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1508
+
1509
+
1510
+
1511
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1512
+
1513
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1514
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1515
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1516
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FoldersUpdateRequest, localVarRequestOptions, configuration)
1517
+
1518
+ return {
1519
+ url: toPathString(localVarUrlObj),
1520
+ options: localVarRequestOptions,
1521
+ };
1522
+ },
1523
+ }
1524
+ };
1525
+
1526
+ /**
1527
+ * FoldersApi - functional programming interface
1528
+ * @export
1529
+ */
1530
+ export const FoldersApiFp = function(configuration?: Configuration) {
1531
+ const localVarAxiosParamCreator = FoldersApiAxiosParamCreator(configuration)
1532
+ return {
1533
+ /**
1534
+ * Create a new folder in the managed mailbox.
1535
+ * @summary Create folder
1536
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1537
+ * @param {V1FoldersCreateRequest} v1FoldersCreateRequest
1538
+ * @param {*} [options] Override http request option.
1539
+ * @throws {RequiredError}
1540
+ */
1541
+ async createFolder(mailboxResourceId: string, v1FoldersCreateRequest: V1FoldersCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FoldersResource>> {
1542
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createFolder(mailboxResourceId, v1FoldersCreateRequest, options);
1543
+ const localVarOperationServerBasePath = operationServerMap['FoldersApi.createFolder']?.[0]?.url;
1544
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1545
+ },
1546
+ /**
1547
+ * Delete a folder and all of its subfolders.
1548
+ * @summary Delete folder
1549
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1550
+ * @param {string} folder Folder path to delete (URL-encoded).
1551
+ * @param {*} [options] Override http request option.
1552
+ * @throws {RequiredError}
1553
+ */
1554
+ async deleteFolder(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
1555
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFolder(mailboxResourceId, folder, options);
1556
+ const localVarOperationServerBasePath = operationServerMap['FoldersApi.deleteFolder']?.[0]?.url;
1557
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1558
+ },
1559
+ /**
1560
+ * Retrieve a paginated list of folders in the managed mailbox.
1561
+ * @summary List folders
1562
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1563
+ * @param {number} [page] Page number (1-based).
1564
+ * @param {number} [perPage] Items per page (max 100).
1565
+ * @param {*} [options] Override http request option.
1566
+ * @throws {RequiredError}
1567
+ */
1568
+ async listFolders(mailboxResourceId: string, page?: number, perPage?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FoldersCollection>> {
1569
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFolders(mailboxResourceId, page, perPage, options);
1570
+ const localVarOperationServerBasePath = operationServerMap['FoldersApi.listFolders']?.[0]?.url;
1571
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1572
+ },
1573
+ /**
1574
+ * Rename an existing folder.
1575
+ * @summary Update folder
1576
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1577
+ * @param {string} folder Current folder path (URL-encoded).
1578
+ * @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
1579
+ * @param {*} [options] Override http request option.
1580
+ * @throws {RequiredError}
1581
+ */
1582
+ async updateFolder(mailboxResourceId: string, folder: string, v1FoldersUpdateRequest: V1FoldersUpdateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FoldersResource>> {
1583
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options);
1584
+ const localVarOperationServerBasePath = operationServerMap['FoldersApi.updateFolder']?.[0]?.url;
1585
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1586
+ },
1587
+ }
1588
+ };
1589
+
1590
+ /**
1591
+ * FoldersApi - factory interface
1592
+ * @export
1593
+ */
1594
+ export const FoldersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1595
+ const localVarFp = FoldersApiFp(configuration)
1596
+ return {
1597
+ /**
1598
+ * Create a new folder in the managed mailbox.
1599
+ * @summary Create folder
1600
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1601
+ * @param {V1FoldersCreateRequest} v1FoldersCreateRequest
1602
+ * @param {*} [options] Override http request option.
1603
+ * @throws {RequiredError}
1604
+ */
1605
+ createFolder(mailboxResourceId: string, v1FoldersCreateRequest: V1FoldersCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1FoldersResource> {
1606
+ return localVarFp.createFolder(mailboxResourceId, v1FoldersCreateRequest, options).then((request) => request(axios, basePath));
1607
+ },
1608
+ /**
1609
+ * Delete a folder and all of its subfolders.
1610
+ * @summary Delete folder
1611
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1612
+ * @param {string} folder Folder path to delete (URL-encoded).
1613
+ * @param {*} [options] Override http request option.
1614
+ * @throws {RequiredError}
1615
+ */
1616
+ deleteFolder(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
1617
+ return localVarFp.deleteFolder(mailboxResourceId, folder, options).then((request) => request(axios, basePath));
1618
+ },
1619
+ /**
1620
+ * Retrieve a paginated list of folders in the managed mailbox.
1621
+ * @summary List folders
1622
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1623
+ * @param {number} [page] Page number (1-based).
1624
+ * @param {number} [perPage] Items per page (max 100).
1625
+ * @param {*} [options] Override http request option.
1626
+ * @throws {RequiredError}
1627
+ */
1628
+ listFolders(mailboxResourceId: string, page?: number, perPage?: number, options?: RawAxiosRequestConfig): AxiosPromise<V1FoldersCollection> {
1629
+ return localVarFp.listFolders(mailboxResourceId, page, perPage, options).then((request) => request(axios, basePath));
1630
+ },
1631
+ /**
1632
+ * Rename an existing folder.
1633
+ * @summary Update folder
1634
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1635
+ * @param {string} folder Current folder path (URL-encoded).
1636
+ * @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
1637
+ * @param {*} [options] Override http request option.
1638
+ * @throws {RequiredError}
1639
+ */
1640
+ updateFolder(mailboxResourceId: string, folder: string, v1FoldersUpdateRequest: V1FoldersUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1FoldersResource> {
1641
+ return localVarFp.updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options).then((request) => request(axios, basePath));
1642
+ },
1643
+ };
1644
+ };
1645
+
1646
+ /**
1647
+ * FoldersApi - object-oriented interface
1648
+ * @export
1649
+ * @class FoldersApi
1650
+ * @extends {BaseAPI}
1651
+ */
1652
+ export class FoldersApi extends BaseAPI {
1653
+ /**
1654
+ * Create a new folder in the managed mailbox.
1655
+ * @summary Create folder
1656
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1657
+ * @param {V1FoldersCreateRequest} v1FoldersCreateRequest
1658
+ * @param {*} [options] Override http request option.
1659
+ * @throws {RequiredError}
1660
+ * @memberof FoldersApi
1661
+ */
1662
+ public createFolder(mailboxResourceId: string, v1FoldersCreateRequest: V1FoldersCreateRequest, options?: RawAxiosRequestConfig) {
1663
+ return FoldersApiFp(this.configuration).createFolder(mailboxResourceId, v1FoldersCreateRequest, options).then((request) => request(this.axios, this.basePath));
1664
+ }
1665
+
1666
+ /**
1667
+ * Delete a folder and all of its subfolders.
1668
+ * @summary Delete folder
1669
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1670
+ * @param {string} folder Folder path to delete (URL-encoded).
1671
+ * @param {*} [options] Override http request option.
1672
+ * @throws {RequiredError}
1673
+ * @memberof FoldersApi
1674
+ */
1675
+ public deleteFolder(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig) {
1676
+ return FoldersApiFp(this.configuration).deleteFolder(mailboxResourceId, folder, options).then((request) => request(this.axios, this.basePath));
1677
+ }
1678
+
1679
+ /**
1680
+ * Retrieve a paginated list of folders in the managed mailbox.
1681
+ * @summary List folders
1682
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1683
+ * @param {number} [page] Page number (1-based).
1684
+ * @param {number} [perPage] Items per page (max 100).
1685
+ * @param {*} [options] Override http request option.
1686
+ * @throws {RequiredError}
1687
+ * @memberof FoldersApi
1688
+ */
1689
+ public listFolders(mailboxResourceId: string, page?: number, perPage?: number, options?: RawAxiosRequestConfig) {
1690
+ return FoldersApiFp(this.configuration).listFolders(mailboxResourceId, page, perPage, options).then((request) => request(this.axios, this.basePath));
1691
+ }
1692
+
1693
+ /**
1694
+ * Rename an existing folder.
1695
+ * @summary Update folder
1696
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1697
+ * @param {string} folder Current folder path (URL-encoded).
1698
+ * @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
1699
+ * @param {*} [options] Override http request option.
1700
+ * @throws {RequiredError}
1701
+ * @memberof FoldersApi
1702
+ */
1703
+ public updateFolder(mailboxResourceId: string, folder: string, v1FoldersUpdateRequest: V1FoldersUpdateRequest, options?: RawAxiosRequestConfig) {
1704
+ return FoldersApiFp(this.configuration).updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options).then((request) => request(this.axios, this.basePath));
1705
+ }
1706
+ }
1707
+
1708
+
1709
+
1710
+ /**
1711
+ * MessagesApi - axios parameter creator
1712
+ * @export
1713
+ */
1714
+ export const MessagesApiAxiosParamCreator = function (configuration?: Configuration) {
1715
+ return {
1716
+ /**
1717
+ * Permanently delete every message in a folder (empty the folder).
1718
+ * @summary Delete all messages
1719
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1720
+ * @param {string} folder Folder path (URL-encoded).
1721
+ * @param {*} [options] Override http request option.
1722
+ * @throws {RequiredError}
1723
+ */
1724
+ deleteAllMessages: async (mailboxResourceId: string, folder: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1725
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1726
+ assertParamExists('deleteAllMessages', 'mailboxResourceId', mailboxResourceId)
1727
+ // verify required parameter 'folder' is not null or undefined
1728
+ assertParamExists('deleteAllMessages', 'folder', folder)
1729
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages`
1730
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1731
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
1732
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1733
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1734
+ let baseOptions;
1735
+ if (configuration) {
1736
+ baseOptions = configuration.baseOptions;
1737
+ }
1738
+
1739
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
1740
+ const localVarHeaderParameter = {} as any;
1741
+ const localVarQueryParameter = {} as any;
1742
+
1743
+ // authentication BearerAuth required
1744
+ // http bearer authentication required
1745
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1746
+
1747
+
1748
+
1749
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1750
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1751
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1752
+
1753
+ return {
1754
+ url: toPathString(localVarUrlObj),
1755
+ options: localVarRequestOptions,
1756
+ };
1757
+ },
1758
+ /**
1759
+ * Permanently delete a single message.
1760
+ * @summary Delete message
1761
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1762
+ * @param {string} folder Folder path (URL-encoded).
1763
+ * @param {number} uid Message UID.
1764
+ * @param {*} [options] Override http request option.
1765
+ * @throws {RequiredError}
1766
+ */
1767
+ deleteMessage: async (mailboxResourceId: string, folder: string, uid: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1768
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1769
+ assertParamExists('deleteMessage', 'mailboxResourceId', mailboxResourceId)
1770
+ // verify required parameter 'folder' is not null or undefined
1771
+ assertParamExists('deleteMessage', 'folder', folder)
1772
+ // verify required parameter 'uid' is not null or undefined
1773
+ assertParamExists('deleteMessage', 'uid', uid)
1774
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
1775
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1776
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
1777
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
1778
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1779
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1780
+ let baseOptions;
1781
+ if (configuration) {
1782
+ baseOptions = configuration.baseOptions;
1783
+ }
1784
+
1785
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
1786
+ const localVarHeaderParameter = {} as any;
1787
+ const localVarQueryParameter = {} as any;
1788
+
1789
+ // authentication BearerAuth required
1790
+ // http bearer authentication required
1791
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1792
+
1793
+
1794
+
1795
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1796
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1797
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1798
+
1799
+ return {
1800
+ url: toPathString(localVarUrlObj),
1801
+ options: localVarRequestOptions,
1802
+ };
1803
+ },
1804
+ /**
1805
+ * Permanently delete multiple messages from a folder.
1806
+ * @summary Delete messages
1807
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1808
+ * @param {string} folder Folder path (URL-encoded).
1809
+ * @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
1810
+ * @param {*} [options] Override http request option.
1811
+ * @throws {RequiredError}
1812
+ */
1813
+ deleteMessages: async (mailboxResourceId: string, folder: string, v1FolderMessagesDeleteBulkRequest: V1FolderMessagesDeleteBulkRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1814
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1815
+ assertParamExists('deleteMessages', 'mailboxResourceId', mailboxResourceId)
1816
+ // verify required parameter 'folder' is not null or undefined
1817
+ assertParamExists('deleteMessages', 'folder', folder)
1818
+ // verify required parameter 'v1FolderMessagesDeleteBulkRequest' is not null or undefined
1819
+ assertParamExists('deleteMessages', 'v1FolderMessagesDeleteBulkRequest', v1FolderMessagesDeleteBulkRequest)
1820
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete`
1821
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1822
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
1823
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1824
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1825
+ let baseOptions;
1826
+ if (configuration) {
1827
+ baseOptions = configuration.baseOptions;
1828
+ }
1829
+
1830
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1831
+ const localVarHeaderParameter = {} as any;
1832
+ const localVarQueryParameter = {} as any;
1833
+
1834
+ // authentication BearerAuth required
1835
+ // http bearer authentication required
1836
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1837
+
1838
+
1839
+
1840
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1841
+
1842
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1843
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1844
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1845
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesDeleteBulkRequest, localVarRequestOptions, configuration)
1846
+
1847
+ return {
1848
+ url: toPathString(localVarUrlObj),
1849
+ options: localVarRequestOptions,
1850
+ };
1851
+ },
1852
+ /**
1853
+ * Retrieve a single message by UID.
1854
+ * @summary Get message
1855
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1856
+ * @param {string} folder Folder path (URL-encoded).
1857
+ * @param {number} uid Message UID.
1858
+ * @param {*} [options] Override http request option.
1859
+ * @throws {RequiredError}
1860
+ */
1861
+ getMessage: async (mailboxResourceId: string, folder: string, uid: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1862
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1863
+ assertParamExists('getMessage', 'mailboxResourceId', mailboxResourceId)
1864
+ // verify required parameter 'folder' is not null or undefined
1865
+ assertParamExists('getMessage', 'folder', folder)
1866
+ // verify required parameter 'uid' is not null or undefined
1867
+ assertParamExists('getMessage', 'uid', uid)
1868
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
1869
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1870
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
1871
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
1872
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1873
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1874
+ let baseOptions;
1875
+ if (configuration) {
1876
+ baseOptions = configuration.baseOptions;
1877
+ }
1878
+
1879
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1880
+ const localVarHeaderParameter = {} as any;
1881
+ const localVarQueryParameter = {} as any;
1882
+
1883
+ // authentication BearerAuth required
1884
+ // http bearer authentication required
1885
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1886
+
1887
+
1888
+
1889
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1890
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1891
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1892
+
1893
+ return {
1894
+ url: toPathString(localVarUrlObj),
1895
+ options: localVarRequestOptions,
1896
+ };
1897
+ },
1898
+ /**
1899
+ * Download a message attachment as `application/octet-stream`.
1900
+ * @summary Download message attachment
1901
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1902
+ * @param {string} folder Folder path (URL-encoded).
1903
+ * @param {number} uid Message UID.
1904
+ * @param {string} attachmentId Attachment ID (opaque, returned by GET message).
1905
+ * @param {*} [options] Override http request option.
1906
+ * @throws {RequiredError}
1907
+ */
1908
+ getMessageAttachment: async (mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1909
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1910
+ assertParamExists('getMessageAttachment', 'mailboxResourceId', mailboxResourceId)
1911
+ // verify required parameter 'folder' is not null or undefined
1912
+ assertParamExists('getMessageAttachment', 'folder', folder)
1913
+ // verify required parameter 'uid' is not null or undefined
1914
+ assertParamExists('getMessageAttachment', 'uid', uid)
1915
+ // verify required parameter 'attachmentId' is not null or undefined
1916
+ assertParamExists('getMessageAttachment', 'attachmentId', attachmentId)
1917
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId}`
1918
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1919
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
1920
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)))
1921
+ .replace(`{${"attachmentId"}}`, encodeURIComponent(String(attachmentId)));
1922
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1923
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1924
+ let baseOptions;
1925
+ if (configuration) {
1926
+ baseOptions = configuration.baseOptions;
1927
+ }
1928
+
1929
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1930
+ const localVarHeaderParameter = {} as any;
1931
+ const localVarQueryParameter = {} as any;
1932
+
1933
+ // authentication BearerAuth required
1934
+ // http bearer authentication required
1935
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1936
+
1937
+
1938
+
1939
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1940
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1941
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1942
+
1943
+ return {
1944
+ url: toPathString(localVarUrlObj),
1945
+ options: localVarRequestOptions,
1946
+ };
1947
+ },
1948
+ /**
1949
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
1950
+ * @summary Get message source
1951
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1952
+ * @param {string} folder Folder path (URL-encoded).
1953
+ * @param {number} uid Message UID.
1954
+ * @param {*} [options] Override http request option.
1955
+ * @throws {RequiredError}
1956
+ */
1957
+ getMessageSource: async (mailboxResourceId: string, folder: string, uid: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1958
+ // verify required parameter 'mailboxResourceId' is not null or undefined
1959
+ assertParamExists('getMessageSource', 'mailboxResourceId', mailboxResourceId)
1960
+ // verify required parameter 'folder' is not null or undefined
1961
+ assertParamExists('getMessageSource', 'folder', folder)
1962
+ // verify required parameter 'uid' is not null or undefined
1963
+ assertParamExists('getMessageSource', 'uid', uid)
1964
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source`
1965
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
1966
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
1967
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
1968
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1969
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1970
+ let baseOptions;
1971
+ if (configuration) {
1972
+ baseOptions = configuration.baseOptions;
1973
+ }
1974
+
1975
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1976
+ const localVarHeaderParameter = {} as any;
1977
+ const localVarQueryParameter = {} as any;
1978
+
1979
+ // authentication BearerAuth required
1980
+ // http bearer authentication required
1981
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
1982
+
1983
+
1984
+
1985
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1986
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1987
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1988
+
1989
+ return {
1990
+ url: toPathString(localVarUrlObj),
1991
+ options: localVarRequestOptions,
1992
+ };
1993
+ },
1994
+ /**
1995
+ * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
1996
+ * @summary Get message text content
1997
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1998
+ * @param {string} folder Folder path (URL-encoded).
1999
+ * @param {number} uid Message UID.
2000
+ * @param {*} [options] Override http request option.
2001
+ * @throws {RequiredError}
2002
+ */
2003
+ getMessageText: async (mailboxResourceId: string, folder: string, uid: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2004
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2005
+ assertParamExists('getMessageText', 'mailboxResourceId', mailboxResourceId)
2006
+ // verify required parameter 'folder' is not null or undefined
2007
+ assertParamExists('getMessageText', 'folder', folder)
2008
+ // verify required parameter 'uid' is not null or undefined
2009
+ assertParamExists('getMessageText', 'uid', uid)
2010
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text`
2011
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2012
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
2013
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
2014
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2015
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2016
+ let baseOptions;
2017
+ if (configuration) {
2018
+ baseOptions = configuration.baseOptions;
2019
+ }
2020
+
2021
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2022
+ const localVarHeaderParameter = {} as any;
2023
+ const localVarQueryParameter = {} as any;
2024
+
2025
+ // authentication BearerAuth required
2026
+ // http bearer authentication required
2027
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2028
+
2029
+
2030
+
2031
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2032
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2033
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2034
+
2035
+ return {
2036
+ url: toPathString(localVarUrlObj),
2037
+ options: localVarRequestOptions,
2038
+ };
2039
+ },
2040
+ /**
2041
+ * List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
2042
+ * @summary List messages
2043
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2044
+ * @param {string} folder Folder path (URL-encoded).
2045
+ * @param {number} [page] Page number (1-based).
2046
+ * @param {number} [perPage] Items per page (max 100).
2047
+ * @param {string} [sort] Sort field with optional &#x60;-&#x60; prefix for descending. Allowed: uid, date, size.
2048
+ * @param {*} [options] Override http request option.
2049
+ * @throws {RequiredError}
2050
+ */
2051
+ listMessages: async (mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2052
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2053
+ assertParamExists('listMessages', 'mailboxResourceId', mailboxResourceId)
2054
+ // verify required parameter 'folder' is not null or undefined
2055
+ assertParamExists('listMessages', 'folder', folder)
2056
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages`
2057
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2058
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
2059
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2060
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2061
+ let baseOptions;
2062
+ if (configuration) {
2063
+ baseOptions = configuration.baseOptions;
2064
+ }
2065
+
2066
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2067
+ const localVarHeaderParameter = {} as any;
2068
+ const localVarQueryParameter = {} as any;
2069
+
2070
+ // authentication BearerAuth required
2071
+ // http bearer authentication required
2072
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2073
+
2074
+ if (page !== undefined) {
2075
+ localVarQueryParameter['page'] = page;
2076
+ }
2077
+
2078
+ if (perPage !== undefined) {
2079
+ localVarQueryParameter['perPage'] = perPage;
2080
+ }
2081
+
2082
+ if (sort !== undefined) {
2083
+ localVarQueryParameter['sort'] = sort;
2084
+ }
2085
+
2086
+
2087
+
2088
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2089
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2090
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2091
+
2092
+ return {
2093
+ url: toPathString(localVarUrlObj),
2094
+ options: localVarRequestOptions,
2095
+ };
2096
+ },
2097
+ /**
2098
+ * Move a single message to a target folder.
2099
+ * @summary Move message
2100
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2101
+ * @param {string} folder Source folder path (URL-encoded).
2102
+ * @param {number} uid Message UID.
2103
+ * @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
2104
+ * @param {*} [options] Override http request option.
2105
+ * @throws {RequiredError}
2106
+ */
2107
+ moveMessage: async (mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesMoveRequest: V1FolderMessagesMoveRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2108
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2109
+ assertParamExists('moveMessage', 'mailboxResourceId', mailboxResourceId)
2110
+ // verify required parameter 'folder' is not null or undefined
2111
+ assertParamExists('moveMessage', 'folder', folder)
2112
+ // verify required parameter 'uid' is not null or undefined
2113
+ assertParamExists('moveMessage', 'uid', uid)
2114
+ // verify required parameter 'v1FolderMessagesMoveRequest' is not null or undefined
2115
+ assertParamExists('moveMessage', 'v1FolderMessagesMoveRequest', v1FolderMessagesMoveRequest)
2116
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move`
2117
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2118
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
2119
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
2120
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2121
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2122
+ let baseOptions;
2123
+ if (configuration) {
2124
+ baseOptions = configuration.baseOptions;
2125
+ }
2126
+
2127
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2128
+ const localVarHeaderParameter = {} as any;
2129
+ const localVarQueryParameter = {} as any;
2130
+
2131
+ // authentication BearerAuth required
2132
+ // http bearer authentication required
2133
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2134
+
2135
+
2136
+
2137
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2138
+
2139
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2140
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2141
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2142
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesMoveRequest, localVarRequestOptions, configuration)
2143
+
2144
+ return {
2145
+ url: toPathString(localVarUrlObj),
2146
+ options: localVarRequestOptions,
2147
+ };
2148
+ },
2149
+ /**
2150
+ * Move multiple messages from a source folder to a target folder.
2151
+ * @summary Move messages
2152
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2153
+ * @param {string} folder Source folder path (URL-encoded).
2154
+ * @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
2155
+ * @param {*} [options] Override http request option.
2156
+ * @throws {RequiredError}
2157
+ */
2158
+ moveMessages: async (mailboxResourceId: string, folder: string, v1FolderMessagesMoveBulkRequest: V1FolderMessagesMoveBulkRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2159
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2160
+ assertParamExists('moveMessages', 'mailboxResourceId', mailboxResourceId)
2161
+ // verify required parameter 'folder' is not null or undefined
2162
+ assertParamExists('moveMessages', 'folder', folder)
2163
+ // verify required parameter 'v1FolderMessagesMoveBulkRequest' is not null or undefined
2164
+ assertParamExists('moveMessages', 'v1FolderMessagesMoveBulkRequest', v1FolderMessagesMoveBulkRequest)
2165
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move`
2166
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2167
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
2168
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2169
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2170
+ let baseOptions;
2171
+ if (configuration) {
2172
+ baseOptions = configuration.baseOptions;
2173
+ }
2174
+
2175
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2176
+ const localVarHeaderParameter = {} as any;
2177
+ const localVarQueryParameter = {} as any;
2178
+
2179
+ // authentication BearerAuth required
2180
+ // http bearer authentication required
2181
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2182
+
2183
+
2184
+
2185
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2186
+
2187
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2188
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2189
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2190
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesMoveBulkRequest, localVarRequestOptions, configuration)
2191
+
2192
+ return {
2193
+ url: toPathString(localVarUrlObj),
2194
+ options: localVarRequestOptions,
2195
+ };
2196
+ },
2197
+ /**
2198
+ * Add and/or remove flags on a single message. Returns the updated message.
2199
+ * @summary Update message flags
2200
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2201
+ * @param {string} folder Folder path (URL-encoded).
2202
+ * @param {number} uid Message UID.
2203
+ * @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
2204
+ * @param {*} [options] Override http request option.
2205
+ * @throws {RequiredError}
2206
+ */
2207
+ patchMessage: async (mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesFlagsRequest: V1FolderMessagesFlagsRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2208
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2209
+ assertParamExists('patchMessage', 'mailboxResourceId', mailboxResourceId)
2210
+ // verify required parameter 'folder' is not null or undefined
2211
+ assertParamExists('patchMessage', 'folder', folder)
2212
+ // verify required parameter 'uid' is not null or undefined
2213
+ assertParamExists('patchMessage', 'uid', uid)
2214
+ // verify required parameter 'v1FolderMessagesFlagsRequest' is not null or undefined
2215
+ assertParamExists('patchMessage', 'v1FolderMessagesFlagsRequest', v1FolderMessagesFlagsRequest)
2216
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
2217
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2218
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
2219
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
2220
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2221
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2222
+ let baseOptions;
2223
+ if (configuration) {
2224
+ baseOptions = configuration.baseOptions;
2225
+ }
2226
+
2227
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
2228
+ const localVarHeaderParameter = {} as any;
2229
+ const localVarQueryParameter = {} as any;
2230
+
2231
+ // authentication BearerAuth required
2232
+ // http bearer authentication required
2233
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2234
+
2235
+
2236
+
2237
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2238
+
2239
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2240
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2241
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2242
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesFlagsRequest, localVarRequestOptions, configuration)
2243
+
2244
+ return {
2245
+ url: toPathString(localVarUrlObj),
2246
+ options: localVarRequestOptions,
2247
+ };
2248
+ },
2249
+ /**
2250
+ * Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
2251
+ * @summary Search messages
2252
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2253
+ * @param {string} folder Folder path (URL-encoded).
2254
+ * @param {number} [page]
2255
+ * @param {number} [perPage]
2256
+ * @param {string} [sort]
2257
+ * @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
2258
+ * @param {*} [options] Override http request option.
2259
+ * @throws {RequiredError}
2260
+ */
2261
+ searchMessages: async (mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, v1FolderMessagesSearchRequest?: V1FolderMessagesSearchRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2262
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2263
+ assertParamExists('searchMessages', 'mailboxResourceId', mailboxResourceId)
2264
+ // verify required parameter 'folder' is not null or undefined
2265
+ assertParamExists('searchMessages', 'folder', folder)
2266
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search`
2267
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2268
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
2269
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2270
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2271
+ let baseOptions;
2272
+ if (configuration) {
2273
+ baseOptions = configuration.baseOptions;
2274
+ }
2275
+
2276
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2277
+ const localVarHeaderParameter = {} as any;
2278
+ const localVarQueryParameter = {} as any;
2279
+
2280
+ // authentication BearerAuth required
2281
+ // http bearer authentication required
2282
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2283
+
2284
+ if (page !== undefined) {
2285
+ localVarQueryParameter['page'] = page;
2286
+ }
2287
+
2288
+ if (perPage !== undefined) {
2289
+ localVarQueryParameter['perPage'] = perPage;
2290
+ }
2291
+
2292
+ if (sort !== undefined) {
2293
+ localVarQueryParameter['sort'] = sort;
2294
+ }
2295
+
2296
+
2297
+
2298
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2299
+
2300
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2301
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2302
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2303
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesSearchRequest, localVarRequestOptions, configuration)
2304
+
2305
+ return {
2306
+ url: toPathString(localVarUrlObj),
2307
+ options: localVarRequestOptions,
2308
+ };
2309
+ },
2310
+ /**
2311
+ * Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
2312
+ * @summary Update message flags
2313
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2314
+ * @param {string} folder Folder path (URL-encoded).
2315
+ * @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
2316
+ * @param {*} [options] Override http request option.
2317
+ * @throws {RequiredError}
2318
+ */
2319
+ updateMessageFlags: async (mailboxResourceId: string, folder: string, v1FolderMessagesFlagsBulkRequest: V1FolderMessagesFlagsBulkRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2320
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2321
+ assertParamExists('updateMessageFlags', 'mailboxResourceId', mailboxResourceId)
2322
+ // verify required parameter 'folder' is not null or undefined
2323
+ assertParamExists('updateMessageFlags', 'folder', folder)
2324
+ // verify required parameter 'v1FolderMessagesFlagsBulkRequest' is not null or undefined
2325
+ assertParamExists('updateMessageFlags', 'v1FolderMessagesFlagsBulkRequest', v1FolderMessagesFlagsBulkRequest)
2326
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags`
2327
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
2328
+ .replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
2329
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2330
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2331
+ let baseOptions;
2332
+ if (configuration) {
2333
+ baseOptions = configuration.baseOptions;
2334
+ }
2335
+
2336
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2337
+ const localVarHeaderParameter = {} as any;
2338
+ const localVarQueryParameter = {} as any;
2339
+
2340
+ // authentication BearerAuth required
2341
+ // http bearer authentication required
2342
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2343
+
2344
+
2345
+
2346
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2347
+
2348
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2349
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2350
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2351
+ localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesFlagsBulkRequest, localVarRequestOptions, configuration)
2352
+
2353
+ return {
2354
+ url: toPathString(localVarUrlObj),
2355
+ options: localVarRequestOptions,
2356
+ };
2357
+ },
2358
+ }
2359
+ };
2360
+
2361
+ /**
2362
+ * MessagesApi - functional programming interface
2363
+ * @export
2364
+ */
2365
+ export const MessagesApiFp = function(configuration?: Configuration) {
2366
+ const localVarAxiosParamCreator = MessagesApiAxiosParamCreator(configuration)
2367
+ return {
2368
+ /**
2369
+ * Permanently delete every message in a folder (empty the folder).
2370
+ * @summary Delete all messages
2371
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2372
+ * @param {string} folder Folder path (URL-encoded).
2373
+ * @param {*} [options] Override http request option.
2374
+ * @throws {RequiredError}
2375
+ */
2376
+ async deleteAllMessages(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
2377
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAllMessages(mailboxResourceId, folder, options);
2378
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.deleteAllMessages']?.[0]?.url;
2379
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2380
+ },
2381
+ /**
2382
+ * Permanently delete a single message.
2383
+ * @summary Delete message
2384
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2385
+ * @param {string} folder Folder path (URL-encoded).
2386
+ * @param {number} uid Message UID.
2387
+ * @param {*} [options] Override http request option.
2388
+ * @throws {RequiredError}
2389
+ */
2390
+ async deleteMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
2391
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMessage(mailboxResourceId, folder, uid, options);
2392
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.deleteMessage']?.[0]?.url;
2393
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2394
+ },
2395
+ /**
2396
+ * Permanently delete multiple messages from a folder.
2397
+ * @summary Delete messages
2398
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2399
+ * @param {string} folder Folder path (URL-encoded).
2400
+ * @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
2401
+ * @param {*} [options] Override http request option.
2402
+ * @throws {RequiredError}
2403
+ */
2404
+ async deleteMessages(mailboxResourceId: string, folder: string, v1FolderMessagesDeleteBulkRequest: V1FolderMessagesDeleteBulkRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
2405
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options);
2406
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.deleteMessages']?.[0]?.url;
2407
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2408
+ },
2409
+ /**
2410
+ * Retrieve a single message by UID.
2411
+ * @summary Get message
2412
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2413
+ * @param {string} folder Folder path (URL-encoded).
2414
+ * @param {number} uid Message UID.
2415
+ * @param {*} [options] Override http request option.
2416
+ * @throws {RequiredError}
2417
+ */
2418
+ async getMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesResource>> {
2419
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMessage(mailboxResourceId, folder, uid, options);
2420
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.getMessage']?.[0]?.url;
2421
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2422
+ },
2423
+ /**
2424
+ * Download a message attachment as `application/octet-stream`.
2425
+ * @summary Download message attachment
2426
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2427
+ * @param {string} folder Folder path (URL-encoded).
2428
+ * @param {number} uid Message UID.
2429
+ * @param {string} attachmentId Attachment ID (opaque, returned by GET message).
2430
+ * @param {*} [options] Override http request option.
2431
+ * @throws {RequiredError}
2432
+ */
2433
+ async getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
2434
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options);
2435
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.getMessageAttachment']?.[0]?.url;
2436
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2437
+ },
2438
+ /**
2439
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
2440
+ * @summary Get message source
2441
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2442
+ * @param {string} folder Folder path (URL-encoded).
2443
+ * @param {number} uid Message UID.
2444
+ * @param {*} [options] Override http request option.
2445
+ * @throws {RequiredError}
2446
+ */
2447
+ async getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
2448
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMessageSource(mailboxResourceId, folder, uid, options);
2449
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.getMessageSource']?.[0]?.url;
2450
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2451
+ },
2452
+ /**
2453
+ * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
2454
+ * @summary Get message text content
2455
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2456
+ * @param {string} folder Folder path (URL-encoded).
2457
+ * @param {number} uid Message UID.
2458
+ * @param {*} [options] Override http request option.
2459
+ * @throws {RequiredError}
2460
+ */
2461
+ async getMessageText(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesMessageTextResource>> {
2462
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMessageText(mailboxResourceId, folder, uid, options);
2463
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.getMessageText']?.[0]?.url;
2464
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2465
+ },
2466
+ /**
2467
+ * List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
2468
+ * @summary List messages
2469
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2470
+ * @param {string} folder Folder path (URL-encoded).
2471
+ * @param {number} [page] Page number (1-based).
2472
+ * @param {number} [perPage] Items per page (max 100).
2473
+ * @param {string} [sort] Sort field with optional &#x60;-&#x60; prefix for descending. Allowed: uid, date, size.
2474
+ * @param {*} [options] Override http request option.
2475
+ * @throws {RequiredError}
2476
+ */
2477
+ async listMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesCollection>> {
2478
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listMessages(mailboxResourceId, folder, page, perPage, sort, options);
2479
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.listMessages']?.[0]?.url;
2480
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2481
+ },
2482
+ /**
2483
+ * Move a single message to a target folder.
2484
+ * @summary Move message
2485
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2486
+ * @param {string} folder Source folder path (URL-encoded).
2487
+ * @param {number} uid Message UID.
2488
+ * @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
2489
+ * @param {*} [options] Override http request option.
2490
+ * @throws {RequiredError}
2491
+ */
2492
+ async moveMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesMoveRequest: V1FolderMessagesMoveRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
2493
+ const localVarAxiosArgs = await localVarAxiosParamCreator.moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options);
2494
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.moveMessage']?.[0]?.url;
2495
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2496
+ },
2497
+ /**
2498
+ * Move multiple messages from a source folder to a target folder.
2499
+ * @summary Move messages
2500
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2501
+ * @param {string} folder Source folder path (URL-encoded).
2502
+ * @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
2503
+ * @param {*} [options] Override http request option.
2504
+ * @throws {RequiredError}
2505
+ */
2506
+ async moveMessages(mailboxResourceId: string, folder: string, v1FolderMessagesMoveBulkRequest: V1FolderMessagesMoveBulkRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
2507
+ const localVarAxiosArgs = await localVarAxiosParamCreator.moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options);
2508
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.moveMessages']?.[0]?.url;
2509
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2510
+ },
2511
+ /**
2512
+ * Add and/or remove flags on a single message. Returns the updated message.
2513
+ * @summary Update message flags
2514
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2515
+ * @param {string} folder Folder path (URL-encoded).
2516
+ * @param {number} uid Message UID.
2517
+ * @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
2518
+ * @param {*} [options] Override http request option.
2519
+ * @throws {RequiredError}
2520
+ */
2521
+ async patchMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesFlagsRequest: V1FolderMessagesFlagsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesResource>> {
2522
+ const localVarAxiosArgs = await localVarAxiosParamCreator.patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options);
2523
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.patchMessage']?.[0]?.url;
2524
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2525
+ },
2526
+ /**
2527
+ * Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
2528
+ * @summary Search messages
2529
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2530
+ * @param {string} folder Folder path (URL-encoded).
2531
+ * @param {number} [page]
2532
+ * @param {number} [perPage]
2533
+ * @param {string} [sort]
2534
+ * @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
2535
+ * @param {*} [options] Override http request option.
2536
+ * @throws {RequiredError}
2537
+ */
2538
+ async searchMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, v1FolderMessagesSearchRequest?: V1FolderMessagesSearchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesCollection>> {
2539
+ const localVarAxiosArgs = await localVarAxiosParamCreator.searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options);
2540
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.searchMessages']?.[0]?.url;
2541
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2542
+ },
2543
+ /**
2544
+ * Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
2545
+ * @summary Update message flags
2546
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2547
+ * @param {string} folder Folder path (URL-encoded).
2548
+ * @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
2549
+ * @param {*} [options] Override http request option.
2550
+ * @throws {RequiredError}
2551
+ */
2552
+ async updateMessageFlags(mailboxResourceId: string, folder: string, v1FolderMessagesFlagsBulkRequest: V1FolderMessagesFlagsBulkRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1FolderMessagesUpdateFlagsResult>> {
2553
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options);
2554
+ const localVarOperationServerBasePath = operationServerMap['MessagesApi.updateMessageFlags']?.[0]?.url;
2555
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2556
+ },
2557
+ }
2558
+ };
2559
+
2560
+ /**
2561
+ * MessagesApi - factory interface
2562
+ * @export
2563
+ */
2564
+ export const MessagesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
2565
+ const localVarFp = MessagesApiFp(configuration)
2566
+ return {
2567
+ /**
2568
+ * Permanently delete every message in a folder (empty the folder).
2569
+ * @summary Delete all messages
2570
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2571
+ * @param {string} folder Folder path (URL-encoded).
2572
+ * @param {*} [options] Override http request option.
2573
+ * @throws {RequiredError}
2574
+ */
2575
+ deleteAllMessages(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
2576
+ return localVarFp.deleteAllMessages(mailboxResourceId, folder, options).then((request) => request(axios, basePath));
2577
+ },
2578
+ /**
2579
+ * Permanently delete a single message.
2580
+ * @summary Delete message
2581
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2582
+ * @param {string} folder Folder path (URL-encoded).
2583
+ * @param {number} uid Message UID.
2584
+ * @param {*} [options] Override http request option.
2585
+ * @throws {RequiredError}
2586
+ */
2587
+ deleteMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): AxiosPromise<void> {
2588
+ return localVarFp.deleteMessage(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
2589
+ },
2590
+ /**
2591
+ * Permanently delete multiple messages from a folder.
2592
+ * @summary Delete messages
2593
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2594
+ * @param {string} folder Folder path (URL-encoded).
2595
+ * @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
2596
+ * @param {*} [options] Override http request option.
2597
+ * @throws {RequiredError}
2598
+ */
2599
+ deleteMessages(mailboxResourceId: string, folder: string, v1FolderMessagesDeleteBulkRequest: V1FolderMessagesDeleteBulkRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
2600
+ return localVarFp.deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options).then((request) => request(axios, basePath));
2601
+ },
2602
+ /**
2603
+ * Retrieve a single message by UID.
2604
+ * @summary Get message
2605
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2606
+ * @param {string} folder Folder path (URL-encoded).
2607
+ * @param {number} uid Message UID.
2608
+ * @param {*} [options] Override http request option.
2609
+ * @throws {RequiredError}
2610
+ */
2611
+ getMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesResource> {
2612
+ return localVarFp.getMessage(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
2613
+ },
2614
+ /**
2615
+ * Download a message attachment as `application/octet-stream`.
2616
+ * @summary Download message attachment
2617
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2618
+ * @param {string} folder Folder path (URL-encoded).
2619
+ * @param {number} uid Message UID.
2620
+ * @param {string} attachmentId Attachment ID (opaque, returned by GET message).
2621
+ * @param {*} [options] Override http request option.
2622
+ * @throws {RequiredError}
2623
+ */
2624
+ getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig): AxiosPromise<File> {
2625
+ return localVarFp.getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options).then((request) => request(axios, basePath));
2626
+ },
2627
+ /**
2628
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
2629
+ * @summary Get message source
2630
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2631
+ * @param {string} folder Folder path (URL-encoded).
2632
+ * @param {number} uid Message UID.
2633
+ * @param {*} [options] Override http request option.
2634
+ * @throws {RequiredError}
2635
+ */
2636
+ getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): AxiosPromise<File> {
2637
+ return localVarFp.getMessageSource(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
2638
+ },
2639
+ /**
2640
+ * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
2641
+ * @summary Get message text content
2642
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2643
+ * @param {string} folder Folder path (URL-encoded).
2644
+ * @param {number} uid Message UID.
2645
+ * @param {*} [options] Override http request option.
2646
+ * @throws {RequiredError}
2647
+ */
2648
+ getMessageText(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesMessageTextResource> {
2649
+ return localVarFp.getMessageText(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
2650
+ },
2651
+ /**
2652
+ * List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
2653
+ * @summary List messages
2654
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2655
+ * @param {string} folder Folder path (URL-encoded).
2656
+ * @param {number} [page] Page number (1-based).
2657
+ * @param {number} [perPage] Items per page (max 100).
2658
+ * @param {string} [sort] Sort field with optional &#x60;-&#x60; prefix for descending. Allowed: uid, date, size.
2659
+ * @param {*} [options] Override http request option.
2660
+ * @throws {RequiredError}
2661
+ */
2662
+ listMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesCollection> {
2663
+ return localVarFp.listMessages(mailboxResourceId, folder, page, perPage, sort, options).then((request) => request(axios, basePath));
2664
+ },
2665
+ /**
2666
+ * Move a single message to a target folder.
2667
+ * @summary Move message
2668
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2669
+ * @param {string} folder Source folder path (URL-encoded).
2670
+ * @param {number} uid Message UID.
2671
+ * @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
2672
+ * @param {*} [options] Override http request option.
2673
+ * @throws {RequiredError}
2674
+ */
2675
+ moveMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesMoveRequest: V1FolderMessagesMoveRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
2676
+ return localVarFp.moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options).then((request) => request(axios, basePath));
2677
+ },
2678
+ /**
2679
+ * Move multiple messages from a source folder to a target folder.
2680
+ * @summary Move messages
2681
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2682
+ * @param {string} folder Source folder path (URL-encoded).
2683
+ * @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
2684
+ * @param {*} [options] Override http request option.
2685
+ * @throws {RequiredError}
2686
+ */
2687
+ moveMessages(mailboxResourceId: string, folder: string, v1FolderMessagesMoveBulkRequest: V1FolderMessagesMoveBulkRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
2688
+ return localVarFp.moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options).then((request) => request(axios, basePath));
2689
+ },
2690
+ /**
2691
+ * Add and/or remove flags on a single message. Returns the updated message.
2692
+ * @summary Update message flags
2693
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2694
+ * @param {string} folder Folder path (URL-encoded).
2695
+ * @param {number} uid Message UID.
2696
+ * @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
2697
+ * @param {*} [options] Override http request option.
2698
+ * @throws {RequiredError}
2699
+ */
2700
+ patchMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesFlagsRequest: V1FolderMessagesFlagsRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesResource> {
2701
+ return localVarFp.patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options).then((request) => request(axios, basePath));
2702
+ },
2703
+ /**
2704
+ * Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
2705
+ * @summary Search messages
2706
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2707
+ * @param {string} folder Folder path (URL-encoded).
2708
+ * @param {number} [page]
2709
+ * @param {number} [perPage]
2710
+ * @param {string} [sort]
2711
+ * @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
2712
+ * @param {*} [options] Override http request option.
2713
+ * @throws {RequiredError}
2714
+ */
2715
+ searchMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, v1FolderMessagesSearchRequest?: V1FolderMessagesSearchRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesCollection> {
2716
+ return localVarFp.searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options).then((request) => request(axios, basePath));
2717
+ },
2718
+ /**
2719
+ * Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
2720
+ * @summary Update message flags
2721
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2722
+ * @param {string} folder Folder path (URL-encoded).
2723
+ * @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
2724
+ * @param {*} [options] Override http request option.
2725
+ * @throws {RequiredError}
2726
+ */
2727
+ updateMessageFlags(mailboxResourceId: string, folder: string, v1FolderMessagesFlagsBulkRequest: V1FolderMessagesFlagsBulkRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1FolderMessagesUpdateFlagsResult> {
2728
+ return localVarFp.updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options).then((request) => request(axios, basePath));
2729
+ },
2730
+ };
2731
+ };
2732
+
2733
+ /**
2734
+ * MessagesApi - object-oriented interface
2735
+ * @export
2736
+ * @class MessagesApi
2737
+ * @extends {BaseAPI}
2738
+ */
2739
+ export class MessagesApi extends BaseAPI {
2740
+ /**
2741
+ * Permanently delete every message in a folder (empty the folder).
2742
+ * @summary Delete all messages
2743
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2744
+ * @param {string} folder Folder path (URL-encoded).
2745
+ * @param {*} [options] Override http request option.
2746
+ * @throws {RequiredError}
2747
+ * @memberof MessagesApi
2748
+ */
2749
+ public deleteAllMessages(mailboxResourceId: string, folder: string, options?: RawAxiosRequestConfig) {
2750
+ return MessagesApiFp(this.configuration).deleteAllMessages(mailboxResourceId, folder, options).then((request) => request(this.axios, this.basePath));
2751
+ }
2752
+
2753
+ /**
2754
+ * Permanently delete a single message.
2755
+ * @summary Delete message
2756
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2757
+ * @param {string} folder Folder path (URL-encoded).
2758
+ * @param {number} uid Message UID.
2759
+ * @param {*} [options] Override http request option.
2760
+ * @throws {RequiredError}
2761
+ * @memberof MessagesApi
2762
+ */
2763
+ public deleteMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig) {
2764
+ return MessagesApiFp(this.configuration).deleteMessage(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
2765
+ }
2766
+
2767
+ /**
2768
+ * Permanently delete multiple messages from a folder.
2769
+ * @summary Delete messages
2770
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2771
+ * @param {string} folder Folder path (URL-encoded).
2772
+ * @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
2773
+ * @param {*} [options] Override http request option.
2774
+ * @throws {RequiredError}
2775
+ * @memberof MessagesApi
2776
+ */
2777
+ public deleteMessages(mailboxResourceId: string, folder: string, v1FolderMessagesDeleteBulkRequest: V1FolderMessagesDeleteBulkRequest, options?: RawAxiosRequestConfig) {
2778
+ return MessagesApiFp(this.configuration).deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options).then((request) => request(this.axios, this.basePath));
2779
+ }
2780
+
2781
+ /**
2782
+ * Retrieve a single message by UID.
2783
+ * @summary Get message
2784
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2785
+ * @param {string} folder Folder path (URL-encoded).
2786
+ * @param {number} uid Message UID.
2787
+ * @param {*} [options] Override http request option.
2788
+ * @throws {RequiredError}
2789
+ * @memberof MessagesApi
2790
+ */
2791
+ public getMessage(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig) {
2792
+ return MessagesApiFp(this.configuration).getMessage(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
2793
+ }
2794
+
2795
+ /**
2796
+ * Download a message attachment as `application/octet-stream`.
2797
+ * @summary Download message attachment
2798
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2799
+ * @param {string} folder Folder path (URL-encoded).
2800
+ * @param {number} uid Message UID.
2801
+ * @param {string} attachmentId Attachment ID (opaque, returned by GET message).
2802
+ * @param {*} [options] Override http request option.
2803
+ * @throws {RequiredError}
2804
+ * @memberof MessagesApi
2805
+ */
2806
+ public getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig) {
2807
+ return MessagesApiFp(this.configuration).getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options).then((request) => request(this.axios, this.basePath));
2808
+ }
2809
+
2810
+ /**
2811
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
2812
+ * @summary Get message source
2813
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2814
+ * @param {string} folder Folder path (URL-encoded).
2815
+ * @param {number} uid Message UID.
2816
+ * @param {*} [options] Override http request option.
2817
+ * @throws {RequiredError}
2818
+ * @memberof MessagesApi
2819
+ */
2820
+ public getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig) {
2821
+ return MessagesApiFp(this.configuration).getMessageSource(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
2822
+ }
2823
+
2824
+ /**
2825
+ * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
2826
+ * @summary Get message text content
2827
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2828
+ * @param {string} folder Folder path (URL-encoded).
2829
+ * @param {number} uid Message UID.
2830
+ * @param {*} [options] Override http request option.
2831
+ * @throws {RequiredError}
2832
+ * @memberof MessagesApi
2833
+ */
2834
+ public getMessageText(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig) {
2835
+ return MessagesApiFp(this.configuration).getMessageText(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
2836
+ }
2837
+
2838
+ /**
2839
+ * List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
2840
+ * @summary List messages
2841
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2842
+ * @param {string} folder Folder path (URL-encoded).
2843
+ * @param {number} [page] Page number (1-based).
2844
+ * @param {number} [perPage] Items per page (max 100).
2845
+ * @param {string} [sort] Sort field with optional &#x60;-&#x60; prefix for descending. Allowed: uid, date, size.
2846
+ * @param {*} [options] Override http request option.
2847
+ * @throws {RequiredError}
2848
+ * @memberof MessagesApi
2849
+ */
2850
+ public listMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, options?: RawAxiosRequestConfig) {
2851
+ return MessagesApiFp(this.configuration).listMessages(mailboxResourceId, folder, page, perPage, sort, options).then((request) => request(this.axios, this.basePath));
2852
+ }
2853
+
2854
+ /**
2855
+ * Move a single message to a target folder.
2856
+ * @summary Move message
2857
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2858
+ * @param {string} folder Source folder path (URL-encoded).
2859
+ * @param {number} uid Message UID.
2860
+ * @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
2861
+ * @param {*} [options] Override http request option.
2862
+ * @throws {RequiredError}
2863
+ * @memberof MessagesApi
2864
+ */
2865
+ public moveMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesMoveRequest: V1FolderMessagesMoveRequest, options?: RawAxiosRequestConfig) {
2866
+ return MessagesApiFp(this.configuration).moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options).then((request) => request(this.axios, this.basePath));
2867
+ }
2868
+
2869
+ /**
2870
+ * Move multiple messages from a source folder to a target folder.
2871
+ * @summary Move messages
2872
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2873
+ * @param {string} folder Source folder path (URL-encoded).
2874
+ * @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
2875
+ * @param {*} [options] Override http request option.
2876
+ * @throws {RequiredError}
2877
+ * @memberof MessagesApi
2878
+ */
2879
+ public moveMessages(mailboxResourceId: string, folder: string, v1FolderMessagesMoveBulkRequest: V1FolderMessagesMoveBulkRequest, options?: RawAxiosRequestConfig) {
2880
+ return MessagesApiFp(this.configuration).moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options).then((request) => request(this.axios, this.basePath));
2881
+ }
2882
+
2883
+ /**
2884
+ * Add and/or remove flags on a single message. Returns the updated message.
2885
+ * @summary Update message flags
2886
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2887
+ * @param {string} folder Folder path (URL-encoded).
2888
+ * @param {number} uid Message UID.
2889
+ * @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
2890
+ * @param {*} [options] Override http request option.
2891
+ * @throws {RequiredError}
2892
+ * @memberof MessagesApi
2893
+ */
2894
+ public patchMessage(mailboxResourceId: string, folder: string, uid: number, v1FolderMessagesFlagsRequest: V1FolderMessagesFlagsRequest, options?: RawAxiosRequestConfig) {
2895
+ return MessagesApiFp(this.configuration).patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options).then((request) => request(this.axios, this.basePath));
2896
+ }
2897
+
2898
+ /**
2899
+ * Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
2900
+ * @summary Search messages
2901
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2902
+ * @param {string} folder Folder path (URL-encoded).
2903
+ * @param {number} [page]
2904
+ * @param {number} [perPage]
2905
+ * @param {string} [sort]
2906
+ * @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
2907
+ * @param {*} [options] Override http request option.
2908
+ * @throws {RequiredError}
2909
+ * @memberof MessagesApi
2910
+ */
2911
+ public searchMessages(mailboxResourceId: string, folder: string, page?: number, perPage?: number, sort?: string, v1FolderMessagesSearchRequest?: V1FolderMessagesSearchRequest, options?: RawAxiosRequestConfig) {
2912
+ return MessagesApiFp(this.configuration).searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options).then((request) => request(this.axios, this.basePath));
2913
+ }
2914
+
2915
+ /**
2916
+ * Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
2917
+ * @summary Update message flags
2918
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2919
+ * @param {string} folder Folder path (URL-encoded).
2920
+ * @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
2921
+ * @param {*} [options] Override http request option.
2922
+ * @throws {RequiredError}
2923
+ * @memberof MessagesApi
2924
+ */
2925
+ public updateMessageFlags(mailboxResourceId: string, folder: string, v1FolderMessagesFlagsBulkRequest: V1FolderMessagesFlagsBulkRequest, options?: RawAxiosRequestConfig) {
2926
+ return MessagesApiFp(this.configuration).updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options).then((request) => request(this.axios, this.basePath));
2927
+ }
2928
+ }
2929
+
2930
+
2931
+
2932
+ /**
2933
+ * QuotaApi - axios parameter creator
2934
+ * @export
2935
+ */
2936
+ export const QuotaApiAxiosParamCreator = function (configuration?: Configuration) {
2937
+ return {
2938
+ /**
2939
+ * Retrieve storage and message quota usage for the managed mailbox.
2940
+ * @summary Get mailbox quota
2941
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2942
+ * @param {*} [options] Override http request option.
2943
+ * @throws {RequiredError}
2944
+ */
2945
+ getQuota: async (mailboxResourceId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2946
+ // verify required parameter 'mailboxResourceId' is not null or undefined
2947
+ assertParamExists('getQuota', 'mailboxResourceId', mailboxResourceId)
2948
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/quota`
2949
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
2950
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2951
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2952
+ let baseOptions;
2953
+ if (configuration) {
2954
+ baseOptions = configuration.baseOptions;
2955
+ }
2956
+
2957
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2958
+ const localVarHeaderParameter = {} as any;
2959
+ const localVarQueryParameter = {} as any;
2960
+
2961
+ // authentication BearerAuth required
2962
+ // http bearer authentication required
2963
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2964
+
2965
+
2966
+
2967
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2968
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2969
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2970
+
2971
+ return {
2972
+ url: toPathString(localVarUrlObj),
2973
+ options: localVarRequestOptions,
2974
+ };
2975
+ },
2976
+ }
2977
+ };
2978
+
2979
+ /**
2980
+ * QuotaApi - functional programming interface
2981
+ * @export
2982
+ */
2983
+ export const QuotaApiFp = function(configuration?: Configuration) {
2984
+ const localVarAxiosParamCreator = QuotaApiAxiosParamCreator(configuration)
2985
+ return {
2986
+ /**
2987
+ * Retrieve storage and message quota usage for the managed mailbox.
2988
+ * @summary Get mailbox quota
2989
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2990
+ * @param {*} [options] Override http request option.
2991
+ * @throws {RequiredError}
2992
+ */
2993
+ async getQuota(mailboxResourceId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1QuotaResource>> {
2994
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getQuota(mailboxResourceId, options);
2995
+ const localVarOperationServerBasePath = operationServerMap['QuotaApi.getQuota']?.[0]?.url;
2996
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2997
+ },
2998
+ }
2999
+ };
3000
+
3001
+ /**
3002
+ * QuotaApi - factory interface
3003
+ * @export
3004
+ */
3005
+ export const QuotaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
3006
+ const localVarFp = QuotaApiFp(configuration)
3007
+ return {
3008
+ /**
3009
+ * Retrieve storage and message quota usage for the managed mailbox.
3010
+ * @summary Get mailbox quota
3011
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3012
+ * @param {*} [options] Override http request option.
3013
+ * @throws {RequiredError}
3014
+ */
3015
+ getQuota(mailboxResourceId: string, options?: RawAxiosRequestConfig): AxiosPromise<V1QuotaResource> {
3016
+ return localVarFp.getQuota(mailboxResourceId, options).then((request) => request(axios, basePath));
3017
+ },
3018
+ };
3019
+ };
3020
+
3021
+ /**
3022
+ * QuotaApi - object-oriented interface
3023
+ * @export
3024
+ * @class QuotaApi
3025
+ * @extends {BaseAPI}
3026
+ */
3027
+ export class QuotaApi extends BaseAPI {
3028
+ /**
3029
+ * Retrieve storage and message quota usage for the managed mailbox.
3030
+ * @summary Get mailbox quota
3031
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3032
+ * @param {*} [options] Override http request option.
3033
+ * @throws {RequiredError}
3034
+ * @memberof QuotaApi
3035
+ */
3036
+ public getQuota(mailboxResourceId: string, options?: RawAxiosRequestConfig) {
3037
+ return QuotaApiFp(this.configuration).getQuota(mailboxResourceId, options).then((request) => request(this.axios, this.basePath));
3038
+ }
3039
+ }
3040
+
3041
+
3042
+
3043
+ /**
3044
+ * SendApi - axios parameter creator
3045
+ * @export
3046
+ */
3047
+ export const SendApiAxiosParamCreator = function (configuration?: Configuration) {
3048
+ return {
3049
+ /**
3050
+ * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
3051
+ * @summary Send email
3052
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3053
+ * @param {V1SendRequest | null} v1SendRequest
3054
+ * @param {*} [options] Override http request option.
3055
+ * @throws {RequiredError}
3056
+ */
3057
+ sendEmail: async (mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3058
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3059
+ assertParamExists('sendEmail', 'mailboxResourceId', mailboxResourceId)
3060
+ // verify required parameter 'v1SendRequest' is not null or undefined
3061
+ assertParamExists('sendEmail', 'v1SendRequest', v1SendRequest)
3062
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/send`
3063
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
3064
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3065
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3066
+ let baseOptions;
3067
+ if (configuration) {
3068
+ baseOptions = configuration.baseOptions;
3069
+ }
3070
+
3071
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
3072
+ const localVarHeaderParameter = {} as any;
3073
+ const localVarQueryParameter = {} as any;
3074
+
3075
+ // authentication BearerAuth required
3076
+ // http bearer authentication required
3077
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3078
+
3079
+
3080
+
3081
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3082
+
3083
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3084
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3085
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3086
+ localVarRequestOptions.data = serializeDataIfNeeded(v1SendRequest, localVarRequestOptions, configuration)
3087
+
3088
+ return {
3089
+ url: toPathString(localVarUrlObj),
3090
+ options: localVarRequestOptions,
3091
+ };
3092
+ },
3093
+ }
3094
+ };
3095
+
3096
+ /**
3097
+ * SendApi - functional programming interface
3098
+ * @export
3099
+ */
3100
+ export const SendApiFp = function(configuration?: Configuration) {
3101
+ const localVarAxiosParamCreator = SendApiAxiosParamCreator(configuration)
3102
+ return {
3103
+ /**
3104
+ * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
3105
+ * @summary Send email
3106
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3107
+ * @param {V1SendRequest | null} v1SendRequest
3108
+ * @param {*} [options] Override http request option.
3109
+ * @throws {RequiredError}
3110
+ */
3111
+ async sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
3112
+ const localVarAxiosArgs = await localVarAxiosParamCreator.sendEmail(mailboxResourceId, v1SendRequest, options);
3113
+ const localVarOperationServerBasePath = operationServerMap['SendApi.sendEmail']?.[0]?.url;
3114
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3115
+ },
3116
+ }
3117
+ };
3118
+
3119
+ /**
3120
+ * SendApi - factory interface
3121
+ * @export
3122
+ */
3123
+ export const SendApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
3124
+ const localVarFp = SendApiFp(configuration)
3125
+ return {
3126
+ /**
3127
+ * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
3128
+ * @summary Send email
3129
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3130
+ * @param {V1SendRequest | null} v1SendRequest
3131
+ * @param {*} [options] Override http request option.
3132
+ * @throws {RequiredError}
3133
+ */
3134
+ sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig): AxiosPromise<void> {
3135
+ return localVarFp.sendEmail(mailboxResourceId, v1SendRequest, options).then((request) => request(axios, basePath));
3136
+ },
3137
+ };
3138
+ };
3139
+
3140
+ /**
3141
+ * SendApi - object-oriented interface
3142
+ * @export
3143
+ * @class SendApi
3144
+ * @extends {BaseAPI}
3145
+ */
3146
+ export class SendApi extends BaseAPI {
3147
+ /**
3148
+ * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
3149
+ * @summary Send email
3150
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3151
+ * @param {V1SendRequest | null} v1SendRequest
3152
+ * @param {*} [options] Override http request option.
3153
+ * @throws {RequiredError}
3154
+ * @memberof SendApi
3155
+ */
3156
+ public sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig) {
3157
+ return SendApiFp(this.configuration).sendEmail(mailboxResourceId, v1SendRequest, options).then((request) => request(this.axios, this.basePath));
3158
+ }
3159
+ }
3160
+
3161
+
3162
+
3163
+ /**
3164
+ * WebhooksApi - axios parameter creator
3165
+ * @export
3166
+ */
3167
+ export const WebhooksApiAxiosParamCreator = function (configuration?: Configuration) {
3168
+ return {
3169
+ /**
3170
+ * Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
3171
+ * @summary Create webhook
3172
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3173
+ * @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
3174
+ * @param {*} [options] Override http request option.
3175
+ * @throws {RequiredError}
3176
+ */
3177
+ createWebhook: async (mailboxResourceId: string, v1WebhooksCreateRequest: V1WebhooksCreateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3178
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3179
+ assertParamExists('createWebhook', 'mailboxResourceId', mailboxResourceId)
3180
+ // verify required parameter 'v1WebhooksCreateRequest' is not null or undefined
3181
+ assertParamExists('createWebhook', 'v1WebhooksCreateRequest', v1WebhooksCreateRequest)
3182
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks`
3183
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
3184
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3185
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3186
+ let baseOptions;
3187
+ if (configuration) {
3188
+ baseOptions = configuration.baseOptions;
3189
+ }
3190
+
3191
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
3192
+ const localVarHeaderParameter = {} as any;
3193
+ const localVarQueryParameter = {} as any;
3194
+
3195
+ // authentication BearerAuth required
3196
+ // http bearer authentication required
3197
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3198
+
3199
+
3200
+
3201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3202
+
3203
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3204
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3205
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3206
+ localVarRequestOptions.data = serializeDataIfNeeded(v1WebhooksCreateRequest, localVarRequestOptions, configuration)
3207
+
3208
+ return {
3209
+ url: toPathString(localVarUrlObj),
3210
+ options: localVarRequestOptions,
3211
+ };
3212
+ },
3213
+ /**
3214
+ * Delete a webhook.
3215
+ * @summary Delete webhook
3216
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3217
+ * @param {string} webhook Webhook identifier (UUID v7).
3218
+ * @param {*} [options] Override http request option.
3219
+ * @throws {RequiredError}
3220
+ */
3221
+ deleteWebhook: async (mailboxResourceId: string, webhook: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3222
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3223
+ assertParamExists('deleteWebhook', 'mailboxResourceId', mailboxResourceId)
3224
+ // verify required parameter 'webhook' is not null or undefined
3225
+ assertParamExists('deleteWebhook', 'webhook', webhook)
3226
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
3227
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
3228
+ .replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
3229
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3230
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3231
+ let baseOptions;
3232
+ if (configuration) {
3233
+ baseOptions = configuration.baseOptions;
3234
+ }
3235
+
3236
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
3237
+ const localVarHeaderParameter = {} as any;
3238
+ const localVarQueryParameter = {} as any;
3239
+
3240
+ // authentication BearerAuth required
3241
+ // http bearer authentication required
3242
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3243
+
3244
+
3245
+
3246
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3247
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3248
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3249
+
3250
+ return {
3251
+ url: toPathString(localVarUrlObj),
3252
+ options: localVarRequestOptions,
3253
+ };
3254
+ },
3255
+ /**
3256
+ * Retrieve a single webhook by id.
3257
+ * @summary Get webhook
3258
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3259
+ * @param {string} webhook Webhook identifier (UUID v7).
3260
+ * @param {*} [options] Override http request option.
3261
+ * @throws {RequiredError}
3262
+ */
3263
+ getWebhook: async (mailboxResourceId: string, webhook: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3264
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3265
+ assertParamExists('getWebhook', 'mailboxResourceId', mailboxResourceId)
3266
+ // verify required parameter 'webhook' is not null or undefined
3267
+ assertParamExists('getWebhook', 'webhook', webhook)
3268
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
3269
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
3270
+ .replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
3271
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3272
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3273
+ let baseOptions;
3274
+ if (configuration) {
3275
+ baseOptions = configuration.baseOptions;
3276
+ }
3277
+
3278
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
3279
+ const localVarHeaderParameter = {} as any;
3280
+ const localVarQueryParameter = {} as any;
3281
+
3282
+ // authentication BearerAuth required
3283
+ // http bearer authentication required
3284
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3285
+
3286
+
3287
+
3288
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3289
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3290
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3291
+
3292
+ return {
3293
+ url: toPathString(localVarUrlObj),
3294
+ options: localVarRequestOptions,
3295
+ };
3296
+ },
3297
+ /**
3298
+ * List webhooks for a mailbox.
3299
+ * @summary List webhooks
3300
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3301
+ * @param {ListWebhooksStatusEnum} [status]
3302
+ * @param {number} [page]
3303
+ * @param {number} [perPage]
3304
+ * @param {*} [options] Override http request option.
3305
+ * @throws {RequiredError}
3306
+ */
3307
+ listWebhooks: async (mailboxResourceId: string, status?: ListWebhooksStatusEnum, page?: number, perPage?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3308
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3309
+ assertParamExists('listWebhooks', 'mailboxResourceId', mailboxResourceId)
3310
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks`
3311
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
3312
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3313
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3314
+ let baseOptions;
3315
+ if (configuration) {
3316
+ baseOptions = configuration.baseOptions;
3317
+ }
3318
+
3319
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
3320
+ const localVarHeaderParameter = {} as any;
3321
+ const localVarQueryParameter = {} as any;
3322
+
3323
+ // authentication BearerAuth required
3324
+ // http bearer authentication required
3325
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3326
+
3327
+ if (status !== undefined) {
3328
+ localVarQueryParameter['status'] = status;
3329
+ }
3330
+
3331
+ if (page !== undefined) {
3332
+ localVarQueryParameter['page'] = page;
3333
+ }
3334
+
3335
+ if (perPage !== undefined) {
3336
+ localVarQueryParameter['perPage'] = perPage;
3337
+ }
3338
+
3339
+
3340
+
3341
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3342
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3343
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3344
+
3345
+ return {
3346
+ url: toPathString(localVarUrlObj),
3347
+ options: localVarRequestOptions,
3348
+ };
3349
+ },
3350
+ /**
3351
+ * Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
3352
+ * @summary Regenerate webhook secret
3353
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3354
+ * @param {string} webhook Webhook identifier (UUID v7).
3355
+ * @param {*} [options] Override http request option.
3356
+ * @throws {RequiredError}
3357
+ */
3358
+ regenerateWebhookSecret: async (mailboxResourceId: string, webhook: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3359
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3360
+ assertParamExists('regenerateWebhookSecret', 'mailboxResourceId', mailboxResourceId)
3361
+ // verify required parameter 'webhook' is not null or undefined
3362
+ assertParamExists('regenerateWebhookSecret', 'webhook', webhook)
3363
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/regenerate-secret`
3364
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
3365
+ .replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
3366
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3367
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3368
+ let baseOptions;
3369
+ if (configuration) {
3370
+ baseOptions = configuration.baseOptions;
3371
+ }
3372
+
3373
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
3374
+ const localVarHeaderParameter = {} as any;
3375
+ const localVarQueryParameter = {} as any;
3376
+
3377
+ // authentication BearerAuth required
3378
+ // http bearer authentication required
3379
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3380
+
3381
+
3382
+
3383
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3384
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3385
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3386
+
3387
+ return {
3388
+ url: toPathString(localVarUrlObj),
3389
+ options: localVarRequestOptions,
3390
+ };
3391
+ },
3392
+ /**
3393
+ * Send a test delivery to the webhook URL and return the upstream response.
3394
+ * @summary Test webhook
3395
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3396
+ * @param {string} webhook Webhook identifier (UUID v7).
3397
+ * @param {*} [options] Override http request option.
3398
+ * @throws {RequiredError}
3399
+ */
3400
+ testWebhook: async (mailboxResourceId: string, webhook: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3401
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3402
+ assertParamExists('testWebhook', 'mailboxResourceId', mailboxResourceId)
3403
+ // verify required parameter 'webhook' is not null or undefined
3404
+ assertParamExists('testWebhook', 'webhook', webhook)
3405
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/test`
3406
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
3407
+ .replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
3408
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3409
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3410
+ let baseOptions;
3411
+ if (configuration) {
3412
+ baseOptions = configuration.baseOptions;
3413
+ }
3414
+
3415
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
3416
+ const localVarHeaderParameter = {} as any;
3417
+ const localVarQueryParameter = {} as any;
3418
+
3419
+ // authentication BearerAuth required
3420
+ // http bearer authentication required
3421
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3422
+
3423
+
3424
+
3425
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3426
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3427
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3428
+
3429
+ return {
3430
+ url: toPathString(localVarUrlObj),
3431
+ options: localVarRequestOptions,
3432
+ };
3433
+ },
3434
+ /**
3435
+ * Partially update a webhook.
3436
+ * @summary Update webhook
3437
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3438
+ * @param {string} webhook Webhook identifier (UUID v7).
3439
+ * @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
3440
+ * @param {*} [options] Override http request option.
3441
+ * @throws {RequiredError}
3442
+ */
3443
+ updateWebhook: async (mailboxResourceId: string, webhook: string, v1WebhooksUpdateRequest: V1WebhooksUpdateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3444
+ // verify required parameter 'mailboxResourceId' is not null or undefined
3445
+ assertParamExists('updateWebhook', 'mailboxResourceId', mailboxResourceId)
3446
+ // verify required parameter 'webhook' is not null or undefined
3447
+ assertParamExists('updateWebhook', 'webhook', webhook)
3448
+ // verify required parameter 'v1WebhooksUpdateRequest' is not null or undefined
3449
+ assertParamExists('updateWebhook', 'v1WebhooksUpdateRequest', v1WebhooksUpdateRequest)
3450
+ const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
3451
+ .replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
3452
+ .replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
3453
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3454
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3455
+ let baseOptions;
3456
+ if (configuration) {
3457
+ baseOptions = configuration.baseOptions;
3458
+ }
3459
+
3460
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
3461
+ const localVarHeaderParameter = {} as any;
3462
+ const localVarQueryParameter = {} as any;
3463
+
3464
+ // authentication BearerAuth required
3465
+ // http bearer authentication required
3466
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3467
+
3468
+
3469
+
3470
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3471
+
3472
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3473
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3474
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3475
+ localVarRequestOptions.data = serializeDataIfNeeded(v1WebhooksUpdateRequest, localVarRequestOptions, configuration)
3476
+
3477
+ return {
3478
+ url: toPathString(localVarUrlObj),
3479
+ options: localVarRequestOptions,
3480
+ };
3481
+ },
3482
+ }
3483
+ };
3484
+
3485
+ /**
3486
+ * WebhooksApi - functional programming interface
3487
+ * @export
3488
+ */
3489
+ export const WebhooksApiFp = function(configuration?: Configuration) {
3490
+ const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration)
3491
+ return {
3492
+ /**
3493
+ * Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
3494
+ * @summary Create webhook
3495
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3496
+ * @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
3497
+ * @param {*} [options] Override http request option.
3498
+ * @throws {RequiredError}
3499
+ */
3500
+ async createWebhook(mailboxResourceId: string, v1WebhooksCreateRequest: V1WebhooksCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksResourceWithSecret>> {
3501
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options);
3502
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.createWebhook']?.[0]?.url;
3503
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3504
+ },
3505
+ /**
3506
+ * Delete a webhook.
3507
+ * @summary Delete webhook
3508
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3509
+ * @param {string} webhook Webhook identifier (UUID v7).
3510
+ * @param {*} [options] Override http request option.
3511
+ * @throws {RequiredError}
3512
+ */
3513
+ async deleteWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
3514
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(mailboxResourceId, webhook, options);
3515
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.deleteWebhook']?.[0]?.url;
3516
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3517
+ },
3518
+ /**
3519
+ * Retrieve a single webhook by id.
3520
+ * @summary Get webhook
3521
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3522
+ * @param {string} webhook Webhook identifier (UUID v7).
3523
+ * @param {*} [options] Override http request option.
3524
+ * @throws {RequiredError}
3525
+ */
3526
+ async getWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksResource>> {
3527
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhook(mailboxResourceId, webhook, options);
3528
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.getWebhook']?.[0]?.url;
3529
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3530
+ },
3531
+ /**
3532
+ * List webhooks for a mailbox.
3533
+ * @summary List webhooks
3534
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3535
+ * @param {ListWebhooksStatusEnum} [status]
3536
+ * @param {number} [page]
3537
+ * @param {number} [perPage]
3538
+ * @param {*} [options] Override http request option.
3539
+ * @throws {RequiredError}
3540
+ */
3541
+ async listWebhooks(mailboxResourceId: string, status?: ListWebhooksStatusEnum, page?: number, perPage?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksCollection>> {
3542
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listWebhooks(mailboxResourceId, status, page, perPage, options);
3543
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.listWebhooks']?.[0]?.url;
3544
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3545
+ },
3546
+ /**
3547
+ * Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
3548
+ * @summary Regenerate webhook secret
3549
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3550
+ * @param {string} webhook Webhook identifier (UUID v7).
3551
+ * @param {*} [options] Override http request option.
3552
+ * @throws {RequiredError}
3553
+ */
3554
+ async regenerateWebhookSecret(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksResourceWithSecret>> {
3555
+ const localVarAxiosArgs = await localVarAxiosParamCreator.regenerateWebhookSecret(mailboxResourceId, webhook, options);
3556
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.regenerateWebhookSecret']?.[0]?.url;
3557
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3558
+ },
3559
+ /**
3560
+ * Send a test delivery to the webhook URL and return the upstream response.
3561
+ * @summary Test webhook
3562
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3563
+ * @param {string} webhook Webhook identifier (UUID v7).
3564
+ * @param {*} [options] Override http request option.
3565
+ * @throws {RequiredError}
3566
+ */
3567
+ async testWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksTestResult>> {
3568
+ const localVarAxiosArgs = await localVarAxiosParamCreator.testWebhook(mailboxResourceId, webhook, options);
3569
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.testWebhook']?.[0]?.url;
3570
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3571
+ },
3572
+ /**
3573
+ * Partially update a webhook.
3574
+ * @summary Update webhook
3575
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3576
+ * @param {string} webhook Webhook identifier (UUID v7).
3577
+ * @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
3578
+ * @param {*} [options] Override http request option.
3579
+ * @throws {RequiredError}
3580
+ */
3581
+ async updateWebhook(mailboxResourceId: string, webhook: string, v1WebhooksUpdateRequest: V1WebhooksUpdateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<V1WebhooksResource>> {
3582
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options);
3583
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.updateWebhook']?.[0]?.url;
3584
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3585
+ },
3586
+ }
3587
+ };
3588
+
3589
+ /**
3590
+ * WebhooksApi - factory interface
3591
+ * @export
3592
+ */
3593
+ export const WebhooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
3594
+ const localVarFp = WebhooksApiFp(configuration)
3595
+ return {
3596
+ /**
3597
+ * Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
3598
+ * @summary Create webhook
3599
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3600
+ * @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
3601
+ * @param {*} [options] Override http request option.
3602
+ * @throws {RequiredError}
3603
+ */
3604
+ createWebhook(mailboxResourceId: string, v1WebhooksCreateRequest: V1WebhooksCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksResourceWithSecret> {
3605
+ return localVarFp.createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options).then((request) => request(axios, basePath));
3606
+ },
3607
+ /**
3608
+ * Delete a webhook.
3609
+ * @summary Delete webhook
3610
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3611
+ * @param {string} webhook Webhook identifier (UUID v7).
3612
+ * @param {*} [options] Override http request option.
3613
+ * @throws {RequiredError}
3614
+ */
3615
+ deleteWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
3616
+ return localVarFp.deleteWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
3617
+ },
3618
+ /**
3619
+ * Retrieve a single webhook by id.
3620
+ * @summary Get webhook
3621
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3622
+ * @param {string} webhook Webhook identifier (UUID v7).
3623
+ * @param {*} [options] Override http request option.
3624
+ * @throws {RequiredError}
3625
+ */
3626
+ getWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksResource> {
3627
+ return localVarFp.getWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
3628
+ },
3629
+ /**
3630
+ * List webhooks for a mailbox.
3631
+ * @summary List webhooks
3632
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3633
+ * @param {ListWebhooksStatusEnum} [status]
3634
+ * @param {number} [page]
3635
+ * @param {number} [perPage]
3636
+ * @param {*} [options] Override http request option.
3637
+ * @throws {RequiredError}
3638
+ */
3639
+ listWebhooks(mailboxResourceId: string, status?: ListWebhooksStatusEnum, page?: number, perPage?: number, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksCollection> {
3640
+ return localVarFp.listWebhooks(mailboxResourceId, status, page, perPage, options).then((request) => request(axios, basePath));
3641
+ },
3642
+ /**
3643
+ * Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
3644
+ * @summary Regenerate webhook secret
3645
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3646
+ * @param {string} webhook Webhook identifier (UUID v7).
3647
+ * @param {*} [options] Override http request option.
3648
+ * @throws {RequiredError}
3649
+ */
3650
+ regenerateWebhookSecret(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksResourceWithSecret> {
3651
+ return localVarFp.regenerateWebhookSecret(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
3652
+ },
3653
+ /**
3654
+ * Send a test delivery to the webhook URL and return the upstream response.
3655
+ * @summary Test webhook
3656
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3657
+ * @param {string} webhook Webhook identifier (UUID v7).
3658
+ * @param {*} [options] Override http request option.
3659
+ * @throws {RequiredError}
3660
+ */
3661
+ testWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksTestResult> {
3662
+ return localVarFp.testWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
3663
+ },
3664
+ /**
3665
+ * Partially update a webhook.
3666
+ * @summary Update webhook
3667
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3668
+ * @param {string} webhook Webhook identifier (UUID v7).
3669
+ * @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
3670
+ * @param {*} [options] Override http request option.
3671
+ * @throws {RequiredError}
3672
+ */
3673
+ updateWebhook(mailboxResourceId: string, webhook: string, v1WebhooksUpdateRequest: V1WebhooksUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise<V1WebhooksResource> {
3674
+ return localVarFp.updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options).then((request) => request(axios, basePath));
3675
+ },
3676
+ };
3677
+ };
3678
+
3679
+ /**
3680
+ * WebhooksApi - object-oriented interface
3681
+ * @export
3682
+ * @class WebhooksApi
3683
+ * @extends {BaseAPI}
3684
+ */
3685
+ export class WebhooksApi extends BaseAPI {
3686
+ /**
3687
+ * Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
3688
+ * @summary Create webhook
3689
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3690
+ * @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
3691
+ * @param {*} [options] Override http request option.
3692
+ * @throws {RequiredError}
3693
+ * @memberof WebhooksApi
3694
+ */
3695
+ public createWebhook(mailboxResourceId: string, v1WebhooksCreateRequest: V1WebhooksCreateRequest, options?: RawAxiosRequestConfig) {
3696
+ return WebhooksApiFp(this.configuration).createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options).then((request) => request(this.axios, this.basePath));
3697
+ }
3698
+
3699
+ /**
3700
+ * Delete a webhook.
3701
+ * @summary Delete webhook
3702
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3703
+ * @param {string} webhook Webhook identifier (UUID v7).
3704
+ * @param {*} [options] Override http request option.
3705
+ * @throws {RequiredError}
3706
+ * @memberof WebhooksApi
3707
+ */
3708
+ public deleteWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig) {
3709
+ return WebhooksApiFp(this.configuration).deleteWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
3710
+ }
3711
+
3712
+ /**
3713
+ * Retrieve a single webhook by id.
3714
+ * @summary Get webhook
3715
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3716
+ * @param {string} webhook Webhook identifier (UUID v7).
3717
+ * @param {*} [options] Override http request option.
3718
+ * @throws {RequiredError}
3719
+ * @memberof WebhooksApi
3720
+ */
3721
+ public getWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig) {
3722
+ return WebhooksApiFp(this.configuration).getWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
3723
+ }
3724
+
3725
+ /**
3726
+ * List webhooks for a mailbox.
3727
+ * @summary List webhooks
3728
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
3729
+ * @param {ListWebhooksStatusEnum} [status]
3730
+ * @param {number} [page]
3731
+ * @param {number} [perPage]
3732
+ * @param {*} [options] Override http request option.
3733
+ * @throws {RequiredError}
3734
+ * @memberof WebhooksApi
3735
+ */
3736
+ public listWebhooks(mailboxResourceId: string, status?: ListWebhooksStatusEnum, page?: number, perPage?: number, options?: RawAxiosRequestConfig) {
3737
+ return WebhooksApiFp(this.configuration).listWebhooks(mailboxResourceId, status, page, perPage, options).then((request) => request(this.axios, this.basePath));
3738
+ }
3739
+
3740
+ /**
3741
+ * Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
3742
+ * @summary Regenerate webhook secret
3743
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3744
+ * @param {string} webhook Webhook identifier (UUID v7).
3745
+ * @param {*} [options] Override http request option.
3746
+ * @throws {RequiredError}
3747
+ * @memberof WebhooksApi
3748
+ */
3749
+ public regenerateWebhookSecret(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig) {
3750
+ return WebhooksApiFp(this.configuration).regenerateWebhookSecret(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
3751
+ }
3752
+
3753
+ /**
3754
+ * Send a test delivery to the webhook URL and return the upstream response.
3755
+ * @summary Test webhook
3756
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3757
+ * @param {string} webhook Webhook identifier (UUID v7).
3758
+ * @param {*} [options] Override http request option.
3759
+ * @throws {RequiredError}
3760
+ * @memberof WebhooksApi
3761
+ */
3762
+ public testWebhook(mailboxResourceId: string, webhook: string, options?: RawAxiosRequestConfig) {
3763
+ return WebhooksApiFp(this.configuration).testWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
3764
+ }
3765
+
3766
+ /**
3767
+ * Partially update a webhook.
3768
+ * @summary Update webhook
3769
+ * @param {string} mailboxResourceId Resource ID of the managed mailbox.
3770
+ * @param {string} webhook Webhook identifier (UUID v7).
3771
+ * @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
3772
+ * @param {*} [options] Override http request option.
3773
+ * @throws {RequiredError}
3774
+ * @memberof WebhooksApi
3775
+ */
3776
+ public updateWebhook(mailboxResourceId: string, webhook: string, v1WebhooksUpdateRequest: V1WebhooksUpdateRequest, options?: RawAxiosRequestConfig) {
3777
+ return WebhooksApiFp(this.configuration).updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options).then((request) => request(this.axios, this.basePath));
3778
+ }
3779
+ }
3780
+
3781
+ /**
3782
+ * @export
3783
+ */
3784
+ export const ListWebhooksStatusEnum = {
3785
+ Active: 'active',
3786
+ Paused: 'paused',
3787
+ Disabled: 'disabled'
3788
+ } as const;
3789
+ export type ListWebhooksStatusEnum = typeof ListWebhooksStatusEnum[keyof typeof ListWebhooksStatusEnum];
3790
+
3791
+