agentmail 0.4.3 → 0.4.4

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 (102) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/domains/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/domains/client/Client.js +69 -0
  4. package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +4 -0
  5. package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.js +3 -0
  6. package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/domains/types/index.js +1 -0
  8. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +9 -9
  9. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +50 -50
  10. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +22 -15
  11. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +71 -56
  12. package/dist/cjs/api/resources/lists/client/Client.d.ts +15 -15
  13. package/dist/cjs/api/resources/lists/client/Client.js +67 -67
  14. package/dist/cjs/api/resources/messages/types/RawMessageResponse.d.ts +14 -0
  15. package/dist/cjs/api/resources/messages/types/RawMessageResponse.js +3 -0
  16. package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/messages/types/index.js +1 -0
  18. package/dist/cjs/api/resources/pods/client/Client.d.ts +4 -4
  19. package/dist/cjs/api/resources/pods/client/Client.js +8 -8
  20. package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +11 -11
  21. package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +42 -42
  22. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +33 -3
  23. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +178 -6
  24. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +15 -0
  25. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +72 -0
  26. package/dist/cjs/api/resources/pods/resources/lists/client/Client.d.ts +16 -16
  27. package/dist/cjs/api/resources/pods/resources/lists/client/Client.js +67 -67
  28. package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +15 -0
  29. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +61 -0
  30. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
  31. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
  32. package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -0
  34. package/dist/cjs/api/resources/threads/client/Client.js +60 -0
  35. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
  36. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
  37. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +13 -13
  39. package/dist/cjs/api/resources/webhooks/client/Client.js +31 -31
  40. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +10 -0
  41. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +42 -0
  42. package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
  43. package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
  44. package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.d.ts +14 -0
  45. package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.js +46 -0
  46. package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
  47. package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
  48. package/dist/cjs/version.d.ts +1 -1
  49. package/dist/cjs/version.js +1 -1
  50. package/dist/esm/BaseClient.mjs +2 -2
  51. package/dist/esm/api/resources/domains/client/Client.d.mts +12 -0
  52. package/dist/esm/api/resources/domains/client/Client.mjs +69 -0
  53. package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +4 -0
  54. package/dist/esm/api/resources/domains/types/UpdateDomainRequest.mjs +2 -0
  55. package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
  56. package/dist/esm/api/resources/domains/types/index.mjs +1 -0
  57. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +9 -9
  58. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +50 -50
  59. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +22 -15
  60. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +71 -56
  61. package/dist/esm/api/resources/lists/client/Client.d.mts +15 -15
  62. package/dist/esm/api/resources/lists/client/Client.mjs +67 -67
  63. package/dist/esm/api/resources/messages/types/RawMessageResponse.d.mts +14 -0
  64. package/dist/esm/api/resources/messages/types/RawMessageResponse.mjs +2 -0
  65. package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
  66. package/dist/esm/api/resources/messages/types/index.mjs +1 -0
  67. package/dist/esm/api/resources/pods/client/Client.d.mts +4 -4
  68. package/dist/esm/api/resources/pods/client/Client.mjs +8 -8
  69. package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +11 -11
  70. package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +42 -42
  71. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +33 -3
  72. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +178 -6
  73. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +15 -0
  74. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +72 -0
  75. package/dist/esm/api/resources/pods/resources/lists/client/Client.d.mts +16 -16
  76. package/dist/esm/api/resources/pods/resources/lists/client/Client.mjs +67 -67
  77. package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +15 -0
  78. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +61 -0
  79. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
  80. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
  81. package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +1 -0
  82. package/dist/esm/api/resources/threads/client/Client.d.mts +14 -0
  83. package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
  84. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
  85. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
  86. package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
  87. package/dist/esm/api/resources/webhooks/client/Client.d.mts +13 -13
  88. package/dist/esm/api/resources/webhooks/client/Client.mjs +31 -31
  89. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +10 -0
  90. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +6 -0
  91. package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
  92. package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
  93. package/dist/esm/serialization/resources/messages/types/RawMessageResponse.d.mts +14 -0
  94. package/dist/esm/serialization/resources/messages/types/RawMessageResponse.mjs +10 -0
  95. package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
  96. package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
  97. package/dist/esm/version.d.mts +1 -1
  98. package/dist/esm/version.mjs +1 -1
  99. package/dist/llms-full.txt +16825 -11774
  100. package/dist/llms.txt +94 -25
  101. package/package.json +1 -1
  102. package/reference.md +570 -117
