agentmail 0.5.12 → 0.5.13

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 (205) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +21 -0
  3. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.js +3 -0
  4. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +17 -0
  5. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.js +3 -0
  6. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +22 -0
  7. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.js +3 -0
  8. package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
  9. package/dist/cjs/api/resources/drafts/types/DraftForwardOf.d.ts +4 -0
  10. package/dist/cjs/api/resources/drafts/types/DraftForwardOf.js +3 -0
  11. package/dist/cjs/api/resources/drafts/types/DraftItem.d.ts +1 -0
  12. package/dist/cjs/api/resources/drafts/types/DraftReplyAll.d.ts +4 -0
  13. package/dist/cjs/api/resources/drafts/types/DraftReplyAll.js +3 -0
  14. package/dist/cjs/api/resources/drafts/types/index.d.ts +5 -0
  15. package/dist/cjs/api/resources/drafts/types/index.js +5 -0
  16. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  17. package/dist/cjs/api/resources/inboxes/client/Client.js +5 -0
  18. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  20. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +69 -0
  21. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +264 -0
  22. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +103 -0
  23. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +411 -0
  24. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.js +17 -0
  26. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.ts +10 -0
  27. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.js +3 -0
  28. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.js +2 -0
  30. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +2 -0
  31. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +21 -0
  32. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +17 -0
  34. package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
  35. package/dist/cjs/api/resources/pods/client/Client.js +5 -0
  36. package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
  37. package/dist/cjs/api/resources/pods/resources/index.js +3 -1
  38. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +103 -0
  39. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +411 -0
  40. package/dist/cjs/api/resources/pods/resources/webhooks/client/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/pods/resources/webhooks/client/index.js +17 -0
  42. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.ts +10 -0
  43. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.js +3 -0
  44. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +2 -0
  47. package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +21 -0
  48. package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
  49. package/dist/cjs/api/resources/pods/resources/webhooks/index.js +17 -0
  50. package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +10 -0
  51. package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.js +3 -0
  52. package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.d.ts +9 -0
  53. package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.js +3 -0
  54. package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.d.ts +7 -0
  55. package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.js +3 -0
  56. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -10
  57. package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +7 -0
  58. package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.js +3 -0
  59. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +11 -0
  60. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.js +3 -0
  61. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +10 -0
  62. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.js +3 -0
  63. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequest.d.ts +1 -14
  64. package/dist/cjs/api/resources/webhooks/types/index.d.ts +6 -0
  65. package/dist/cjs/api/resources/webhooks/types/index.js +6 -0
  66. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +30 -0
  67. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.js +62 -0
  68. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +24 -0
  69. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.js +56 -0
  70. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +32 -0
  71. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +64 -0
  72. package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
  73. package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
  74. package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.d.ts +7 -0
  75. package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.js +39 -0
  76. package/dist/cjs/serialization/resources/drafts/types/DraftItem.d.ts +2 -0
  77. package/dist/cjs/serialization/resources/drafts/types/DraftItem.js +2 -0
  78. package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.d.ts +7 -0
  79. package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.js +39 -0
  80. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +5 -0
  81. package/dist/cjs/serialization/resources/drafts/types/index.js +5 -0
  82. package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +14 -0
  83. package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +46 -0
  84. package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.ts +11 -0
  85. package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.js +45 -0
  86. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.ts +8 -0
  87. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.js +6 -0
  88. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +2 -9
  89. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.js +5 -10
  90. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +10 -0
  91. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.js +42 -0
  92. package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +12 -0
  93. package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.js +46 -0
  94. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +8 -0
  95. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.js +6 -0
  96. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.d.ts +2 -6
  97. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.js +5 -7
  98. package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +6 -0
  99. package/dist/cjs/serialization/resources/webhooks/types/index.js +6 -0
  100. package/dist/cjs/version.d.ts +1 -1
  101. package/dist/cjs/version.js +1 -1
  102. package/dist/esm/BaseClient.mjs +2 -2
  103. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +21 -0
  104. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.mjs +2 -0
  105. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +17 -0
  106. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.mjs +2 -0
  107. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +22 -0
  108. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.mjs +2 -0
  109. package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
  110. package/dist/esm/api/resources/drafts/types/DraftForwardOf.d.mts +4 -0
  111. package/dist/esm/api/resources/drafts/types/DraftForwardOf.mjs +2 -0
  112. package/dist/esm/api/resources/drafts/types/DraftItem.d.mts +1 -0
  113. package/dist/esm/api/resources/drafts/types/DraftReplyAll.d.mts +4 -0
  114. package/dist/esm/api/resources/drafts/types/DraftReplyAll.mjs +2 -0
  115. package/dist/esm/api/resources/drafts/types/index.d.mts +5 -0
  116. package/dist/esm/api/resources/drafts/types/index.mjs +5 -0
  117. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  118. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  119. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  120. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  121. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +69 -0
  122. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +264 -0
  123. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +103 -0
  124. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +374 -0
  125. package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.d.mts +1 -0
  126. package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.mjs +1 -0
  127. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.mts +10 -0
  128. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.mjs +2 -0
  129. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.d.mts +1 -0
  130. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.mjs +1 -0
  131. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +2 -0
  132. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +3 -0
  133. package/dist/esm/api/resources/inboxes/resources/webhooks/index.d.mts +1 -0
  134. package/dist/esm/api/resources/inboxes/resources/webhooks/index.mjs +1 -0
  135. package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
  136. package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
  137. package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
  138. package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
  139. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +103 -0
  140. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +374 -0
  141. package/dist/esm/api/resources/pods/resources/webhooks/client/index.d.mts +1 -0
  142. package/dist/esm/api/resources/pods/resources/webhooks/client/index.mjs +1 -0
  143. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.mts +10 -0
  144. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.mjs +2 -0
  145. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.d.mts +1 -0
  146. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.mjs +1 -0
  147. package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +2 -0
  148. package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +3 -0
  149. package/dist/esm/api/resources/pods/resources/webhooks/index.d.mts +1 -0
  150. package/dist/esm/api/resources/pods/resources/webhooks/index.mjs +1 -0
  151. package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +10 -0
  152. package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
  153. package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.d.mts +9 -0
  154. package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.mjs +2 -0
  155. package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.d.mts +7 -0
  156. package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.mjs +2 -0
  157. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -10
  158. package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +7 -0
  159. package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +2 -0
  160. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +11 -0
  161. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.mjs +2 -0
  162. package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +10 -0
  163. package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.mjs +2 -0
  164. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequest.d.mts +1 -14
  165. package/dist/esm/api/resources/webhooks/types/index.d.mts +6 -0
  166. package/dist/esm/api/resources/webhooks/types/index.mjs +6 -0
  167. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +30 -0
  168. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +26 -0
  169. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +24 -0
  170. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +20 -0
  171. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +32 -0
  172. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +28 -0
  173. package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
  174. package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
  175. package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.d.mts +7 -0
  176. package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.mjs +3 -0
  177. package/dist/esm/serialization/resources/drafts/types/DraftItem.d.mts +2 -0
  178. package/dist/esm/serialization/resources/drafts/types/DraftItem.mjs +2 -0
  179. package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.d.mts +7 -0
  180. package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.mjs +3 -0
  181. package/dist/esm/serialization/resources/drafts/types/index.d.mts +5 -0
  182. package/dist/esm/serialization/resources/drafts/types/index.mjs +5 -0
  183. package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +14 -0
  184. package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +10 -0
  185. package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.mts +11 -0
  186. package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.mjs +9 -0
  187. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.mts +8 -0
  188. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.mjs +3 -0
  189. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.d.mts +2 -9
  190. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.mjs +5 -10
  191. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +10 -0
  192. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +6 -0
  193. package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +12 -0
  194. package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.mjs +10 -0
  195. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +8 -0
  196. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.mjs +3 -0
  197. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.d.mts +2 -6
  198. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.mjs +5 -7
  199. package/dist/esm/serialization/resources/webhooks/types/index.d.mts +6 -0
  200. package/dist/esm/serialization/resources/webhooks/types/index.mjs +6 -0
  201. package/dist/esm/version.d.mts +1 -1
  202. package/dist/esm/version.mjs +1 -1
  203. package/dist/llms.txt +8 -4
  204. package/package.json +23 -1
  205. package/reference.md +1454 -428
