agentmail 0.0.58 → 0.0.66

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 (224) hide show
  1. package/dist/cjs/Client.d.ts +2 -2
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/domains/client/Client.d.ts +7 -7
  4. package/dist/cjs/api/resources/domains/client/Client.js +69 -58
  5. package/dist/cjs/api/resources/drafts/client/Client.d.ts +3 -4
  6. package/dist/cjs/api/resources/drafts/client/Client.js +84 -71
  7. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +14 -4
  8. package/dist/cjs/api/resources/inboxes/client/Client.js +127 -54
  9. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +3 -4
  10. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +87 -74
  11. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +3 -4
  12. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +89 -76
  13. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +2 -2
  14. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +1 -1
  15. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +15 -4
  16. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +138 -61
  17. package/dist/cjs/api/resources/messages/types/Message.d.ts +5 -8
  18. package/dist/cjs/api/resources/messages/types/MessageCreatedAt.d.ts +7 -0
  19. package/dist/cjs/api/resources/messages/types/MessageCreatedAt.js +5 -0
  20. package/dist/cjs/api/resources/messages/types/MessageInReplyTo.d.ts +7 -0
  21. package/dist/cjs/api/resources/messages/types/MessageInReplyTo.js +5 -0
  22. package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +5 -0
  23. package/dist/cjs/api/resources/messages/types/MessageReferences.d.ts +7 -0
  24. package/dist/cjs/api/resources/messages/types/MessageReferences.js +5 -0
  25. package/dist/cjs/api/resources/messages/types/MessageReplyTo.d.ts +7 -0
  26. package/dist/cjs/api/resources/messages/types/MessageReplyTo.js +5 -0
  27. package/dist/cjs/api/resources/messages/types/MessageSize.d.ts +7 -0
  28. package/dist/cjs/api/resources/messages/types/MessageSize.js +5 -0
  29. package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.d.ts +7 -0
  30. package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.js +5 -0
  31. package/dist/cjs/api/resources/messages/types/index.d.ts +6 -0
  32. package/dist/cjs/api/resources/messages/types/index.js +6 -0
  33. package/dist/cjs/api/resources/metrics/client/Client.d.ts +2 -2
  34. package/dist/cjs/api/resources/metrics/client/Client.js +1 -1
  35. package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -4
  36. package/dist/cjs/api/resources/threads/client/Client.js +136 -60
  37. package/dist/cjs/api/resources/threads/types/Thread.d.ts +6 -4
  38. package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.d.ts +7 -0
  39. package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.js +5 -0
  40. package/dist/cjs/api/resources/threads/types/ThreadItem.d.ts +6 -0
  41. package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.d.ts +7 -0
  42. package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.js +5 -0
  43. package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.d.ts +7 -0
  44. package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.js +5 -0
  45. package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.d.ts +7 -0
  46. package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.js +5 -0
  47. package/dist/cjs/api/resources/threads/types/ThreadSize.d.ts +7 -0
  48. package/dist/cjs/api/resources/threads/types/ThreadSize.js +5 -0
  49. package/dist/cjs/api/resources/threads/types/ThreadTimestamp.d.ts +1 -1
  50. package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.d.ts +7 -0
  51. package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.js +5 -0
  52. package/dist/cjs/api/resources/threads/types/index.d.ts +6 -0
  53. package/dist/cjs/api/resources/threads/types/index.js +6 -0
  54. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -4
  55. package/dist/cjs/api/resources/webhooks/client/Client.js +65 -55
  56. package/dist/cjs/api/resources/websockets/client/Client.d.ts +1 -1
  57. package/dist/cjs/api/resources/websockets/client/Client.js +2 -1
  58. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
  59. package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
  60. package/dist/cjs/core/headers.d.ts +2 -2
  61. package/dist/cjs/core/index.d.ts +2 -0
  62. package/dist/cjs/core/index.js +2 -0
  63. package/dist/cjs/core/pagination/Page.d.ts +32 -0
  64. package/dist/cjs/core/pagination/Page.js +100 -0
  65. package/dist/cjs/core/pagination/Pageable.d.ts +14 -0
  66. package/dist/cjs/core/pagination/Pageable.js +10 -0
  67. package/dist/cjs/core/pagination/index.d.ts +2 -0
  68. package/dist/cjs/core/pagination/index.js +7 -0
  69. package/dist/cjs/core/utils/index.d.ts +1 -0
  70. package/dist/cjs/core/utils/index.js +5 -0
  71. package/dist/cjs/core/utils/setObjectProperty.d.ts +11 -0
  72. package/dist/cjs/core/utils/setObjectProperty.js +42 -0
  73. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  74. package/dist/cjs/serialization/resources/messages/types/Message.d.ts +10 -4
  75. package/dist/cjs/serialization/resources/messages/types/Message.js +10 -4
  76. package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.d.ts +10 -0
  77. package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.js +41 -0
  78. package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.d.ts +10 -0
  79. package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.js +41 -0
  80. package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +10 -0
  81. package/dist/cjs/serialization/resources/messages/types/MessageItem.js +10 -0
  82. package/dist/cjs/serialization/resources/messages/types/MessageReferences.d.ts +10 -0
  83. package/dist/cjs/serialization/resources/messages/types/MessageReferences.js +41 -0
  84. package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.d.ts +10 -0
  85. package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.js +41 -0
  86. package/dist/cjs/serialization/resources/messages/types/MessageSize.d.ts +10 -0
  87. package/dist/cjs/serialization/resources/messages/types/MessageSize.js +41 -0
  88. package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.d.ts +10 -0
  89. package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.js +41 -0
  90. package/dist/cjs/serialization/resources/messages/types/index.d.ts +6 -0
  91. package/dist/cjs/serialization/resources/messages/types/index.js +6 -0
  92. package/dist/cjs/serialization/resources/threads/types/Thread.d.ts +12 -2
  93. package/dist/cjs/serialization/resources/threads/types/Thread.js +12 -2
  94. package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.d.ts +10 -0
  95. package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.js +41 -0
  96. package/dist/cjs/serialization/resources/threads/types/ThreadItem.d.ts +12 -0
  97. package/dist/cjs/serialization/resources/threads/types/ThreadItem.js +12 -0
  98. package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.d.ts +10 -0
  99. package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.js +41 -0
  100. package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.d.ts +10 -0
  101. package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.js +41 -0
  102. package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.d.ts +10 -0
  103. package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.js +41 -0
  104. package/dist/cjs/serialization/resources/threads/types/ThreadSize.d.ts +10 -0
  105. package/dist/cjs/serialization/resources/threads/types/ThreadSize.js +41 -0
  106. package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.d.ts +10 -0
  107. package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.js +41 -0
  108. package/dist/cjs/serialization/resources/threads/types/index.d.ts +6 -0
  109. package/dist/cjs/serialization/resources/threads/types/index.js +6 -0
  110. package/dist/cjs/version.d.ts +1 -1
  111. package/dist/cjs/version.js +1 -1
  112. package/dist/esm/Client.d.mts +2 -2
  113. package/dist/esm/Client.mjs +2 -2
  114. package/dist/esm/api/resources/domains/client/Client.d.mts +7 -7
  115. package/dist/esm/api/resources/domains/client/Client.mjs +69 -58
  116. package/dist/esm/api/resources/drafts/client/Client.d.mts +3 -4
  117. package/dist/esm/api/resources/drafts/client/Client.mjs +84 -71
  118. package/dist/esm/api/resources/inboxes/client/Client.d.mts +14 -4
  119. package/dist/esm/api/resources/inboxes/client/Client.mjs +127 -54
  120. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +3 -4
  121. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +87 -74
  122. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +3 -4
  123. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +89 -76
  124. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +2 -2
  125. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +1 -1
  126. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +15 -4
  127. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +138 -61
  128. package/dist/esm/api/resources/messages/types/Message.d.mts +5 -8
  129. package/dist/esm/api/resources/messages/types/MessageCreatedAt.d.mts +7 -0
  130. package/dist/esm/api/resources/messages/types/MessageCreatedAt.mjs +4 -0
  131. package/dist/esm/api/resources/messages/types/MessageInReplyTo.d.mts +7 -0
  132. package/dist/esm/api/resources/messages/types/MessageInReplyTo.mjs +4 -0
  133. package/dist/esm/api/resources/messages/types/MessageItem.d.mts +5 -0
  134. package/dist/esm/api/resources/messages/types/MessageReferences.d.mts +7 -0
  135. package/dist/esm/api/resources/messages/types/MessageReferences.mjs +4 -0
  136. package/dist/esm/api/resources/messages/types/MessageReplyTo.d.mts +7 -0
  137. package/dist/esm/api/resources/messages/types/MessageReplyTo.mjs +4 -0
  138. package/dist/esm/api/resources/messages/types/MessageSize.d.mts +7 -0
  139. package/dist/esm/api/resources/messages/types/MessageSize.mjs +4 -0
  140. package/dist/esm/api/resources/messages/types/MessageUpdatedAt.d.mts +7 -0
  141. package/dist/esm/api/resources/messages/types/MessageUpdatedAt.mjs +4 -0
  142. package/dist/esm/api/resources/messages/types/index.d.mts +6 -0
  143. package/dist/esm/api/resources/messages/types/index.mjs +6 -0
  144. package/dist/esm/api/resources/metrics/client/Client.d.mts +2 -2
  145. package/dist/esm/api/resources/metrics/client/Client.mjs +1 -1
  146. package/dist/esm/api/resources/threads/client/Client.d.mts +14 -4
  147. package/dist/esm/api/resources/threads/client/Client.mjs +136 -60
  148. package/dist/esm/api/resources/threads/types/Thread.d.mts +6 -4
  149. package/dist/esm/api/resources/threads/types/ThreadCreatedAt.d.mts +7 -0
  150. package/dist/esm/api/resources/threads/types/ThreadCreatedAt.mjs +4 -0
  151. package/dist/esm/api/resources/threads/types/ThreadItem.d.mts +6 -0
  152. package/dist/esm/api/resources/threads/types/ThreadLastMessageId.d.mts +7 -0
  153. package/dist/esm/api/resources/threads/types/ThreadLastMessageId.mjs +4 -0
  154. package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.d.mts +7 -0
  155. package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.mjs +4 -0
  156. package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.d.mts +7 -0
  157. package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.mjs +4 -0
  158. package/dist/esm/api/resources/threads/types/ThreadSize.d.mts +7 -0
  159. package/dist/esm/api/resources/threads/types/ThreadSize.mjs +4 -0
  160. package/dist/esm/api/resources/threads/types/ThreadTimestamp.d.mts +1 -1
  161. package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.d.mts +7 -0
  162. package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.mjs +4 -0
  163. package/dist/esm/api/resources/threads/types/index.d.mts +6 -0
  164. package/dist/esm/api/resources/threads/types/index.mjs +6 -0
  165. package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -4
  166. package/dist/esm/api/resources/webhooks/client/Client.mjs +65 -55
  167. package/dist/esm/api/resources/websockets/client/Client.d.mts +1 -1
  168. package/dist/esm/api/resources/websockets/client/Client.mjs +2 -1
  169. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
  170. package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
  171. package/dist/esm/core/headers.d.mts +2 -2
  172. package/dist/esm/core/index.d.mts +2 -0
  173. package/dist/esm/core/index.mjs +2 -0
  174. package/dist/esm/core/pagination/Page.d.mts +32 -0
  175. package/dist/esm/core/pagination/Page.mjs +96 -0
  176. package/dist/esm/core/pagination/Pageable.d.mts +14 -0
  177. package/dist/esm/core/pagination/Pageable.mjs +6 -0
  178. package/dist/esm/core/pagination/index.d.mts +2 -0
  179. package/dist/esm/core/pagination/index.mjs +2 -0
  180. package/dist/esm/core/utils/index.d.mts +1 -0
  181. package/dist/esm/core/utils/index.mjs +1 -0
  182. package/dist/esm/core/utils/setObjectProperty.d.mts +11 -0
  183. package/dist/esm/core/utils/setObjectProperty.mjs +39 -0
  184. package/dist/esm/core/websocket/ws.d.mts +1 -1
  185. package/dist/esm/serialization/resources/messages/types/Message.d.mts +10 -4
  186. package/dist/esm/serialization/resources/messages/types/Message.mjs +10 -4
  187. package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.d.mts +10 -0
  188. package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.mjs +5 -0
  189. package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.d.mts +10 -0
  190. package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.mjs +5 -0
  191. package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +10 -0
  192. package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +10 -0
  193. package/dist/esm/serialization/resources/messages/types/MessageReferences.d.mts +10 -0
  194. package/dist/esm/serialization/resources/messages/types/MessageReferences.mjs +5 -0
  195. package/dist/esm/serialization/resources/messages/types/MessageReplyTo.d.mts +10 -0
  196. package/dist/esm/serialization/resources/messages/types/MessageReplyTo.mjs +5 -0
  197. package/dist/esm/serialization/resources/messages/types/MessageSize.d.mts +10 -0
  198. package/dist/esm/serialization/resources/messages/types/MessageSize.mjs +5 -0
  199. package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.d.mts +10 -0
  200. package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.mjs +5 -0
  201. package/dist/esm/serialization/resources/messages/types/index.d.mts +6 -0
  202. package/dist/esm/serialization/resources/messages/types/index.mjs +6 -0
  203. package/dist/esm/serialization/resources/threads/types/Thread.d.mts +12 -2
  204. package/dist/esm/serialization/resources/threads/types/Thread.mjs +12 -2
  205. package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.d.mts +10 -0
  206. package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.mjs +5 -0
  207. package/dist/esm/serialization/resources/threads/types/ThreadItem.d.mts +12 -0
  208. package/dist/esm/serialization/resources/threads/types/ThreadItem.mjs +12 -0
  209. package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.d.mts +10 -0
  210. package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.mjs +5 -0
  211. package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.d.mts +10 -0
  212. package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.mjs +5 -0
  213. package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.d.mts +10 -0
  214. package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.mjs +5 -0
  215. package/dist/esm/serialization/resources/threads/types/ThreadSize.d.mts +10 -0
  216. package/dist/esm/serialization/resources/threads/types/ThreadSize.mjs +5 -0
  217. package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.d.mts +10 -0
  218. package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.mjs +5 -0
  219. package/dist/esm/serialization/resources/threads/types/index.d.mts +6 -0
  220. package/dist/esm/serialization/resources/threads/types/index.mjs +6 -0
  221. package/dist/esm/version.d.mts +1 -1
  222. package/dist/esm/version.mjs +1 -1
  223. package/package.json +1 -1
  224. package/reference.md +404 -11
