agentmail 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/domains/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/domains/client/Client.js +69 -0
  4. package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +4 -0
  5. package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.js +3 -0
  6. package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/domains/types/index.js +1 -0
  8. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +9 -9
  9. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +50 -50
  10. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +22 -15
  11. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +71 -56
  12. package/dist/cjs/api/resources/lists/client/Client.d.ts +15 -15
  13. package/dist/cjs/api/resources/lists/client/Client.js +67 -67
  14. package/dist/cjs/api/resources/messages/types/RawMessageResponse.d.ts +14 -0
  15. package/dist/cjs/api/resources/messages/types/RawMessageResponse.js +3 -0
  16. package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/messages/types/index.js +1 -0
  18. package/dist/cjs/api/resources/pods/client/Client.d.ts +4 -4
  19. package/dist/cjs/api/resources/pods/client/Client.js +8 -8
  20. package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +11 -11
  21. package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +42 -42
  22. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +33 -3
  23. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +178 -6
  24. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +15 -0
  25. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +72 -0
  26. package/dist/cjs/api/resources/pods/resources/lists/client/Client.d.ts +16 -16
  27. package/dist/cjs/api/resources/pods/resources/lists/client/Client.js +67 -67
  28. package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +15 -0
  29. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +61 -0
  30. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
  31. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
  32. package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -0
  34. package/dist/cjs/api/resources/threads/client/Client.js +60 -0
  35. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
  36. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
  37. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +13 -13
  39. package/dist/cjs/api/resources/webhooks/client/Client.js +31 -31
  40. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +10 -0
  41. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +42 -0
  42. package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
  43. package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
  44. package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.d.ts +14 -0
  45. package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.js +46 -0
  46. package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
  47. package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
  48. package/dist/cjs/version.d.ts +1 -1
  49. package/dist/cjs/version.js +1 -1
  50. package/dist/esm/BaseClient.mjs +2 -2
  51. package/dist/esm/api/resources/domains/client/Client.d.mts +12 -0
  52. package/dist/esm/api/resources/domains/client/Client.mjs +69 -0
  53. package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +4 -0
  54. package/dist/esm/api/resources/domains/types/UpdateDomainRequest.mjs +2 -0
  55. package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
  56. package/dist/esm/api/resources/domains/types/index.mjs +1 -0
  57. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +9 -9
  58. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +50 -50
  59. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +22 -15
  60. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +71 -56
  61. package/dist/esm/api/resources/lists/client/Client.d.mts +15 -15
  62. package/dist/esm/api/resources/lists/client/Client.mjs +67 -67
  63. package/dist/esm/api/resources/messages/types/RawMessageResponse.d.mts +14 -0
  64. package/dist/esm/api/resources/messages/types/RawMessageResponse.mjs +2 -0
  65. package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
  66. package/dist/esm/api/resources/messages/types/index.mjs +1 -0
  67. package/dist/esm/api/resources/pods/client/Client.d.mts +4 -4
  68. package/dist/esm/api/resources/pods/client/Client.mjs +8 -8
  69. package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +11 -11
  70. package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +42 -42
  71. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +33 -3
  72. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +178 -6
  73. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +15 -0
  74. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +72 -0
  75. package/dist/esm/api/resources/pods/resources/lists/client/Client.d.mts +16 -16
  76. package/dist/esm/api/resources/pods/resources/lists/client/Client.mjs +67 -67
  77. package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +15 -0
  78. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +61 -0
  79. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
  80. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
  81. package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +1 -0
  82. package/dist/esm/api/resources/threads/client/Client.d.mts +14 -0
  83. package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
  84. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
  85. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
  86. package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
  87. package/dist/esm/api/resources/webhooks/client/Client.d.mts +13 -13
  88. package/dist/esm/api/resources/webhooks/client/Client.mjs +31 -31
  89. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +10 -0
  90. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +6 -0
  91. package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
  92. package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
  93. package/dist/esm/serialization/resources/messages/types/RawMessageResponse.d.mts +14 -0
  94. package/dist/esm/serialization/resources/messages/types/RawMessageResponse.mjs +10 -0
  95. package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
  96. package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
  97. package/dist/esm/version.d.mts +1 -1
  98. package/dist/esm/version.mjs +1 -1
  99. package/dist/llms-full.txt +16825 -11774
  100. package/dist/llms.txt +94 -25
  101. package/package.json +1 -1
  102. package/reference.md +570 -117