@@ -269,7 +269,14 @@ class MessagesClient {
269
269
  });
270
270
  }
271
271
  /**
272
+ * @param {AgentMail.inboxes.InboxId} inbox_id
273
+ * @param {AgentMail.MessageId} message_id
274
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
275
+ *
272
276
  * @throws {@link AgentMail.NotFoundError}
277
+ *
278
+ * @example
279
+ * await client.inboxes.messages.getRaw("inbox_id", "message_id")
273
280
  */
274
281
  getRaw(inbox_id, message_id, requestOptions) {
275
282
  return core.HttpResponsePromise.fromPromise(this.__getRaw(inbox_id, message_id, requestOptions));
@@ -285,7 +292,6 @@ class MessagesClient {
285
292
  method: "GET",
286
293
  headers: _headers,
287
294
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
288
- responseType: "binary-response",
289
295
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
290
296
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
291
297
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -293,7 +299,16 @@ class MessagesClient {
293
299
  logging: this._options.logging,
294
300
  });
295
301
  if (_response.ok) {
296
- return { data: _response.body, rawResponse: _response.rawResponse };
302
+ return {
303
+ data: serializers.RawMessageResponse.parseOrThrow(_response.body, {
304
+ unrecognizedObjectKeys: "passthrough",
305
+ allowUnrecognizedUnionMembers: true,
306
+ allowUnrecognizedEnumValues: true,
307
+ skipValidation: true,
308
+ breadcrumbsPrefix: ["response"],
309
+ }),
310
+ rawResponse: _response.rawResponse,
311
+ };
297
312
  }
298
313
  if (_response.error.reason === "status-code") {
299
314
  switch (_response.error.statusCode) {
@@ -318,33 +333,33 @@ class MessagesClient {
318
333
  }
319
334
  /**
320
335
  * @param {AgentMail.inboxes.InboxId} inbox_id
321
- * @param {AgentMail.SendMessageRequest} request
336
+ * @param {AgentMail.MessageId} message_id
337
+ * @param {AgentMail.UpdateMessageRequest} request
322
338
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
323
339
  *
324
340
  * @throws {@link AgentMail.ValidationError}
325
341
  * @throws {@link AgentMail.NotFoundError}
326
- * @throws {@link AgentMail.MessageRejectedError}
327
342
  *
328
343
  * @example
329
- * await client.inboxes.messages.send("inbox_id", {})
344
+ * await client.inboxes.messages.update("inbox_id", "message_id", {})
330
345
  */
331
- send(inbox_id, request, requestOptions) {
332
- return core.HttpResponsePromise.fromPromise(this.__send(inbox_id, request, requestOptions));
346
+ update(inbox_id, message_id, request, requestOptions) {
347
+ return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, message_id, request, requestOptions));
333
348
  }
334
- __send(inbox_id, request, requestOptions) {
349
+ __update(inbox_id, message_id, request, requestOptions) {
335
350
  return __awaiter(this, void 0, void 0, function* () {
336
351
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
337
352
  const _authRequest = yield this._options.authProvider.getAuthRequest();
338
353
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
339
354
  const _response = yield core.fetcher({
340
355
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
341
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/send`),
342
- method: "POST",
356
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
357
+ method: "PATCH",
343
358
  headers: _headers,
344
359
  contentType: "application/json",
345
360
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
346
361
  requestType: "json",
347
- body: serializers.SendMessageRequest.jsonOrThrow(request, {
362
+ body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
348
363
  unrecognizedObjectKeys: "strip",
349
364
  omitUndefined: true,
350
365
  }),
@@ -356,7 +371,7 @@ class MessagesClient {
356
371
  });
357
372
  if (_response.ok) {
358
373
  return {
359
- data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
374
+ data: serializers.Message.parseOrThrow(_response.body, {
360
375
  unrecognizedObjectKeys: "passthrough",
361
376
  allowUnrecognizedUnionMembers: true,
362
377
  allowUnrecognizedEnumValues: true,
@@ -384,14 +399,6 @@ class MessagesClient {
384
399
  skipValidation: true,
385
400
  breadcrumbsPrefix: ["response"],
386
401
  }), _response.rawResponse);
387
- case 403:
388
- throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
389
- unrecognizedObjectKeys: "passthrough",
390
- allowUnrecognizedUnionMembers: true,
391
- allowUnrecognizedEnumValues: true,
392
- skipValidation: true,
393
- breadcrumbsPrefix: ["response"],
394
- }), _response.rawResponse);
395
402
  default:
396
403
  throw new errors.AgentMailError({
397
404
  statusCode: _response.error.statusCode,
@@ -400,13 +407,12 @@ class MessagesClient {
400
407
  });
401
408
  }
402
409
  }
403
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/send");
410
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/messages/{message_id}");
404
411
  });
405
412
  }
406
413
  /**
407
414
  * @param {AgentMail.inboxes.InboxId} inbox_id
408
- * @param {AgentMail.MessageId} message_id
409
- * @param {AgentMail.ReplyToMessageRequest} request
415
+ * @param {AgentMail.SendMessageRequest} request
410
416
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
411
417
  *
412
418
  * @throws {@link AgentMail.ValidationError}
@@ -414,25 +420,25 @@ class MessagesClient {
414
420
  * @throws {@link AgentMail.MessageRejectedError}
415
421
  *
416
422
  * @example
417
- * await client.inboxes.messages.reply("inbox_id", "message_id", {})
423
+ * await client.inboxes.messages.send("inbox_id", {})
418
424
  */
419
- reply(inbox_id, message_id, request, requestOptions) {
420
- return core.HttpResponsePromise.fromPromise(this.__reply(inbox_id, message_id, request, requestOptions));
425
+ send(inbox_id, request, requestOptions) {
426
+ return core.HttpResponsePromise.fromPromise(this.__send(inbox_id, request, requestOptions));
421
427
  }
422
- __reply(inbox_id, message_id, request, requestOptions) {
428
+ __send(inbox_id, request, requestOptions) {
423
429
  return __awaiter(this, void 0, void 0, function* () {
424
430
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
425
431
  const _authRequest = yield this._options.authProvider.getAuthRequest();
426
432
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
427
433
  const _response = yield core.fetcher({
428
434
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
429
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply`),
435
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/send`),
430
436
  method: "POST",
431
437
  headers: _headers,
432
438
  contentType: "application/json",
433
439
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
434
440
  requestType: "json",
435
- body: serializers.ReplyToMessageRequest.jsonOrThrow(request, {
441
+ body: serializers.SendMessageRequest.jsonOrThrow(request, {
436
442
  unrecognizedObjectKeys: "strip",
437
443
  omitUndefined: true,
438
444
  }),
@@ -488,13 +494,13 @@ class MessagesClient {
488
494
  });
489
495
  }
490
496
  }
491
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply");
497
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/send");
492
498
  });
493
499
  }
494
500
  /**
495
501
  * @param {AgentMail.inboxes.InboxId} inbox_id
496
502
  * @param {AgentMail.MessageId} message_id
497
- * @param {AgentMail.ReplyAllMessageRequest} request
503
+ * @param {AgentMail.ReplyToMessageRequest} request
498
504
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
499
505
  *
500
506
  * @throws {@link AgentMail.ValidationError}
@@ -502,25 +508,25 @@ class MessagesClient {
502
508
  * @throws {@link AgentMail.MessageRejectedError}
503
509
  *
504
510
  * @example
505
- * await client.inboxes.messages.replyAll("inbox_id", "message_id", {})
511
+ * await client.inboxes.messages.reply("inbox_id", "message_id", {})
506
512
  */
507
- replyAll(inbox_id, message_id, request, requestOptions) {
508
- return core.HttpResponsePromise.fromPromise(this.__replyAll(inbox_id, message_id, request, requestOptions));
513
+ reply(inbox_id, message_id, request, requestOptions) {
514
+ return core.HttpResponsePromise.fromPromise(this.__reply(inbox_id, message_id, request, requestOptions));
509
515
  }
510
- __replyAll(inbox_id, message_id, request, requestOptions) {
516
+ __reply(inbox_id, message_id, request, requestOptions) {
511
517
  return __awaiter(this, void 0, void 0, function* () {
512
518
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
513
519
  const _authRequest = yield this._options.authProvider.getAuthRequest();
514
520
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
515
521
  const _response = yield core.fetcher({
516
522
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
517
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply-all`),
523
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply`),
518
524
  method: "POST",
519
525
  headers: _headers,
520
526
  contentType: "application/json",
521
527
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
522
528
  requestType: "json",
523
- body: serializers.ReplyAllMessageRequest.jsonOrThrow(request, {
529
+ body: serializers.ReplyToMessageRequest.jsonOrThrow(request, {
524
530
  unrecognizedObjectKeys: "strip",
525
531
  omitUndefined: true,
526
532
  }),
@@ -576,13 +582,13 @@ class MessagesClient {
576
582
  });
577
583
  }
578
584
  }
579
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all");
585
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply");
580
586
  });
581
587
  }
582
588
  /**
583
589
  * @param {AgentMail.inboxes.InboxId} inbox_id
584
590
  * @param {AgentMail.MessageId} message_id
585
- * @param {AgentMail.SendMessageRequest} request
591
+ * @param {AgentMail.ReplyAllMessageRequest} request
586
592
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
587
593
  *
588
594
  * @throws {@link AgentMail.ValidationError}
@@ -590,25 +596,25 @@ class MessagesClient {
590
596
  * @throws {@link AgentMail.MessageRejectedError}
591
597
  *
592
598
  * @example
593
- * await client.inboxes.messages.forward("inbox_id", "message_id", {})
599
+ * await client.inboxes.messages.replyAll("inbox_id", "message_id", {})
594
600
  */
595
- forward(inbox_id, message_id, request, requestOptions) {
596
- return core.HttpResponsePromise.fromPromise(this.__forward(inbox_id, message_id, request, requestOptions));
601
+ replyAll(inbox_id, message_id, request, requestOptions) {
602
+ return core.HttpResponsePromise.fromPromise(this.__replyAll(inbox_id, message_id, request, requestOptions));
597
603
  }
598
- __forward(inbox_id, message_id, request, requestOptions) {
604
+ __replyAll(inbox_id, message_id, request, requestOptions) {
599
605
  return __awaiter(this, void 0, void 0, function* () {
600
606
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
601
607
  const _authRequest = yield this._options.authProvider.getAuthRequest();
602
608
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
603
609
  const _response = yield core.fetcher({
604
610
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
605
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
611
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply-all`),
606
612
  method: "POST",
607
613
  headers: _headers,
608
614
  contentType: "application/json",
609
615
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
610
616
  requestType: "json",
611
- body: serializers.SendMessageRequest.jsonOrThrow(request, {
617
+ body: serializers.ReplyAllMessageRequest.jsonOrThrow(request, {
612
618
  unrecognizedObjectKeys: "strip",
613
619
  omitUndefined: true,
614
620
  }),
@@ -664,38 +670,39 @@ class MessagesClient {
664
670
  });
665
671
  }
666
672
  }
667
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
673
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all");
668
674
  });
669
675
  }
670
676
  /**
671
677
  * @param {AgentMail.inboxes.InboxId} inbox_id
672
678
  * @param {AgentMail.MessageId} message_id
673
- * @param {AgentMail.UpdateMessageRequest} request
679
+ * @param {AgentMail.SendMessageRequest} request
674
680
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
675
681
  *
676
682
  * @throws {@link AgentMail.ValidationError}
677
683
  * @throws {@link AgentMail.NotFoundError}
684
+ * @throws {@link AgentMail.MessageRejectedError}
678
685
  *
679
686
  * @example
680
- * await client.inboxes.messages.update("inbox_id", "message_id", {})
687
+ * await client.inboxes.messages.forward("inbox_id", "message_id", {})
681
688
  */
682
- update(inbox_id, message_id, request, requestOptions) {
683
- return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, message_id, request, requestOptions));
689
+ forward(inbox_id, message_id, request, requestOptions) {
690
+ return core.HttpResponsePromise.fromPromise(this.__forward(inbox_id, message_id, request, requestOptions));
684
691
  }