@@ -0,0 +1,374 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as serializers from "../../../../../../serialization/index.mjs";
18
+ import * as AgentMail from "../../../../../index.mjs";
19
+ export class WebhooksClient {
20
+ constructor(options = {}) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * **CLI:**
25
+ * ```bash
26
+ * agentmail pods:webhooks list --pod-id <pod_id>
27
+ * ```
28
+ *
29
+ * @param {AgentMail.pods.PodId} pod_id
30
+ * @param {AgentMail.pods.PodListWebhooksRequest} request
31
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @example
34
+ * await client.pods.webhooks.list("pod_id")
35
+ */
36
+ list(pod_id, request = {}, requestOptions) {
37
+ return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
38
+ }
39
+ __list(pod_id_1) {
40
+ return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
+ const { limit, pageToken, ascending } = request;
43
+ const _queryParams = {
44
+ limit,
45
+ page_token: pageToken,
46
+ ascending,
47
+ };
48
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
49
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
50
+ const _response = yield core.fetcher({
51
+ 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)
52
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks`),
53
+ method: "GET",
54
+ headers: _headers,
55
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
56
+ 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,
57
+ 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,
58
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
59
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
60
+ logging: this._options.logging,
61
+ });
62
+ if (_response.ok) {
63
+ return {
64
+ data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
65
+ unrecognizedObjectKeys: "passthrough",
66
+ allowUnrecognizedUnionMembers: true,
67
+ allowUnrecognizedEnumValues: true,
68
+ skipValidation: true,
69
+ breadcrumbsPrefix: ["response"],
70
+ }),
71
+ rawResponse: _response.rawResponse,
72
+ };
73
+ }
74
+ if (_response.error.reason === "status-code") {
75
+ throw new errors.AgentMailError({
76
+ statusCode: _response.error.statusCode,
77
+ body: _response.error.body,
78
+ rawResponse: _response.rawResponse,
79
+ });
80
+ }
81
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks");
82
+ });
83
+ }
84
+ /**
85
+ * **CLI:**
86
+ * ```bash
87
+ * agentmail pods:webhooks get --pod-id <pod_id> --webhook-id <webhook_id>
88
+ * ```
89
+ *
90
+ * @param {AgentMail.pods.PodId} pod_id
91
+ * @param {AgentMail.webhooks.WebhookId} webhook_id
92
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
93
+ *
94
+ * @throws {@link AgentMail.NotFoundError}
95
+ *
96
+ * @example
97
+ * await client.pods.webhooks.get("pod_id", "webhook_id")
98
+ */
99
+ get(pod_id, webhook_id, requestOptions) {
100
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, webhook_id, requestOptions));
101
+ }
102
+ __get(pod_id, webhook_id, requestOptions) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
105
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
106
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
107
+ const _response = yield core.fetcher({
108
+ 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)
109
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
110
+ method: "GET",
111
+ headers: _headers,
112
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
113
+ 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,
114
+ 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,
115
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
116
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
117
+ logging: this._options.logging,
118
+ });
119
+ if (_response.ok) {
120
+ return {
121
+ data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
122
+ unrecognizedObjectKeys: "passthrough",
123
+ allowUnrecognizedUnionMembers: true,
124
+ allowUnrecognizedEnumValues: true,
125
+ skipValidation: true,
126
+ breadcrumbsPrefix: ["response"],
127
+ }),
128
+ rawResponse: _response.rawResponse,
129
+ };
130
+ }
131
+ if (_response.error.reason === "status-code") {
132
+ switch (_response.error.statusCode) {
133
+ case 404:
134
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
135
+ unrecognizedObjectKeys: "passthrough",
136
+ allowUnrecognizedUnionMembers: true,
137
+ allowUnrecognizedEnumValues: true,
138
+ skipValidation: true,
139
+ breadcrumbsPrefix: ["response"],
140
+ }), _response.rawResponse);
141
+ default:
142
+ throw new errors.AgentMailError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ }
149
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
150
+ });
151
+ }
152
+ /**
153
+ * Create a webhook scoped to this pod.
154
+ *
155
+ * **CLI:**
156
+ * ```bash
157
+ * agentmail pods:webhooks create --pod-id <pod_id> --url https://example.com/webhook --event-type message.received
158
+ * ```
159
+ *
160
+ * @param {AgentMail.pods.PodId} pod_id
161
+ * @param {AgentMail.webhooks.CreatePodWebhookRequest} request
162
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
163
+ *
164
+ * @throws {@link AgentMail.ValidationError}
165
+ *
166
+ * @example
167
+ * await client.pods.webhooks.create("pod_id", {
168
+ * url: "url",
169
+ * eventTypes: ["message.received", "message.received"]
170
+ * })
171
+ */
172
+ create(pod_id, request, requestOptions) {
173
+ return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
174
+ }
175
+ __create(pod_id, request, requestOptions) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
178
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
179
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
180
+ const _response = yield core.fetcher({
181
+ 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)
182
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks`),
183
+ method: "POST",
184
+ headers: _headers,
185
+ contentType: "application/json",
186
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ requestType: "json",
188
+ body: serializers.webhooks.CreatePodWebhookRequest.jsonOrThrow(request, {
189
+ unrecognizedObjectKeys: "strip",
190
+ omitUndefined: true,
191
+ }),
192
+ 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,
193
+ 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,
194
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
196
+ logging: this._options.logging,
197
+ });
198
+ if (_response.ok) {
199
+ return {
200
+ data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
201
+ unrecognizedObjectKeys: "passthrough",
202
+ allowUnrecognizedUnionMembers: true,
203
+ allowUnrecognizedEnumValues: true,
204
+ skipValidation: true,
205
+ breadcrumbsPrefix: ["response"],
206
+ }),
207
+ rawResponse: _response.rawResponse,
208
+ };
209
+ }
210
+ if (_response.error.reason === "status-code") {
211
+ switch (_response.error.statusCode) {
212
+ case 400:
213
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
214
+ unrecognizedObjectKeys: "passthrough",
215
+ allowUnrecognizedUnionMembers: true,
216
+ allowUnrecognizedEnumValues: true,
217
+ skipValidation: true,
218
+ breadcrumbsPrefix: ["response"],
219
+ }), _response.rawResponse);
220
+ default:
221
+ throw new errors.AgentMailError({
222
+ statusCode: _response.error.statusCode,
223
+ body: _response.error.body,
224
+ rawResponse: _response.rawResponse,
225
+ });
226
+ }
227
+ }
228
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/webhooks");
229
+ });
230
+ }
231
+ /**
232
+ * **CLI:**
233
+ * ```bash
234
+ * agentmail pods:webhooks update --pod-id <pod_id> --webhook-id <webhook_id> --add-inbox-id <inbox_id>
235
+ * ```
236
+ *
237
+ * @param {AgentMail.pods.PodId} pod_id
238
+ * @param {AgentMail.webhooks.WebhookId} webhook_id
239
+ * @param {AgentMail.webhooks.UpdatePodWebhookRequest} request
240
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
241
+ *
242
+ * @throws {@link AgentMail.NotFoundError}
243
+ * @throws {@link AgentMail.ValidationError}
244
+ *
245
+ * @example
246
+ * await client.pods.webhooks.update("pod_id", "webhook_id", {})
247
+ */
248
+ update(pod_id, webhook_id, request, requestOptions) {
249
+ return core.HttpResponsePromise.fromPromise(this.__update(pod_id, webhook_id, request, requestOptions));
250
+ }
251
+ __update(pod_id, webhook_id, request, requestOptions) {
252
+ return __awaiter(this, void 0, void 0, function* () {
253
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
254
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
255
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
256
+ const _response = yield core.fetcher({
257
+ 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)
258
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
259
+ method: "PATCH",
260
+ headers: _headers,
261
+ contentType: "application/json",
262
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
263
+ requestType: "json",
264
+ body: serializers.webhooks.UpdatePodWebhookRequest.jsonOrThrow(request, {
265
+ unrecognizedObjectKeys: "strip",
266
+ omitUndefined: true,
267
+ }),
268
+ 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,
269
+ 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,
270
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
271
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
272
+ logging: this._options.logging,
273
+ });
274
+ if (_response.ok) {
275
+ return {
276
+ data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
277
+ unrecognizedObjectKeys: "passthrough",
278
+ allowUnrecognizedUnionMembers: true,
279
+ allowUnrecognizedEnumValues: true,
280
+ skipValidation: true,
281
+ breadcrumbsPrefix: ["response"],
282
+ }),
283
+ rawResponse: _response.rawResponse,
284
+ };
285
+ }
286
+ if (_response.error.reason === "status-code") {
287
+ switch (_response.error.statusCode) {
288
+ case 404:
289
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
290
+ unrecognizedObjectKeys: "passthrough",
291
+ allowUnrecognizedUnionMembers: true,
292
+ allowUnrecognizedEnumValues: true,
293
+ skipValidation: true,
294
+ breadcrumbsPrefix: ["response"],
295
+ }), _response.rawResponse);
296
+ case 400:
297
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
298
+ unrecognizedObjectKeys: "passthrough",
299
+ allowUnrecognizedUnionMembers: true,
300
+ allowUnrecognizedEnumValues: true,
301
+ skipValidation: true,
302
+ breadcrumbsPrefix: ["response"],
303
+ }), _response.rawResponse);
304
+ default:
305
+ throw new errors.AgentMailError({
306
+ statusCode: _response.error.statusCode,
307
+ body: _response.error.body,
308
+ rawResponse: _response.rawResponse,
309
+ });
310
+ }
311
+ }
312
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
313
+ });
314
+ }
315
+ /**
316
+ * **CLI:**
317
+ * ```bash
318
+ * agentmail pods:webhooks delete --pod-id <pod_id> --webhook-id <webhook_id>
319
+ * ```
320
+ *
321
+ * @param {AgentMail.pods.PodId} pod_id
322
+ * @param {AgentMail.webhooks.WebhookId} webhook_id
323
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
324
+ *
325
+ * @throws {@link AgentMail.NotFoundError}
326
+ *
327
+ * @example
328
+ * await client.pods.webhooks.delete("pod_id", "webhook_id")
329
+ */
330
+ delete(pod_id, webhook_id, requestOptions) {
331
+ return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, webhook_id, requestOptions));
332
+ }
333
+ __delete(pod_id, webhook_id, requestOptions) {
334
+ return __awaiter(this, void 0, void 0, function* () {
335
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
336
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
337
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
338
+ const _response = yield core.fetcher({
339
+ 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)
340
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
341
+ method: "DELETE",
342
+ headers: _headers,
343
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
344
+ 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,
345
+ 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,
346
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
347
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
348
+ logging: this._options.logging,
349
+ });
350
+ if (_response.ok) {
351
+ return { data: undefined, rawResponse: _response.rawResponse };
352
+ }
353
+ if (_response.error.reason === "status-code") {
354
+ switch (_response.error.statusCode) {
355
+ case 404:
356
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
357
+ unrecognizedObjectKeys: "passthrough",
358
+ allowUnrecognizedUnionMembers: true,
359
+ allowUnrecognizedEnumValues: true,
360
+ skipValidation: true,
361
+ breadcrumbsPrefix: ["response"],
362
+ }), _response.rawResponse);
363
+ default:
364
+ throw new errors.AgentMailError({
365
+ statusCode: _response.error.statusCode,
366
+ body: _response.error.body,
367
+ rawResponse: _response.rawResponse,
368
+ });
369
+ }
370
+ }
371
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
372
+ });
373
+ }
374
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface PodListWebhooksRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { PodListWebhooksRequest } from "./PodListWebhooksRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { WebhooksClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { WebhooksClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Create a webhook scoped to an inbox. The inbox comes from the path, so `inbox_ids` and `pod_ids`
4
+ * are not accepted.
5
+ */
6
+ export interface CreateInboxWebhookRequest {
7
+ url: AgentMail.webhooks.Url;
8
+ eventTypes: AgentMail.webhooks.CreateWebhookEventTypes;
9
+ clientId?: AgentMail.webhooks.ClientId;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Create a webhook scoped to a pod. The pod comes from the path, so `pod_ids` is not accepted.
4
+ * Optionally pass `inbox_ids` to narrow the webhook to specific inboxes within the pod; omit to
5
+ * receive events for the whole pod.
6
+ */
7
+ export interface CreatePodWebhookRequest extends AgentMail.webhooks.CreateInboxWebhookRequest {
8
+ inboxIds?: AgentMail.InboxIds;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Full list of event types this webhook should receive. At least one type is required. Send every type you
4
+ * want in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)
5
+ * for spam, blocked, and unauthenticated events and required permissions.
6
+ */
7
+ export type CreateWebhookEventTypes = AgentMail.EventTypes;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,13 +1,4 @@
1
1
  import type * as AgentMail from "../../../index.mjs";
2
- export interface CreateWebhookRequest {
3
- url: AgentMail.webhooks.Url;
4
- /**
5
- * Full list of event types this webhook should receive. At least one type is required. Send every type you
6
- * want in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)
7
- * for spam, blocked, and unauthenticated events and required permissions.
8
- */
9
- eventTypes: AgentMail.EventTypes;
2
+ export interface CreateWebhookRequest extends AgentMail.webhooks.CreatePodWebhookRequest {
10
3
  podIds?: AgentMail.PodIds;
11
- inboxIds?: AgentMail.InboxIds;
12
- clientId?: AgentMail.webhooks.ClientId;
13
4
  }
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Update an inbox-scoped webhook. It is fixed to its inbox, so only `event_types` can change.
4
+ */
5
+ export interface UpdateInboxWebhookRequest {
6
+ eventTypes?: AgentMail.webhooks.UpdateWebhookEventTypes;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,11 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to and replace
4
+ * its `event_types`, but not the pod scope itself.
5
+ */
6
+ export interface UpdatePodWebhookRequest extends AgentMail.webhooks.UpdateInboxWebhookRequest {
7
+ /** Inbox IDs to subscribe to the webhook. */
8
+ addInboxIds?: AgentMail.InboxIds;
9
+ /** Inbox IDs to unsubscribe from the webhook. */
10
+ removeInboxIds?: AgentMail.InboxIds;
11
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same
4
+ * "set the list" behavior as create). It is not a merge or diff: include every event type you want after
5
+ * the update. Sending a one-element array means the webhook will only receive that one type afterward.
6
+ * Omit this field or send an empty array to leave event types unchanged. Clearing all types with an empty
7
+ * list is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or
8
+ * `message.received.unauthenticated` requires the matching label permission on the API key.
9
+ */
10
+ export type UpdateWebhookEventTypes = AgentMail.EventTypes;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,20 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.mjs";
2
- export interface UpdateWebhookRequest {
3
- /** Inbox IDs to subscribe to the webhook. */
4
- addInboxIds?: AgentMail.InboxIds;
5
- /** Inbox IDs to unsubscribe from the webhook. */
6
- removeInboxIds?: AgentMail.InboxIds;
2
+ export interface UpdateWebhookRequest extends AgentMail.webhooks.UpdatePodWebhookRequest {
7
3
  /** Pod IDs to subscribe to the webhook. */
8
4
  addPodIds?: AgentMail.PodIds;
9
5
  /** Pod IDs to unsubscribe from the webhook. */
10
6
  removePodIds?: AgentMail.PodIds;
11
- /**
12
- * When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same
13
- * "set the list" behavior as create). It is not a merge or diff: include every event type you want after
14
- * the update. Sending a one-element array means the webhook will only receive that one type afterward.
15
- * Omit this field or send an empty array to leave event types unchanged. Clearing all types with an empty
16
- * list is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or
17
- * `message.received.unauthenticated` requires the matching label permission on the API key.
18
- */
19
- eventTypes?: AgentMail.EventTypes;
20
7
  }
@@ -1,6 +1,12 @@
1
1
  export * from "./ClientId.mjs";
2
+ export * from "./CreateInboxWebhookRequest.mjs";
3
+ export * from "./CreatePodWebhookRequest.mjs";
4
+ export * from "./CreateWebhookEventTypes.mjs";
2
5
  export * from "./CreateWebhookRequest.mjs";
3
6
  export * from "./ListWebhooksResponse.mjs";
7
+ export * from "./UpdateInboxWebhookRequest.mjs";
8
+ export * from "./UpdatePodWebhookRequest.mjs";
9
+ export * from "./UpdateWebhookEventTypes.mjs";
4
10
  export * from "./UpdateWebhookRequest.mjs";
5
11
  export * from "./Url.mjs";
6
12
  export * from "./Webhook.mjs";
@@ -1,6 +1,12 @@
1
1
  export * from "./ClientId.mjs";
2
+ export * from "./CreateInboxWebhookRequest.mjs";
3
+ export * from "./CreatePodWebhookRequest.mjs";
4
+ export * from "./CreateWebhookEventTypes.mjs";
2
5
  export * from "./CreateWebhookRequest.mjs";
3
6
  export * from "./ListWebhooksResponse.mjs";
7
+ export * from "./UpdateInboxWebhookRequest.mjs";
8
+ export * from "./UpdatePodWebhookRequest.mjs";
9
+ export * from "./UpdateWebhookEventTypes.mjs";
4
10
  export * from "./UpdateWebhookRequest.mjs";
5
11
  export * from "./Url.mjs";
6
12
  export * from "./Webhook.mjs";
@@ -0,0 +1,30 @@
1
+ import type * as AgentMail from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
5
+ import { DraftBcc } from "./DraftBcc.mjs";
6
+ import { DraftCc } from "./DraftCc.mjs";
7
+ import { DraftClientId } from "./DraftClientId.mjs";
8
+ import { DraftHtml } from "./DraftHtml.mjs";
9
+ import { DraftLabels } from "./DraftLabels.mjs";
10
+ import { DraftReplyTo } from "./DraftReplyTo.mjs";
11
+ import { DraftSendAt } from "./DraftSendAt.mjs";
12
+ import { DraftSubject } from "./DraftSubject.mjs";
13
+ import { DraftText } from "./DraftText.mjs";
14
+ import { DraftTo } from "./DraftTo.mjs";
15
+ export declare const CreateDraftForwardRequest: core.serialization.ObjectSchema<serializers.CreateDraftForwardRequest.Raw, AgentMail.CreateDraftForwardRequest>;
16
+ export declare namespace CreateDraftForwardRequest {
17
+ interface Raw {
18
+ labels?: DraftLabels.Raw | null;
19
+ reply_to?: DraftReplyTo.Raw | null;
20
+ to?: DraftTo.Raw | null;
21
+ cc?: DraftCc.Raw | null;
22
+ bcc?: DraftBcc.Raw | null;
23
+ subject?: DraftSubject.Raw | null;
24
+ text?: DraftText.Raw | null;
25
+ html?: DraftHtml.Raw | null;
26
+ attachments?: SendAttachment.Raw[] | null;
27
+ send_at?: DraftSendAt.Raw | null;
28
+ client_id?: DraftClientId.Raw | null;
29
+ }
30
+ }
@@ -0,0 +1,26 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
4
+ import { DraftBcc } from "./DraftBcc.mjs";
5
+ import { DraftCc } from "./DraftCc.mjs";
6
+ import { DraftClientId } from "./DraftClientId.mjs";
7
+ import { DraftHtml } from "./DraftHtml.mjs";
8
+ import { DraftLabels } from "./DraftLabels.mjs";
9
+ import { DraftReplyTo } from "./DraftReplyTo.mjs";
10
+ import { DraftSendAt } from "./DraftSendAt.mjs";
11
+ import { DraftSubject } from "./DraftSubject.mjs";
12
+ import { DraftText } from "./DraftText.mjs";
13
+ import { DraftTo } from "./DraftTo.mjs";
14
+ export const CreateDraftForwardRequest = core.serialization.object({
15
+ labels: DraftLabels.optional(),
16
+ replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
17
+ to: DraftTo.optional(),
18
+ cc: DraftCc.optional(),
19
+ bcc: DraftBcc.optional(),
20
+ subject: DraftSubject.optional(),
21
+ text: DraftText.optional(),
22
+ html: DraftHtml.optional(),
23
+ attachments: core.serialization.list(SendAttachment).optional(),
24
+ sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
25
+ clientId: core.serialization.property("client_id", DraftClientId.optional()),
26
+ });