@@ -31,45 +31,131 @@ export class Threads {
31
31
  * @example
32
32
  * await client.inboxes.threads.list("inbox_id")
33
33
  */
34
- list(inboxId, request = {}, requestOptions) {
35
- return core.HttpResponsePromise.fromPromise(this.__list(inboxId, request, requestOptions));
36
- }
37
- __list(inboxId_1) {
34
+ list(inboxId_1) {
38
35
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
36
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
37
+ var _a, _b, _c;
38
+ const { limit, pageToken, labels, before, after, ascending } = request;
39
+ const _queryParams = {};
40
+ if (limit != null) {
41
+ _queryParams["limit"] = limit.toString();
42
+ }
43
+ if (pageToken != null) {
44
+ _queryParams["page_token"] = pageToken;
45
+ }
46
+ if (labels != null) {
47
+ _queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, {
48
+ unrecognizedObjectKeys: "strip",
49
+ omitUndefined: true,
50
+ }));
51
+ }
52
+ if (before != null) {
53
+ _queryParams["before"] = before.toISOString();
54
+ }
55
+ if (after != null) {
56
+ _queryParams["after"] = after.toISOString();
57
+ }
58
+ if (ascending != null) {
59
+ _queryParams["ascending"] = ascending.toString();
60
+ }
61
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
62
+ const _response = yield core.fetcher({
63
+ 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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads`),
64
+ method: "GET",
65
+ headers: _headers,
66
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
67
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
68
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
69
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
70
+ });
71
+ if (_response.ok) {
72
+ return {
73
+ data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
74
+ unrecognizedObjectKeys: "passthrough",
75
+ allowUnrecognizedUnionMembers: true,
76
+ allowUnrecognizedEnumValues: true,
77
+ skipValidation: true,
78
+ breadcrumbsPrefix: ["response"],
79
+ }),
80
+ rawResponse: _response.rawResponse,
81
+ };
82
+ }
83
+ if (_response.error.reason === "status-code") {
84
+ switch (_response.error.statusCode) {
85
+ case 404:
86
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
87
+ unrecognizedObjectKeys: "passthrough",
88
+ allowUnrecognizedUnionMembers: true,
89
+ allowUnrecognizedEnumValues: true,
90
+ skipValidation: true,
91
+ breadcrumbsPrefix: ["response"],
92
+ }), _response.rawResponse);
93
+ default:
94
+ throw new errors.AgentMailError({
95
+ statusCode: _response.error.statusCode,
96
+ body: _response.error.body,
97
+ rawResponse: _response.rawResponse,
98
+ });
99
+ }
100
+ }
101
+ switch (_response.error.reason) {
102
+ case "non-json":
103
+ throw new errors.AgentMailError({
104
+ statusCode: _response.error.statusCode,
105
+ body: _response.error.rawBody,
106
+ rawResponse: _response.rawResponse,
107
+ });
108
+ case "timeout":
109
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads.");
110
+ case "unknown":
111
+ throw new errors.AgentMailError({
112
+ message: _response.error.errorMessage,
113
+ rawResponse: _response.rawResponse,
114
+ });
115
+ }
116
+ }));
117
+ const dataWithRawResponse = yield list(request).withRawResponse();
118
+ return new core.Pageable({
119
+ response: dataWithRawResponse.data,
120
+ rawResponse: dataWithRawResponse.rawResponse,
121
+ hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
122
+ !(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
123
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.threads) !== null && _a !== void 0 ? _a : []; },
124
+ loadPage: (response) => {
125
+ return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
126
+ },
127
+ });
128
+ });
129
+ }
130
+ /**
131
+ * @param {AgentMail.inboxes.InboxId} inboxId
132
+ * @param {AgentMail.ThreadId} threadId
133
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
134
+ *
135
+ * @throws {@link AgentMail.NotFoundError}
136
+ *
137
+ * @example
138
+ * await client.inboxes.threads.get("inbox_id", "thread_id")
139
+ */
140
+ get(inboxId, threadId, requestOptions) {
141
+ return core.HttpResponsePromise.fromPromise(this.__get(inboxId, threadId, requestOptions));
142
+ }
143
+ __get(inboxId, threadId, requestOptions) {
144
+ return __awaiter(this, void 0, void 0, function* () {
39
145
  var _a, _b, _c;
40
- const { limit, pageToken, labels, before, after, ascending } = request;
41
- const _queryParams = {};
42
- if (limit != null) {
43
- _queryParams["limit"] = limit.toString();
44
- }
45
- if (pageToken != null) {
46
- _queryParams["page_token"] = pageToken;
47
- }
48
- if (labels != null) {
49
- _queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
50
- }
51
- if (before != null) {
52
- _queryParams["before"] = before.toISOString();
53
- }
54
- if (after != null) {
55
- _queryParams["after"] = after.toISOString();
56
- }
57
- if (ascending != null) {
58
- _queryParams["ascending"] = ascending.toString();
59
- }
60
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
146
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
61
147
  const _response = yield core.fetcher({
62
- 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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads`),
148
+ 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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
63
149
  method: "GET",
64
150
  headers: _headers,
65
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
151
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
66
152
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
67
153
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
68
154
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
69
155
  });