685
- __update(inbox_id, message_id, request, requestOptions) {
692
+ __forward(inbox_id, message_id, request, requestOptions) {
686
693
  return __awaiter(this, void 0, void 0, function* () {
687
694
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
688
695
  const _authRequest = yield this._options.authProvider.getAuthRequest();
689
696
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
690
697
  const _response = yield core.fetcher({
691
698
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
692
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
693
- method: "PATCH",
699
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
700
+ method: "POST",
694
701
  headers: _headers,
695
702
  contentType: "application/json",
696
703
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
697
704
  requestType: "json",
698
- body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
705
+ body: serializers.SendMessageRequest.jsonOrThrow(request, {
699
706
  unrecognizedObjectKeys: "strip",
700
707
  omitUndefined: true,
701
708
  }),
@@ -707,7 +714,7 @@ class MessagesClient {
707
714
  });
708
715
  if (_response.ok) {
709
716
  return {
710
- data: serializers.Message.parseOrThrow(_response.body, {
717
+ data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
711
718
  unrecognizedObjectKeys: "passthrough",
712
719
  allowUnrecognizedUnionMembers: true,
713
720
  allowUnrecognizedEnumValues: true,
@@ -735,6 +742,14 @@ class MessagesClient {
735
742
  skipValidation: true,
736
743
  breadcrumbsPrefix: ["response"],
737
744
  }), _response.rawResponse);
745
+ case 403:
746
+ throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
747
+ unrecognizedObjectKeys: "passthrough",
748
+ allowUnrecognizedUnionMembers: true,
749
+ allowUnrecognizedEnumValues: true,
750
+ skipValidation: true,
751
+ breadcrumbsPrefix: ["response"],
752
+ }), _response.rawResponse);
738
753
  default:
739
754
  throw new errors.AgentMailError({
740
755
  statusCode: _response.error.statusCode,
@@ -743,7 +758,7 @@ class MessagesClient {
743
758
  });
744
759
  }
745
760
  }
746
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/messages/{message_id}");
761
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
747
762
  });
748
763
  }