@@ -21,6 +21,7 @@ export * from "./MessageText.js";
21
21
  export * from "./MessageTimestamp.js";
22
22
  export * from "./MessageTo.js";
23
23
  export * from "./MessageUpdatedAt.js";
24
+ export * from "./RawMessageResponse.js";
24
25
  export * from "./ReplyAll.js";
25
26
  export * from "./ReplyAllMessageRequest.js";
26
27
  export * from "./ReplyToMessageRequest.js";
@@ -37,6 +37,7 @@ __exportStar(require("./MessageText.js"), exports);
37
37
  __exportStar(require("./MessageTimestamp.js"), exports);
38
38
  __exportStar(require("./MessageTo.js"), exports);
39
39
  __exportStar(require("./MessageUpdatedAt.js"), exports);
40
+ __exportStar(require("./RawMessageResponse.js"), exports);
40
41
  __exportStar(require("./ReplyAll.js"), exports);
41
42
  __exportStar(require("./ReplyAllMessageRequest.js"), exports);
42
43
  __exportStar(require("./ReplyToMessageRequest.js"), exports);
@@ -16,20 +16,20 @@ export declare namespace PodsClient {
16
16
  }
17
17
  export declare class PodsClient {
18
18
  protected readonly _options: NormalizedClientOptionsWithAuth<PodsClient.Options>;
19
+ protected _apiKeys: ApiKeysClient | undefined;
20
+ protected _domains: DomainsClient | undefined;
19
21
  protected _inboxes: InboxesClient | undefined;
20
22
  protected _threads: ThreadsClient | undefined;
21
23
  protected _drafts: DraftsClient | undefined;
22
- protected _domains: DomainsClient | undefined;
23
24
  protected _lists: ListsClient | undefined;
24
- protected _apiKeys: ApiKeysClient | undefined;
25
25
  protected _metrics: MetricsClient | undefined;
26
26
  constructor(options?: PodsClient.Options);
27
+ get apiKeys(): ApiKeysClient;
28
+ get domains(): DomainsClient;
27
29
  get inboxes(): InboxesClient;
28
30
  get threads(): ThreadsClient;
29
31
  get drafts(): DraftsClient;
30
- get domains(): DomainsClient;
31
32
  get lists(): ListsClient;
32
- get apiKeys(): ApiKeysClient;
33
33
  get metrics(): MetricsClient;
34
34
  /**
35
35
  * @param {AgentMail.pods.ListPodsRequest} request
@@ -63,6 +63,14 @@ class PodsClient {
63
63
  constructor(options = {}) {
64
64
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
65
65
  }
66
+ get apiKeys() {
67
+ var _a;
68
+ return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new Client_js_1.ApiKeysClient(this._options)));
69
+ }
70
+ get domains() {
71
+ var _a;
72
+ return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new Client_js_2.DomainsClient(this._options)));
73
+ }
66
74
  get inboxes() {
67
75
  var _a;
68
76
  return ((_a = this._inboxes) !== null && _a !== void 0 ? _a : (this._inboxes = new Client_js_4.InboxesClient(this._options)));
@@ -75,18 +83,10 @@ class PodsClient {
75
83
  var _a;
76
84
  return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_3.DraftsClient(this._options)));
77
85
  }
78
- get domains() {
79
- var _a;
80
- return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new Client_js_2.DomainsClient(this._options)));
81
- }
82
86
  get lists() {
83
87
  var _a;
84
88
  return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_5.ListsClient(this._options)));
85
89
  }
86
- get apiKeys() {
87
- var _a;
88
- return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new Client_js_1.ApiKeysClient(this._options)));
89
- }
90
90
  get metrics() {
91
91
  var _a;
92
92
  return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_6.MetricsClient(this._options)));
@@ -12,31 +12,31 @@ export declare class ApiKeysClient {
12
12
  constructor(options?: ApiKeysClient.Options);
13
13
  /**
14
14
  * @param {AgentMail.pods.PodId} pod_id
15
- * @param {AgentMail.CreateApiKeyRequest} request
15
+ * @param {AgentMail.pods.ListApiKeysRequest} request
16
16
  * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
18
18
  * @throws {@link AgentMail.NotFoundError}
19
- * @throws {@link AgentMail.ValidationError}
20
19
  *
21
20
  * @example
22
- * await client.pods.apiKeys.create("pod_id", {
23
- * name: "name"
24
- * })
21
+ * await client.pods.apiKeys.list("pod_id")
25
22
  */
26
- create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.CreateApiKeyResponse>;
27
- private __create;
23
+ list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListApiKeysResponse>;
24
+ private __list;
28
25
  /**
29
26
  * @param {AgentMail.pods.PodId} pod_id
30
- * @param {AgentMail.pods.ListApiKeysRequest} request
27
+ * @param {AgentMail.CreateApiKeyRequest} request
31
28
  * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
32
29
  *
33
30
  * @throws {@link AgentMail.NotFoundError}
31
+ * @throws {@link AgentMail.ValidationError}
34
32
  *
35
33
  * @example
36
- * await client.pods.apiKeys.list("pod_id")
34
+ * await client.pods.apiKeys.create("pod_id", {
35
+ * name: "name"
36
+ * })
37
37
  */
38
- list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListApiKeysResponse>;
39
- private __list;
38
+ create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.CreateApiKeyResponse>;
39
+ private __create;
40
40
  /**
41
41
  * @param {AgentMail.pods.PodId} pod_id
42
42
  * @param {AgentMail.ApiKeyId} api_key
@@ -58,37 +58,33 @@ class ApiKeysClient {
58
58
  }
59
59
  /**
60
60
  * @param {AgentMail.pods.PodId} pod_id
61
- * @param {AgentMail.CreateApiKeyRequest} request
61
+ * @param {AgentMail.pods.ListApiKeysRequest} request
62
62
  * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
63
63
  *
64
64
  * @throws {@link AgentMail.NotFoundError}
65
- * @throws {@link AgentMail.ValidationError}
66
65
  *
67
66
  * @example
68
- * await client.pods.apiKeys.create("pod_id", {
69
- * name: "name"
70
- * })
67
+ * await client.pods.apiKeys.list("pod_id")
71
68
  */
72
- create(pod_id, request, requestOptions) {
73
- return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
69
+ list(pod_id, request = {}, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
74
71
  }
75
- __create(pod_id, request, requestOptions) {
76
- return __awaiter(this, void 0, void 0, function* () {
72
+ __list(pod_id_1) {
73
+ return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
77
74
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
+ const { limit, pageToken } = request;
76
+ const _queryParams = {
77
+ limit,
78
+ page_token: pageToken,
79
+ };
78
80
  const _authRequest = yield this._options.authProvider.getAuthRequest();
79
81
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
82
  const _response = yield core.fetcher({
81
83
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
82
84
  .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys`),
83
- method: "POST",
85
+ method: "GET",
84
86
  headers: _headers,
85
- contentType: "application/json",
86
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
87
- requestType: "json",
88
- body: serializers.CreateApiKeyRequest.jsonOrThrow(request, {
89
- unrecognizedObjectKeys: "strip",
90
- omitUndefined: true,
91
- }),
87
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
92
88
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
93
89
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
94
90
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -97,7 +93,7 @@ class ApiKeysClient {
97
93
  });
98
94
  if (_response.ok) {
99
95
  return {
100
- data: serializers.CreateApiKeyResponse.parseOrThrow(_response.body, {
96
+ data: serializers.ListApiKeysResponse.parseOrThrow(_response.body, {
101
97
  unrecognizedObjectKeys: "passthrough",
102
98
  allowUnrecognizedUnionMembers: true,
103
99
  allowUnrecognizedEnumValues: true,
@@ -117,14 +113,6 @@ class ApiKeysClient {
117
113
  skipValidation: true,
118
114
  breadcrumbsPrefix: ["response"],
119
115
  }), _response.rawResponse);
120
- case 400:
121
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
122
- unrecognizedObjectKeys: "passthrough",
123
- allowUnrecognizedUnionMembers: true,
124
- allowUnrecognizedEnumValues: true,
125
- skipValidation: true,
126
- breadcrumbsPrefix: ["response"],
127
- }), _response.rawResponse);
128
116
  default:
129
117
  throw new errors.AgentMailError({
130
118
  statusCode: _response.error.statusCode,
@@ -133,38 +121,42 @@ class ApiKeysClient {
133
121
  });
134
122
  }
135
123
  }
136
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/api-keys");
124
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/api-keys");
137
125
  });
138
126
  }
139
127
  /**
140
128
  * @param {AgentMail.pods.PodId} pod_id
141
- * @param {AgentMail.pods.ListApiKeysRequest} request
129
+ * @param {AgentMail.CreateApiKeyRequest} request
142
130
  * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
143
131
  *
144
132
  * @throws {@link AgentMail.NotFoundError}
133
+ * @throws {@link AgentMail.ValidationError}
145
134
  *
146
135
  * @example
147
- * await client.pods.apiKeys.list("pod_id")
136
+ * await client.pods.apiKeys.create("pod_id", {
137
+ * name: "name"
138
+ * })
148
139
  */
149
- list(pod_id, request = {}, requestOptions) {
150
- return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
140
+ create(pod_id, request, requestOptions) {
141
+ return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
151
142
  }
152
- __list(pod_id_1) {
153
- return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
143
+ __create(pod_id, request, requestOptions) {
144
+ return __awaiter(this, void 0, void 0, function* () {
154
145
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
155
- const { limit, pageToken } = request;
156
- const _queryParams = {
157
- limit,
158
- page_token: pageToken,
159
- };
160
146
  const _authRequest = yield this._options.authProvider.getAuthRequest();
161
147
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
162
148
  const _response = yield core.fetcher({
163
149
  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)
164
150
  .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys`),
165
- method: "GET",
151
+ method: "POST",
166
152
  headers: _headers,
167
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
153
+ contentType: "application/json",
154
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
155
+ requestType: "json",
156
+ body: serializers.CreateApiKeyRequest.jsonOrThrow(request, {
157
+ unrecognizedObjectKeys: "strip",
158
+ omitUndefined: true,
159
+ }),
168
160
  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,
169
161
  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,
170
162
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -173,7 +165,7 @@ class ApiKeysClient {
173
165
  });
174
166
  if (_response.ok) {
175
167
  return {
176
- data: serializers.ListApiKeysResponse.parseOrThrow(_response.body, {
168
+ data: serializers.CreateApiKeyResponse.parseOrThrow(_response.body, {
177
169
  unrecognizedObjectKeys: "passthrough",
178
170
  allowUnrecognizedUnionMembers: true,
179
171
  allowUnrecognizedEnumValues: true,
@@ -193,6 +185,14 @@ class ApiKeysClient {
193
185
  skipValidation: true,
194
186
  breadcrumbsPrefix: ["response"],
195
187
  }), _response.rawResponse);
188
+ case 400:
189
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
190
+ unrecognizedObjectKeys: "passthrough",
191
+ allowUnrecognizedUnionMembers: true,
192
+ allowUnrecognizedEnumValues: true,
193
+ skipValidation: true,
194
+ breadcrumbsPrefix: ["response"],
195
+ }), _response.rawResponse);
196
196
  default:
197
197
  throw new errors.AgentMailError({
198
198
  statusCode: _response.error.statusCode,
@@ -201,7 +201,7 @@ class ApiKeysClient {
201
201
  });
202
202
  }
203
203
  }
204
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/api-keys");
204
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/api-keys");
205
205
  });
206
206
  }
207
207
  /**
@@ -22,6 +22,23 @@ export declare class DomainsClient {
22
22
  */
23
23
  list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListDomainsRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListDomainsResponse>;
24
24
  private __list;
25
+ /**
26
+ * @param {AgentMail.pods.PodId} pod_id
27
+ * @param {AgentMail.DomainId} domain_id
28
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link AgentMail.NotFoundError}
31
+ *
32
+ * @example
33
+ * await client.pods.domains.get("pod_id", "domain_id")
34
+ */
35
+ get(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
36
+ private __get;
37
+ /**
38
+ * @throws {@link AgentMail.NotFoundError}
39
+ */
40
+ getZoneFile(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
41
+ private __getZoneFile;
25
42
  /**
26
43
  * @param {AgentMail.pods.PodId} pod_id
27
44
  * @param {AgentMail.CreateDomainRequest} request
@@ -40,15 +57,16 @@ export declare class DomainsClient {
40
57
  /**
41
58
  * @param {AgentMail.pods.PodId} pod_id
42
59
  * @param {AgentMail.DomainId} domain_id
60
+ * @param {AgentMail.UpdateDomainRequest} request
43
61
  * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
44
62
  *
45
63
  * @throws {@link AgentMail.NotFoundError}
46
64
  *
47
65
  * @example
48
- * await client.pods.domains.get("pod_id", "domain_id")
66
+ * await client.pods.domains.update("pod_id", "domain_id", {})
49
67
  */
50
- get(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
51
- private __get;
68
+ update(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, request: AgentMail.UpdateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
69
+ private __update;
52
70
  /**
53
71
  * @param {AgentMail.pods.PodId} pod_id
54
72
  * @param {AgentMail.DomainId} domain_id
@@ -61,4 +79,16 @@ export declare class DomainsClient {
61
79
  */
62
80
  delete(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<void>;
63
81
  private __delete;
82
+ /**
83
+ * @param {AgentMail.pods.PodId} pod_id
84
+ * @param {AgentMail.DomainId} domain_id
85
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
86
+ *
87
+ * @throws {@link AgentMail.NotFoundError}
88
+ *
89
+ * @example
90
+ * await client.pods.domains.verify("pod_id", "domain_id")
91
+ */
92
+ verify(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<void>;
93
+ private __verify;
64
94
  }
@@ -125,6 +125,117 @@ class DomainsClient {
125
125
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains");
126
126
  });
127
127
  }
128
+ /**
129
+ * @param {AgentMail.pods.PodId} pod_id
130
+ * @param {AgentMail.DomainId} domain_id
131
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link AgentMail.NotFoundError}
134
+ *
135
+ * @example
136
+ * await client.pods.domains.get("pod_id", "domain_id")
137
+ */
138
+ get(pod_id, domain_id, requestOptions) {
139
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, domain_id, requestOptions));
140
+ }
141
+ __get(pod_id, domain_id, requestOptions) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
144
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
145
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
146
+ const _response = yield core.fetcher({
147
+ 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)
148
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
149
+ method: "GET",
150
+ headers: _headers,
151
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
152
+ 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,
153
+ 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,
154
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
155
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
156
+ logging: this._options.logging,
157
+ });
158
+ if (_response.ok) {
159
+ return {
160
+ data: serializers.Domain.parseOrThrow(_response.body, {
161
+ unrecognizedObjectKeys: "passthrough",
162
+ allowUnrecognizedUnionMembers: true,
163
+ allowUnrecognizedEnumValues: true,
164
+ skipValidation: true,
165
+ breadcrumbsPrefix: ["response"],
166
+ }),
167
+ rawResponse: _response.rawResponse,
168
+ };
169
+ }
170
+ if (_response.error.reason === "status-code") {
171
+ switch (_response.error.statusCode) {
172
+ case 404:
173
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
174
+ unrecognizedObjectKeys: "passthrough",
175
+ allowUnrecognizedUnionMembers: true,
176
+ allowUnrecognizedEnumValues: true,
177
+ skipValidation: true,
178
+ breadcrumbsPrefix: ["response"],
179
+ }), _response.rawResponse);
180
+ default:
181
+ throw new errors.AgentMailError({
182
+ statusCode: _response.error.statusCode,
183
+ body: _response.error.body,
184
+ rawResponse: _response.rawResponse,
185
+ });
186
+ }
187
+ }
188
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}");
189
+ });
190
+ }
191
+ /**
192
+ * @throws {@link AgentMail.NotFoundError}
193
+ */
194
+ getZoneFile(pod_id, domain_id, requestOptions) {
195
+ return core.HttpResponsePromise.fromPromise(this.__getZoneFile(pod_id, domain_id, requestOptions));
196
+ }
197
+ __getZoneFile(pod_id, domain_id, requestOptions) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
200
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
201
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
202
+ const _response = yield core.fetcher({
203
+ 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)
204
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}/zone-file`),
205
+ method: "GET",
206
+ headers: _headers,
207
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
208
+ responseType: "binary-response",
209
+ 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,
210
+ 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,
211
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
212
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
213
+ logging: this._options.logging,
214
+ });
215
+ if (_response.ok) {
216
+ return { data: _response.body, rawResponse: _response.rawResponse };
217
+ }
218
+ if (_response.error.reason === "status-code") {
219
+ switch (_response.error.statusCode) {
220
+ case 404:
221
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
222
+ unrecognizedObjectKeys: "passthrough",
223
+ allowUnrecognizedUnionMembers: true,
224
+ allowUnrecognizedEnumValues: true,
225
+ skipValidation: true,
226
+ breadcrumbsPrefix: ["response"],
227
+ }), _response.rawResponse);
228
+ default:
229
+ throw new errors.AgentMailError({
230
+ statusCode: _response.error.statusCode,
231
+ body: _response.error.body,
232
+ rawResponse: _response.rawResponse,
233
+ });
234
+ }
235
+ }
236
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}/zone-file");
237
+ });
238
+ }
128
239
  /**
129
240
  * @param {AgentMail.pods.PodId} pod_id
130
241
  * @param {AgentMail.CreateDomainRequest} request
@@ -200,17 +311,18 @@ class DomainsClient {
200
311
  /**
201
312
  * @param {AgentMail.pods.PodId} pod_id
202
313
  * @param {AgentMail.DomainId} domain_id
314
+ * @param {AgentMail.UpdateDomainRequest} request
203
315
  * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
204
316
  *
205
317
  * @throws {@link AgentMail.NotFoundError}
206
318
  *
207
319
  * @example
208
- * await client.pods.domains.get("pod_id", "domain_id")
320
+ * await client.pods.domains.update("pod_id", "domain_id", {})
209
321
  */
210
- get(pod_id, domain_id, requestOptions) {
211
- return core.HttpResponsePromise.fromPromise(this.__get(pod_id, domain_id, requestOptions));
322
+ update(pod_id, domain_id, request, requestOptions) {
323
+ return core.HttpResponsePromise.fromPromise(this.__update(pod_id, domain_id, request, requestOptions));
212
324
  }
213
- __get(pod_id, domain_id, requestOptions) {
325
+ __update(pod_id, domain_id, request, requestOptions) {
214
326
  return __awaiter(this, void 0, void 0, function* () {
215
327
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
216
328
  const _authRequest = yield this._options.authProvider.getAuthRequest();
@@ -218,9 +330,15 @@ class DomainsClient {
218
330
  const _response = yield core.fetcher({
219
331
  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)
220
332
  .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
221
- method: "GET",
333
+ method: "PATCH",
222
334
  headers: _headers,
335
+ contentType: "application/json",
223
336
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
337
+ requestType: "json",
338
+ body: serializers.UpdateDomainRequest.jsonOrThrow(request, {
339
+ unrecognizedObjectKeys: "strip",
340
+ omitUndefined: true,
341
+ }),
224
342
  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,
225
343
  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,
226
344
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -257,7 +375,7 @@ class DomainsClient {
257
375
  });
258
376
  }
259
377
  }
260
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}");
378
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/domains/{domain_id}");
261
379
  });
262
380
  }
263
381
  /**
@@ -314,5 +432,59 @@ class DomainsClient {
314
432
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/domains/{domain_id}");
315
433
  });
316
434
  }
435
+ /**
436
+ * @param {AgentMail.pods.PodId} pod_id
437
+ * @param {AgentMail.DomainId} domain_id
438
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
439
+ *
440
+ * @throws {@link AgentMail.NotFoundError}
441
+ *
442
+ * @example
443
+ * await client.pods.domains.verify("pod_id", "domain_id")
444
+ */
445
+ verify(pod_id, domain_id, requestOptions) {
446
+ return core.HttpResponsePromise.fromPromise(this.__verify(pod_id, domain_id, requestOptions));
447
+ }
448
+ __verify(pod_id, domain_id, requestOptions) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
451
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
452
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
453
+ const _response = yield core.fetcher({
454
+ 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)
455
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}/verify`),
456
+ method: "POST",
457
+ headers: _headers,
458
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
459
+ 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,
460
+ 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,
461
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
462
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
463
+ logging: this._options.logging,
464
+ });
465
+ if (_response.ok) {
466
+ return { data: undefined, rawResponse: _response.rawResponse };
467
+ }
468
+ if (_response.error.reason === "status-code") {
469
+ switch (_response.error.statusCode) {
470
+ case 404:
471
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
472
+ unrecognizedObjectKeys: "passthrough",
473
+ allowUnrecognizedUnionMembers: true,
474
+ allowUnrecognizedEnumValues: true,
475
+ skipValidation: true,
476
+ breadcrumbsPrefix: ["response"],
477
+ }), _response.rawResponse);
478
+ default:
479
+ throw new errors.AgentMailError({
480
+ statusCode: _response.error.statusCode,
481
+ body: _response.error.body,
482
+ rawResponse: _response.rawResponse,
483
+ });
484
+ }
485
+ }
486
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/domains/{domain_id}/verify");
487
+ });
488
+ }
317
489
  }
318
490
  exports.DomainsClient = DomainsClient;
@@ -46,6 +46,21 @@ export declare class InboxesClient {
46
46
  */
47
47
  create(pod_id: AgentMail.pods.PodId, request: AgentMail.inboxes.CreateInboxRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
48
48
  private __create;
49
+ /**
50
+ * @param {AgentMail.pods.PodId} pod_id
51
+ * @param {AgentMail.inboxes.InboxId} inbox_id
52
+ * @param {AgentMail.inboxes.UpdateInboxRequest} request
53
+ * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link AgentMail.NotFoundError}
56
+ *
57
+ * @example
58
+ * await client.pods.inboxes.update("pod_id", "inbox_id", {
59
+ * displayName: "display_name"
60
+ * })
61
+ */
62
+ update(pod_id: AgentMail.pods.PodId, inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.inboxes.UpdateInboxRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
63
+ private __update;
49
64
  /**
50
65
  * @param {AgentMail.pods.PodId} pod_id
51
66
  * @param {AgentMail.inboxes.InboxId} inbox_id