70
156
  if (_response.ok) {
71
157
  return {
72
- data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
158
+ data: serializers.Thread.parseOrThrow(_response.body, {
73
159
  unrecognizedObjectKeys: "passthrough",
74
160
  allowUnrecognizedUnionMembers: true,
75
161
  allowUnrecognizedEnumValues: true,
@@ -105,7 +191,7 @@ export class Threads {
105
191
  rawResponse: _response.rawResponse,
106
192
  });
107
193
  case "timeout":
108
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads.");
194
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads/{thread_id}.");
109
195
  case "unknown":
110
196
  throw new errors.AgentMailError({
111
197
  message: _response.error.errorMessage,
@@ -115,42 +201,27 @@ export class Threads {
115
201
  });
116
202
  }
117
203
  /**
118
- * @param {AgentMail.inboxes.InboxId} inboxId
119
- * @param {AgentMail.ThreadId} threadId
120
- * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
121
- *
122
204
  * @throws {@link AgentMail.NotFoundError}
123
- *
124
- * @example
125
- * await client.inboxes.threads.get("inbox_id", "thread_id")
126
205
  */
127
- get(inboxId, threadId, requestOptions) {
128
- return core.HttpResponsePromise.fromPromise(this.__get(inboxId, threadId, requestOptions));
206
+ getAttachment(inboxId, threadId, attachmentId, requestOptions) {
207
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(inboxId, threadId, attachmentId, requestOptions));
129
208
  }
130
- __get(inboxId, threadId, requestOptions) {
209
+ __getAttachment(inboxId, threadId, attachmentId, requestOptions) {
131
210
  return __awaiter(this, void 0, void 0, function* () {
132
211
  var _a, _b, _c;
133
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
212
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
134
213
  const _response = yield core.fetcher({
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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
214
+ 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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId, { omitUndefined: true }))}`),
136
215
  method: "GET",
137
216
  headers: _headers,
138
217
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
218
+ responseType: "binary-response",
139
219
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
140
220
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
141
221
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
142
222
  });
143
223
  if (_response.ok) {
144
- return {
145
- data: serializers.Thread.parseOrThrow(_response.body, {
146
- unrecognizedObjectKeys: "passthrough",
147
- allowUnrecognizedUnionMembers: true,
148
- allowUnrecognizedEnumValues: true,
149
- skipValidation: true,
150
- breadcrumbsPrefix: ["response"],
151
- }),
152
- rawResponse: _response.rawResponse,
153
- };
224
+ return { data: _response.body, rawResponse: _response.rawResponse };
154
225
  }
155
226
  if (_response.error.reason === "status-code") {
156
227
  switch (_response.error.statusCode) {
@@ -178,7 +249,7 @@ export class Threads {
178
249
  rawResponse: _response.rawResponse,
179
250
  });
180
251
  case "timeout":
181
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads/{thread_id}.");
252
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}.");
182
253
  case "unknown":
183
254
  throw new errors.AgentMailError({
184
255
  message: _response.error.errorMessage,
@@ -188,27 +259,33 @@ export class Threads {
188
259
  });
189
260
  }
190
261
  /**
262
+ * @param {AgentMail.inboxes.InboxId} inboxId
263
+ * @param {AgentMail.ThreadId} threadId
264
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
265
+ *
191
266
  * @throws {@link AgentMail.NotFoundError}
267
+ *
268
+ * @example
269
+ * await client.inboxes.threads.delete("inbox_id", "thread_id")
192
270
  */
193
- getAttachment(inboxId, threadId, attachmentId, requestOptions) {
194
- return core.HttpResponsePromise.fromPromise(this.__getAttachment(inboxId, threadId, attachmentId, requestOptions));
271
+ delete(inboxId, threadId, requestOptions) {
272
+ return core.HttpResponsePromise.fromPromise(this.__delete(inboxId, threadId, requestOptions));
195
273
  }
196
- __getAttachment(inboxId, threadId, attachmentId, requestOptions) {
274
+ __delete(inboxId, threadId, requestOptions) {
197
275
  return __awaiter(this, void 0, void 0, function* () {
198
276
  var _a, _b, _c;
199
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
200
278
  const _response = yield core.fetcher({
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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId, { omitUndefined: true }))}`),
202
- method: "GET",
279
+ 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.Production).http, `/v0/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
280
+ method: "DELETE",
203
281
  headers: _headers,
204
282
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
205
- responseType: "binary-response",
206
283
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
207
284
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
208
285
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
209
286
  });
210
287
  if (_response.ok) {
211
- return { data: _response.body, rawResponse: _response.rawResponse };
288
+ return { data: undefined, rawResponse: _response.rawResponse };
212
289
  }
213
290
  if (_response.error.reason === "status-code") {
214
291
  switch (_response.error.statusCode) {
@@ -236,7 +313,7 @@ export class Threads {
236
313
  rawResponse: _response.rawResponse,
237
314
  });
238
315
  case "timeout":
239
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}.");
316
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/inboxes/{inbox_id}/threads/{thread_id}.");
240
317
  case "unknown":
241
318
  throw new errors.AgentMailError({
242
319
  message: _response.error.errorMessage,
@@ -19,12 +19,9 @@ export interface Message {
19
19
  text?: AgentMail.MessageText;
20
20
  html?: AgentMail.MessageHtml;
21
21
  attachments?: AgentMail.MessageAttachments;
22
- /** ID of message being replied to. */
23
- inReplyTo?: string;
24
- /** IDs of previous messages in thread. */
25
- references?: string[];
26
- /** Time at which message was last updated. */
27
- updatedAt: Date;
28
- /** Time at which message was created. */
29
- createdAt: Date;
22
+ inReplyTo?: AgentMail.MessageInReplyTo;
23
+ references?: AgentMail.MessageReferences;
24
+ size: AgentMail.MessageSize;
25
+ updatedAt: AgentMail.MessageUpdatedAt;
26
+ createdAt: AgentMail.MessageCreatedAt;
30
27
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which message was created.
6
+ */
7
+ export type MessageCreatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of message being replied to.
6
+ */
7
+ export type MessageInReplyTo = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -15,4 +15,9 @@ export interface MessageItem {
15
15
  subject?: AgentMail.MessageSubject;
16
16
  preview?: AgentMail.MessagePreview;
17
17
  attachments?: AgentMail.MessageAttachments;
18
+ inReplyTo?: AgentMail.MessageInReplyTo;
19
+ references?: AgentMail.MessageReferences;
20
+ size: AgentMail.MessageSize;
21
+ updatedAt: AgentMail.MessageUpdatedAt;
22
+ createdAt: AgentMail.MessageCreatedAt;
18
23
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * IDs of previous messages in thread.
6
+ */
7
+ export type MessageReferences = string[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Addresses of reply-to recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
6
+ */
7
+ export type MessageReplyTo = string[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Size of message in bytes.
6
+ */
7
+ export type MessageSize = number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which message was last updated.
6
+ */
7
+ export type MessageUpdatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -2,6 +2,7 @@ export * from "./MessageId.mjs";
2
2
  export * from "./MessageLabels.mjs";
3
3
  export * from "./MessageTimestamp.mjs";
4
4
  export * from "./MessageFrom.mjs";
5
+ export * from "./MessageReplyTo.mjs";
5
6
  export * from "./MessageTo.mjs";
6
7
  export * from "./MessageCc.mjs";
7
8
  export * from "./MessageBcc.mjs";
@@ -10,6 +11,11 @@ export * from "./MessagePreview.mjs";
10
11
  export * from "./MessageText.mjs";
11
12
  export * from "./MessageHtml.mjs";
12
13
  export * from "./MessageAttachments.mjs";
14
+ export * from "./MessageInReplyTo.mjs";
15
+ export * from "./MessageReferences.mjs";
16
+ export * from "./MessageSize.mjs";
17
+ export * from "./MessageUpdatedAt.mjs";
18
+ export * from "./MessageCreatedAt.mjs";
13
19
  export * from "./MessageItem.mjs";
14
20
  export * from "./Message.mjs";
15
21
  export * from "./ListMessagesResponse.mjs";
@@ -2,6 +2,7 @@ export * from "./MessageId.mjs";
2
2
  export * from "./MessageLabels.mjs";
3
3
  export * from "./MessageTimestamp.mjs";
4
4
  export * from "./MessageFrom.mjs";
5
+ export * from "./MessageReplyTo.mjs";
5
6
  export * from "./MessageTo.mjs";
6
7
  export * from "./MessageCc.mjs";
7
8
  export * from "./MessageBcc.mjs";
@@ -10,6 +11,11 @@ export * from "./MessagePreview.mjs";
10
11
  export * from "./MessageText.mjs";
11
12
  export * from "./MessageHtml.mjs";
12
13
  export * from "./MessageAttachments.mjs";
14
+ export * from "./MessageInReplyTo.mjs";
15
+ export * from "./MessageReferences.mjs";
16
+ export * from "./MessageSize.mjs";
17
+ export * from "./MessageUpdatedAt.mjs";
18
+ export * from "./MessageCreatedAt.mjs";
13
19
  export * from "./MessageItem.mjs";
14
20
  export * from "./Message.mjs";
15
21
  export * from "./ListMessagesResponse.mjs";
@@ -11,7 +11,7 @@ export declare namespace Metrics {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  }
16
16
  interface RequestOptions {
17
17
  /** The maximum time to wait for a response in seconds. */
@@ -23,7 +23,7 @@ export declare namespace Metrics {
23
23
  /** Additional query string parameters to include in the request. */
24
24
  queryParams?: Record<string, unknown>;
25
25
  /** Additional headers to include in the request. */
26
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
26
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
27
27
  }
28
28
  }
29
29
  export declare class Metrics {
@@ -49,7 +49,7 @@ export class Metrics {
49
49
  }
50
50
  _queryParams["start_timestamp"] = startTimestamp.toISOString();
51
51
  _queryParams["end_timestamp"] = endTimestamp.toISOString();
52
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
52
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
53
53
  const _response = yield core.fetcher({
54
54
  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.Production).http, "/v0/metrics"),
55
55
  method: "GET",
@@ -11,7 +11,7 @@ export declare namespace Threads {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  }
16
16
  interface RequestOptions {
17
17
  /** The maximum time to wait for a response in seconds. */
@@ -23,7 +23,7 @@ export declare namespace Threads {
23
23
  /** Additional query string parameters to include in the request. */
24
24
  queryParams?: Record<string, unknown>;
25
25
  /** Additional headers to include in the request. */
26
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
26
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
27
27
  }
28
28
  }
29
29
  export declare class Threads {
@@ -38,8 +38,7 @@ export declare class Threads {
38
38
  * @example
39
39
  * await client.threads.list()
40
40
  */
41
- list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<AgentMail.ListThreadsResponse>;
42
- private __list;
41
+ list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem>>;
43
42
  /**
44
43
  * @param {AgentMail.ThreadId} threadId
45
44
  * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
@@ -56,5 +55,16 @@ export declare class Threads {
56
55
  */
57
56
  getAttachment(threadId: AgentMail.ThreadId, attachmentId: AgentMail.AttachmentId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
58
57
  private __getAttachment;
58
+ /**
59
+ * @param {AgentMail.ThreadId} threadId
60
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link AgentMail.NotFoundError}
63
+ *
64
+ * @example
65
+ * await client.threads.delete("thread_id")
66
+ */
67
+ delete(threadId: AgentMail.ThreadId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<void>;
68
+ private __delete;
59
69
  protected _getAuthorizationHeader(): Promise<string>;
60
70
  }