749
764
  }
@@ -10,21 +10,6 @@ export declare namespace ListsClient {
10
10
  export declare class ListsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<ListsClient.Options>;
12
12
  constructor(options?: ListsClient.Options);
13
- /**
14
- * @param {AgentMail.Direction} direction
15
- * @param {AgentMail.ListType} type
16
- * @param {AgentMail.CreateListEntryRequest} request
17
- * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
18
- *
19
- * @throws {@link AgentMail.ValidationError}
20
- *
21
- * @example
22
- * await client.lists.create("send", "allow", {
23
- * entry: "entry"
24
- * })
25
- */
26
- create(direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
27
- private __create;
28
13
  /**
29
14
  * @param {AgentMail.Direction} direction
30
15
  * @param {AgentMail.ListType} type
@@ -49,6 +34,21 @@ export declare class ListsClient {
49
34
  */
50
35
  get(direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
51
36
  private __get;
37
+ /**
38
+ * @param {AgentMail.Direction} direction
39
+ * @param {AgentMail.ListType} type
40
+ * @param {AgentMail.CreateListEntryRequest} request
41
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link AgentMail.ValidationError}
44
+ *
45
+ * @example
46
+ * await client.lists.create("send", "allow", {
47
+ * entry: "entry"
48
+ * })
49
+ */
50
+ create(direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
51
+ private __create;
52
52
  /**
53
53
  * @param {AgentMail.Direction} direction
54
54
  * @param {AgentMail.ListType} type
@@ -59,36 +59,31 @@ class ListsClient {
59
59
  /**
60
60
  * @param {AgentMail.Direction} direction
61
61
  * @param {AgentMail.ListType} type
62
- * @param {AgentMail.CreateListEntryRequest} request
62
+ * @param {AgentMail.ListListEntriesRequest} request
63
63
  * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
64
64
  *
65
- * @throws {@link AgentMail.ValidationError}
66
- *
67
65
  * @example
68
- * await client.lists.create("send", "allow", {
69
- * entry: "entry"
70
- * })
66
+ * await client.lists.list("send", "allow")
71
67
  */
72
- create(direction, type, request, requestOptions) {
73
- return core.HttpResponsePromise.fromPromise(this.__create(direction, type, request, requestOptions));
68
+ list(direction, type, request = {}, requestOptions) {
69
+ return core.HttpResponsePromise.fromPromise(this.__list(direction, type, request, requestOptions));
74
70
  }
75
- __create(direction, type, request, requestOptions) {
76
- return __awaiter(this, void 0, void 0, function* () {
71
+ __list(direction_1, type_1) {
72
+ return __awaiter(this, arguments, void 0, function* (direction, type, request = {}, requestOptions) {
77
73
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
74
+ const { limit, pageToken } = request;
75
+ const _queryParams = {
76
+ limit,
77
+ page_token: pageToken,
78
+ };
78
79
  const _authRequest = yield this._options.authProvider.getAuthRequest();
79
80
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
81
  const _response = yield core.fetcher({
81
82
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
82
83
  .http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
83
- method: "POST",
84
+ method: "GET",
84
85
  headers: _headers,
85
- contentType: "application/json",
86
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
87
- requestType: "json",
88
- body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
89
- unrecognizedObjectKeys: "strip",
90
- omitUndefined: true,
91
- }),
86
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
92
87
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
93
88
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
94
89
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -97,7 +92,7 @@ class ListsClient {
97
92
  });
98
93
  if (_response.ok) {
99
94
  return {
100
- data: serializers.ListEntry.parseOrThrow(_response.body, {
95
+ data: serializers.ListListEntriesResponse.parseOrThrow(_response.body, {
101
96
  unrecognizedObjectKeys: "passthrough",
102
97
  allowUnrecognizedUnionMembers: true,
103
98
  allowUnrecognizedEnumValues: true,
@@ -108,54 +103,40 @@ class ListsClient {
108
103
  };
109
104
  }
110
105
  if (_response.error.reason === "status-code") {
111
- switch (_response.error.statusCode) {
112
- case 400:
113
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
114
- unrecognizedObjectKeys: "passthrough",
115
- allowUnrecognizedUnionMembers: true,
116
- allowUnrecognizedEnumValues: true,
117
- skipValidation: true,
118
- breadcrumbsPrefix: ["response"],
119
- }), _response.rawResponse);
120
- default:
121
- throw new errors.AgentMailError({
122
- statusCode: _response.error.statusCode,
123
- body: _response.error.body,
124
- rawResponse: _response.rawResponse,
125
- });
126
- }
106
+ throw new errors.AgentMailError({
107
+ statusCode: _response.error.statusCode,
108
+ body: _response.error.body,
109
+ rawResponse: _response.rawResponse,
110
+ });
127
111
  }
128
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/lists/{direction}/{type}");
112
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}");
129
113
  });
130
114
  }
131
115
  /**
132
116
  * @param {AgentMail.Direction} direction
133
117
  * @param {AgentMail.ListType} type
134
- * @param {AgentMail.ListListEntriesRequest} request
118
+ * @param {string} entry - Email address or domain.
135
119
  * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
136
120
  *
121
+ * @throws {@link AgentMail.NotFoundError}
122
+ *
137
123
  * @example
138
- * await client.lists.list("send", "allow")
124
+ * await client.lists.get("send", "allow", "entry")
139
125
  */
140
- list(direction, type, request = {}, requestOptions) {
141
- return core.HttpResponsePromise.fromPromise(this.__list(direction, type, request, requestOptions));
126
+ get(direction, type, entry, requestOptions) {
127
+ return core.HttpResponsePromise.fromPromise(this.__get(direction, type, entry, requestOptions));
142
128
  }
143
- __list(direction_1, type_1) {
144
- return __awaiter(this, arguments, void 0, function* (direction, type, request = {}, requestOptions) {
129
+ __get(direction, type, entry, requestOptions) {
130
+ return __awaiter(this, void 0, void 0, function* () {
145
131
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
146
- const { limit, pageToken } = request;
147
- const _queryParams = {
148
- limit,
149
- page_token: pageToken,
150
- };
151
132
  const _authRequest = yield this._options.authProvider.getAuthRequest();
152
133
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
153
134
  const _response = yield core.fetcher({
154
135
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
155
- .http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
136
+ .http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
156
137
  method: "GET",
157
138
  headers: _headers,
158
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
139
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
159
140
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
160
141
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
161
142
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -164,7 +145,7 @@ class ListsClient {
164
145
  });
165
146
  if (_response.ok) {
166
147
  return {
167
- data: serializers.ListListEntriesResponse.parseOrThrow(_response.body, {
148
+ data: serializers.ListEntry.parseOrThrow(_response.body, {
168
149
  unrecognizedObjectKeys: "passthrough",
169
150
  allowUnrecognizedUnionMembers: true,
170
151
  allowUnrecognizedEnumValues: true,
@@ -175,40 +156,59 @@ class ListsClient {
175
156
  };
176
157
  }
177
158
  if (_response.error.reason === "status-code") {
178
- throw new errors.AgentMailError({
179
- statusCode: _response.error.statusCode,
180
- body: _response.error.body,
181
- rawResponse: _response.rawResponse,
182
- });
159
+ switch (_response.error.statusCode) {
160
+ case 404:
161
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
162
+ unrecognizedObjectKeys: "passthrough",
163
+ allowUnrecognizedUnionMembers: true,
164
+ allowUnrecognizedEnumValues: true,
165
+ skipValidation: true,
166
+ breadcrumbsPrefix: ["response"],
167
+ }), _response.rawResponse);
168
+ default:
169
+ throw new errors.AgentMailError({
170
+ statusCode: _response.error.statusCode,
171
+ body: _response.error.body,
172
+ rawResponse: _response.rawResponse,
173
+ });
174
+ }
183
175
  }
184
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}");
176
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}/{entry}");
185
177
  });
186
178
  }
187
179
  /**
188
180
  * @param {AgentMail.Direction} direction
189
181
  * @param {AgentMail.ListType} type
190
- * @param {string} entry - Email address or domain.
182
+ * @param {AgentMail.CreateListEntryRequest} request
191
183
  * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
192
184
  *
193
- * @throws {@link AgentMail.NotFoundError}
185
+ * @throws {@link AgentMail.ValidationError}
194
186
  *
195
187
  * @example
196
- * await client.lists.get("send", "allow", "entry")
188
+ * await client.lists.create("send", "allow", {
189
+ * entry: "entry"
190
+ * })
197
191
  */
198
- get(direction, type, entry, requestOptions) {
199
- return core.HttpResponsePromise.fromPromise(this.__get(direction, type, entry, requestOptions));
192
+ create(direction, type, request, requestOptions) {
193
+ return core.HttpResponsePromise.fromPromise(this.__create(direction, type, request, requestOptions));
200
194
  }
201
- __get(direction, type, entry, requestOptions) {
195
+ __create(direction, type, request, requestOptions) {
202
196
  return __awaiter(this, void 0, void 0, function* () {
203
197
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
204
198
  const _authRequest = yield this._options.authProvider.getAuthRequest();
205
199
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
206
200
  const _response = yield core.fetcher({
207
201
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
208
- .http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
209
- method: "GET",
202
+ .http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
203
+ method: "POST",
210
204
  headers: _headers,
205
+ contentType: "application/json",
211
206
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
207
+ requestType: "json",
208
+ body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
209
+ unrecognizedObjectKeys: "strip",
210
+ omitUndefined: true,
211
+ }),
212
212
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
213
213
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
214
214
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -229,8 +229,8 @@ class ListsClient {
229
229
  }
230
230
  if (_response.error.reason === "status-code") {
231
231
  switch (_response.error.statusCode) {
232
- case 404:
233
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
232
+ case 400:
233
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
234
234
  unrecognizedObjectKeys: "passthrough",
235
235
  allowUnrecognizedUnionMembers: true,
236
236
  allowUnrecognizedEnumValues: true,
@@ -245,7 +245,7 @@ class ListsClient {
245
245
  });
246
246
  }
247
247
  }
248
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}/{entry}");
248
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/lists/{direction}/{type}");
249
249
  });
250
250
  }
251
251
  /**
@@ -0,0 +1,14 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Signed URL to download the raw .eml file. Uses CloudFront signing, same as attachments.
4
+ */
5
+ export interface RawMessageResponse {
6
+ /** ID of the message. */
7
+ messageId: AgentMail.MessageId;
8
+ /** Size of the raw message in bytes. */
9
+ size: AgentMail.MessageSize;
10
+ /** Pre-signed CloudFront URL to download the raw message. Expires at expires_at. */
11
+ downloadUrl: string;
12
+ /** Time at which the download URL expires. */
13
+ expiresAt: Date;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });