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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/domains/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/domains/client/Client.js +69 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +4 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.js +3 -0
- package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/index.js +1 -0
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +50 -50
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +22 -15
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +71 -56
- package/dist/cjs/api/resources/lists/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/lists/client/Client.js +67 -67
- package/dist/cjs/api/resources/messages/types/RawMessageResponse.d.ts +14 -0
- package/dist/cjs/api/resources/messages/types/RawMessageResponse.js +3 -0
- package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/index.js +1 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/pods/client/Client.js +8 -8
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +42 -42
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +33 -3
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +178 -6
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +72 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/Client.d.ts +16 -16
- package/dist/cjs/api/resources/pods/resources/lists/client/Client.js +67 -67
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +61 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -0
- package/dist/cjs/api/resources/threads/client/Client.js +60 -0
- package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/webhooks/client/Client.js +31 -31
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +42 -0
- package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
- package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.js +46 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/domains/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/domains/client/Client.mjs +69 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +4 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.mjs +2 -0
- package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +50 -50
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +22 -15
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +71 -56
- package/dist/esm/api/resources/lists/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/lists/client/Client.mjs +67 -67
- package/dist/esm/api/resources/messages/types/RawMessageResponse.d.mts +14 -0
- package/dist/esm/api/resources/messages/types/RawMessageResponse.mjs +2 -0
- package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/index.mjs +1 -0
- package/dist/esm/api/resources/pods/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/pods/client/Client.mjs +8 -8
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +42 -42
- package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +33 -3
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +178 -6
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +72 -0
- package/dist/esm/api/resources/pods/resources/lists/client/Client.d.mts +16 -16
- package/dist/esm/api/resources/pods/resources/lists/client/Client.mjs +67 -67
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +61 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/threads/client/Client.d.mts +14 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
- package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
- package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/webhooks/client/Client.mjs +31 -31
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +6 -0
- package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/messages/types/RawMessageResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/messages/types/RawMessageResponse.mjs +10 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +16825 -11774
- package/dist/llms.txt +94 -25
- package/package.json +1 -1
- package/reference.md +570 -117
|
@@ -257,6 +257,78 @@ class InboxesClient {
|
|
|
257
257
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/inboxes");
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
262
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
263
|
+
* @param {AgentMail.inboxes.UpdateInboxRequest} request
|
|
264
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
265
|
+
*
|
|
266
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* await client.pods.inboxes.update("pod_id", "inbox_id", {
|
|
270
|
+
* displayName: "display_name"
|
|
271
|
+
* })
|
|
272
|
+
*/
|
|
273
|
+
update(pod_id, inbox_id, request, requestOptions) {
|
|
274
|
+
return core.HttpResponsePromise.fromPromise(this.__update(pod_id, inbox_id, request, requestOptions));
|
|
275
|
+
}
|
|
276
|
+
__update(pod_id, inbox_id, request, requestOptions) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
279
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
280
|
+
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);
|
|
281
|
+
const _response = yield core.fetcher({
|
|
282
|
+
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)
|
|
283
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}`),
|
|
284
|
+
method: "PATCH",
|
|
285
|
+
headers: _headers,
|
|
286
|
+
contentType: "application/json",
|
|
287
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
288
|
+
requestType: "json",
|
|
289
|
+
body: serializers.inboxes.UpdateInboxRequest.jsonOrThrow(request, {
|
|
290
|
+
unrecognizedObjectKeys: "strip",
|
|
291
|
+
omitUndefined: true,
|
|
292
|
+
}),
|
|
293
|
+
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,
|
|
294
|
+
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,
|
|
295
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
296
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
297
|
+
logging: this._options.logging,
|
|
298
|
+
});
|
|
299
|
+
if (_response.ok) {
|
|
300
|
+
return {
|
|
301
|
+
data: serializers.inboxes.Inbox.parseOrThrow(_response.body, {
|
|
302
|
+
unrecognizedObjectKeys: "passthrough",
|
|
303
|
+
allowUnrecognizedUnionMembers: true,
|
|
304
|
+
allowUnrecognizedEnumValues: true,
|
|
305
|
+
skipValidation: true,
|
|
306
|
+
breadcrumbsPrefix: ["response"],
|
|
307
|
+
}),
|
|
308
|
+
rawResponse: _response.rawResponse,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
if (_response.error.reason === "status-code") {
|
|
312
|
+
switch (_response.error.statusCode) {
|
|
313
|
+
case 404:
|
|
314
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
315
|
+
unrecognizedObjectKeys: "passthrough",
|
|
316
|
+
allowUnrecognizedUnionMembers: true,
|
|
317
|
+
allowUnrecognizedEnumValues: true,
|
|
318
|
+
skipValidation: true,
|
|
319
|
+
breadcrumbsPrefix: ["response"],
|
|
320
|
+
}), _response.rawResponse);
|
|
321
|
+
default:
|
|
322
|
+
throw new errors.AgentMailError({
|
|
323
|
+
statusCode: _response.error.statusCode,
|
|
324
|
+
body: _response.error.body,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/inboxes/{inbox_id}");
|
|
330
|
+
});
|
|
331
|
+
}
|
|
260
332
|
/**
|
|
261
333
|
* @param {AgentMail.pods.PodId} pod_id
|
|
262
334
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
@@ -10,22 +10,6 @@ export declare namespace ListsClient {
|
|
|
10
10
|
export declare class ListsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ListsClient.Options>;
|
|
12
12
|
constructor(options?: ListsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* @param {AgentMail.pods.PodId} pod_id
|
|
15
|
-
* @param {AgentMail.Direction} direction
|
|
16
|
-
* @param {AgentMail.ListType} type
|
|
17
|
-
* @param {AgentMail.CreateListEntryRequest} request
|
|
18
|
-
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
-
*
|
|
20
|
-
* @throws {@link AgentMail.ValidationError}
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* await client.pods.lists.create("pod_id", "send", "allow", {
|
|
24
|
-
* entry: "entry"
|
|
25
|
-
* })
|
|
26
|
-
*/
|
|
27
|
-
create(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
|
|
28
|
-
private __create;
|
|
29
13
|
/**
|
|
30
14
|
* @param {AgentMail.pods.PodId} pod_id
|
|
31
15
|
* @param {AgentMail.Direction} direction
|
|
@@ -52,6 +36,22 @@ export declare class ListsClient {
|
|
|
52
36
|
*/
|
|
53
37
|
get(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
|
|
54
38
|
private __get;
|
|
39
|
+
/**
|
|
40
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
41
|
+
* @param {AgentMail.Direction} direction
|
|
42
|
+
* @param {AgentMail.ListType} type
|
|
43
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
44
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link AgentMail.ValidationError}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.pods.lists.create("pod_id", "send", "allow", {
|
|
50
|
+
* entry: "entry"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
create(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
|
|
54
|
+
private __create;
|
|
55
55
|
/**
|
|
56
56
|
* @param {AgentMail.pods.PodId} pod_id
|
|
57
57
|
* @param {AgentMail.Direction} direction
|
|
@@ -60,36 +60,31 @@ class ListsClient {
|
|
|
60
60
|
* @param {AgentMail.pods.PodId} pod_id
|
|
61
61
|
* @param {AgentMail.Direction} direction
|
|
62
62
|
* @param {AgentMail.ListType} type
|
|
63
|
-
* @param {AgentMail.
|
|
63
|
+
* @param {AgentMail.pods.ListListEntriesRequest} request
|
|
64
64
|
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
65
|
*
|
|
66
|
-
* @throws {@link AgentMail.ValidationError}
|
|
67
|
-
*
|
|
68
66
|
* @example
|
|
69
|
-
* await client.pods.lists.
|
|
70
|
-
* entry: "entry"
|
|
71
|
-
* })
|
|
67
|
+
* await client.pods.lists.list("pod_id", "send", "allow")
|
|
72
68
|
*/
|
|
73
|
-
|
|
74
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
69
|
+
list(pod_id, direction, type, request = {}, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, direction, type, request, requestOptions));
|
|
75
71
|
}
|
|
76
|
-
|
|
77
|
-
return __awaiter(this,
|
|
72
|
+
__list(pod_id_1, direction_1, type_1) {
|
|
73
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, direction, type, request = {}, requestOptions) {
|
|
78
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
|
+
};
|
|
79
80
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
80
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);
|
|
81
82
|
const _response = yield core.fetcher({
|
|
82
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)
|
|
83
84
|
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
84
|
-
method: "
|
|
85
|
+
method: "GET",
|
|
85
86
|
headers: _headers,
|
|
86
|
-
|
|
87
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
88
|
-
requestType: "json",
|
|
89
|
-
body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
|
|
90
|
-
unrecognizedObjectKeys: "strip",
|
|
91
|
-
omitUndefined: true,
|
|
92
|
-
}),
|
|
87
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
93
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,
|
|
94
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,
|
|
95
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -98,7 +93,7 @@ class ListsClient {
|
|
|
98
93
|
});
|
|
99
94
|
if (_response.ok) {
|
|
100
95
|
return {
|
|
101
|
-
data: serializers.
|
|
96
|
+
data: serializers.PodListListEntriesResponse.parseOrThrow(_response.body, {
|
|
102
97
|
unrecognizedObjectKeys: "passthrough",
|
|
103
98
|
allowUnrecognizedUnionMembers: true,
|
|
104
99
|
allowUnrecognizedEnumValues: true,
|
|
@@ -109,55 +104,41 @@ class ListsClient {
|
|
|
109
104
|
};
|
|
110
105
|
}
|
|
111
106
|
if (_response.error.reason === "status-code") {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
allowUnrecognizedEnumValues: true,
|
|
118
|
-
skipValidation: true,
|
|
119
|
-
breadcrumbsPrefix: ["response"],
|
|
120
|
-
}), _response.rawResponse);
|
|
121
|
-
default:
|
|
122
|
-
throw new errors.AgentMailError({
|
|
123
|
-
statusCode: _response.error.statusCode,
|
|
124
|
-
body: _response.error.body,
|
|
125
|
-
rawResponse: _response.rawResponse,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
107
|
+
throw new errors.AgentMailError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.body,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
128
112
|
}
|
|
129
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
113
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/lists/{direction}/{type}");
|
|
130
114
|
});
|
|
131
115
|
}
|
|
132
116
|
/**
|
|
133
117
|
* @param {AgentMail.pods.PodId} pod_id
|
|
134
118
|
* @param {AgentMail.Direction} direction
|
|
135
119
|
* @param {AgentMail.ListType} type
|
|
136
|
-
* @param {
|
|
120
|
+
* @param {string} entry - Email address or domain.
|
|
137
121
|
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
138
122
|
*
|
|
123
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
124
|
+
*
|
|
139
125
|
* @example
|
|
140
|
-
* await client.pods.lists.
|
|
126
|
+
* await client.pods.lists.get("pod_id", "send", "allow", "entry")
|
|
141
127
|
*/
|
|
142
|
-
|
|
143
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
128
|
+
get(pod_id, direction, type, entry, requestOptions) {
|
|
129
|
+
return core.HttpResponsePromise.fromPromise(this.__get(pod_id, direction, type, entry, requestOptions));
|
|
144
130
|
}
|
|
145
|
-
|
|
146
|
-
return __awaiter(this,
|
|
131
|
+
__get(pod_id, direction, type, entry, requestOptions) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
133
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
148
|
-
const { limit, pageToken } = request;
|
|
149
|
-
const _queryParams = {
|
|
150
|
-
limit,
|
|
151
|
-
page_token: pageToken,
|
|
152
|
-
};
|
|
153
134
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
154
135
|
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);
|
|
155
136
|
const _response = yield core.fetcher({
|
|
156
137
|
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)
|
|
157
|
-
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
138
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
|
|
158
139
|
method: "GET",
|
|
159
140
|
headers: _headers,
|
|
160
|
-
queryParameters:
|
|
141
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
161
142
|
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,
|
|
162
143
|
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,
|
|
163
144
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -166,7 +147,7 @@ class ListsClient {
|
|
|
166
147
|
});
|
|
167
148
|
if (_response.ok) {
|
|
168
149
|
return {
|
|
169
|
-
data: serializers.
|
|
150
|
+
data: serializers.PodListEntry.parseOrThrow(_response.body, {
|
|
170
151
|
unrecognizedObjectKeys: "passthrough",
|
|
171
152
|
allowUnrecognizedUnionMembers: true,
|
|
172
153
|
allowUnrecognizedEnumValues: true,
|
|
@@ -177,41 +158,60 @@ class ListsClient {
|
|
|
177
158
|
};
|
|
178
159
|
}
|
|
179
160
|
if (_response.error.reason === "status-code") {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
161
|
+
switch (_response.error.statusCode) {
|
|
162
|
+
case 404:
|
|
163
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
164
|
+
unrecognizedObjectKeys: "passthrough",
|
|
165
|
+
allowUnrecognizedUnionMembers: true,
|
|
166
|
+
allowUnrecognizedEnumValues: true,
|
|
167
|
+
skipValidation: true,
|
|
168
|
+
breadcrumbsPrefix: ["response"],
|
|
169
|
+
}), _response.rawResponse);
|
|
170
|
+
default:
|
|
171
|
+
throw new errors.AgentMailError({
|
|
172
|
+
statusCode: _response.error.statusCode,
|
|
173
|
+
body: _response.error.body,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
185
177
|
}
|
|
186
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/lists/{direction}/{type}");
|
|
178
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}");
|
|
187
179
|
});
|
|
188
180
|
}
|
|
189
181
|
/**
|
|
190
182
|
* @param {AgentMail.pods.PodId} pod_id
|
|
191
183
|
* @param {AgentMail.Direction} direction
|
|
192
184
|
* @param {AgentMail.ListType} type
|
|
193
|
-
* @param {
|
|
185
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
194
186
|
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
187
|
*
|
|
196
|
-
* @throws {@link AgentMail.
|
|
188
|
+
* @throws {@link AgentMail.ValidationError}
|
|
197
189
|
*
|
|
198
190
|
* @example
|
|
199
|
-
* await client.pods.lists.
|
|
191
|
+
* await client.pods.lists.create("pod_id", "send", "allow", {
|
|
192
|
+
* entry: "entry"
|
|
193
|
+
* })
|
|
200
194
|
*/
|
|
201
|
-
|
|
202
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
195
|
+
create(pod_id, direction, type, request, requestOptions) {
|
|
196
|
+
return core.HttpResponsePromise.fromPromise(this.__create(pod_id, direction, type, request, requestOptions));
|
|
203
197
|
}
|
|
204
|
-
|
|
198
|
+
__create(pod_id, direction, type, request, requestOptions) {
|
|
205
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
200
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
207
201
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
202
|
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);
|
|
209
203
|
const _response = yield core.fetcher({
|
|
210
204
|
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)
|
|
211
|
-
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}
|
|
212
|
-
method: "
|
|
205
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
206
|
+
method: "POST",
|
|
213
207
|
headers: _headers,
|
|
208
|
+
contentType: "application/json",
|
|
214
209
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
210
|
+
requestType: "json",
|
|
211
|
+
body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
|
|
212
|
+
unrecognizedObjectKeys: "strip",
|
|
213
|
+
omitUndefined: true,
|
|
214
|
+
}),
|
|
215
215
|
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,
|
|
216
216
|
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,
|
|
217
217
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -232,8 +232,8 @@ class ListsClient {
|
|
|
232
232
|
}
|
|
233
233
|
if (_response.error.reason === "status-code") {
|
|
234
234
|
switch (_response.error.statusCode) {
|
|
235
|
-
case
|
|
236
|
-
throw new AgentMail.
|
|
235
|
+
case 400:
|
|
236
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
237
237
|
unrecognizedObjectKeys: "passthrough",
|
|
238
238
|
allowUnrecognizedUnionMembers: true,
|
|
239
239
|
allowUnrecognizedEnumValues: true,
|
|
@@ -248,7 +248,7 @@ class ListsClient {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
251
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/lists/{direction}/{type}");
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
@@ -47,4 +47,19 @@ export declare class ThreadsClient {
|
|
|
47
47
|
*/
|
|
48
48
|
getAttachment(pod_id: AgentMail.pods.PodId, thread_id: AgentMail.ThreadId, attachment_id: AgentMail.AttachmentId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
|
|
49
49
|
private __getAttachment;
|
|
50
|
+
/**
|
|
51
|
+
* Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
|
|
52
|
+
*
|
|
53
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
54
|
+
* @param {AgentMail.ThreadId} thread_id
|
|
55
|
+
* @param {AgentMail.pods.DeleteThreadRequest} request
|
|
56
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.pods.threads.delete("pod_id", "thread_id")
|
|
62
|
+
*/
|
|
63
|
+
delete(pod_id: AgentMail.pods.PodId, thread_id: AgentMail.ThreadId, request?: AgentMail.pods.DeleteThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
64
|
+
private __delete;
|
|
50
65
|
}
|
|
@@ -268,5 +268,66 @@ class ThreadsClient {
|
|
|
268
268
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}");
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
|
|
273
|
+
*
|
|
274
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
275
|
+
* @param {AgentMail.ThreadId} thread_id
|
|
276
|
+
* @param {AgentMail.pods.DeleteThreadRequest} request
|
|
277
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
278
|
+
*
|
|
279
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* await client.pods.threads.delete("pod_id", "thread_id")
|
|
283
|
+
*/
|
|
284
|
+
delete(pod_id, thread_id, request = {}, requestOptions) {
|
|
285
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, thread_id, request, requestOptions));
|
|
286
|
+
}
|
|
287
|
+
__delete(pod_id_1, thread_id_1) {
|
|
288
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, thread_id, request = {}, requestOptions) {
|
|
289
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
290
|
+
const { permanent } = request;
|
|
291
|
+
const _queryParams = {
|
|
292
|
+
permanent,
|
|
293
|
+
};
|
|
294
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
295
|
+
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);
|
|
296
|
+
const _response = yield core.fetcher({
|
|
297
|
+
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)
|
|
298
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
|
|
299
|
+
method: "DELETE",
|
|
300
|
+
headers: _headers,
|
|
301
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
302
|
+
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,
|
|
303
|
+
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,
|
|
304
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
305
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
306
|
+
logging: this._options.logging,
|
|
307
|
+
});
|
|
308
|
+
if (_response.ok) {
|
|
309
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
310
|
+
}
|
|
311
|
+
if (_response.error.reason === "status-code") {
|
|
312
|
+
switch (_response.error.statusCode) {
|
|
313
|
+
case 404:
|
|
314
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
315
|
+
unrecognizedObjectKeys: "passthrough",
|
|
316
|
+
allowUnrecognizedUnionMembers: true,
|
|
317
|
+
allowUnrecognizedEnumValues: true,
|
|
318
|
+
skipValidation: true,
|
|
319
|
+
breadcrumbsPrefix: ["response"],
|
|
320
|
+
}), _response.rawResponse);
|
|
321
|
+
default:
|
|
322
|
+
throw new errors.AgentMailError({
|
|
323
|
+
statusCode: _response.error.statusCode,
|
|
324
|
+
body: _response.error.body,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/threads/{thread_id}");
|
|
330
|
+
});
|
|
331
|
+
}
|
|
271
332
|
}
|
|
272
333
|
exports.ThreadsClient = ThreadsClient;
|
|
@@ -44,4 +44,18 @@ export declare class ThreadsClient {
|
|
|
44
44
|
*/
|
|
45
45
|
getAttachment(thread_id: AgentMail.ThreadId, attachment_id: AgentMail.AttachmentId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
|
|
46
46
|
private __getAttachment;
|
|
47
|
+
/**
|
|
48
|
+
* Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
|
|
49
|
+
*
|
|
50
|
+
* @param {AgentMail.ThreadId} thread_id
|
|
51
|
+
* @param {AgentMail.DeleteThreadRequest} request
|
|
52
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.threads.delete("thread_id")
|
|
58
|
+
*/
|
|
59
|
+
delete(thread_id: AgentMail.ThreadId, request?: AgentMail.DeleteThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
60
|
+
private __delete;
|
|
47
61
|
}
|
|
@@ -265,5 +265,65 @@ class ThreadsClient {
|
|
|
265
265
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/threads/{thread_id}/attachments/{attachment_id}");
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
|
|
270
|
+
*
|
|
271
|
+
* @param {AgentMail.ThreadId} thread_id
|
|
272
|
+
* @param {AgentMail.DeleteThreadRequest} request
|
|
273
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
274
|
+
*
|
|
275
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* await client.threads.delete("thread_id")
|
|
279
|
+
*/
|
|
280
|
+
delete(thread_id, request = {}, requestOptions) {
|
|
281
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(thread_id, request, requestOptions));
|
|
282
|
+
}
|
|
283
|
+
__delete(thread_id_1) {
|
|
284
|
+
return __awaiter(this, arguments, void 0, function* (thread_id, request = {}, requestOptions) {
|
|
285
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
286
|
+
const { permanent } = request;
|
|
287
|
+
const _queryParams = {
|
|
288
|
+
permanent,
|
|
289
|
+
};
|
|
290
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
291
|
+
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);
|
|
292
|
+
const _response = yield core.fetcher({
|
|
293
|
+
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)
|
|
294
|
+
.http, `/v0/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
|
|
295
|
+
method: "DELETE",
|
|
296
|
+
headers: _headers,
|
|
297
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
298
|
+
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,
|
|
299
|
+
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,
|
|
300
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
301
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
302
|
+
logging: this._options.logging,
|
|
303
|
+
});
|
|
304
|
+
if (_response.ok) {
|
|
305
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
306
|
+
}
|
|
307
|
+
if (_response.error.reason === "status-code") {
|
|
308
|
+
switch (_response.error.statusCode) {
|
|
309
|
+
case 404:
|
|
310
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
311
|
+
unrecognizedObjectKeys: "passthrough",
|
|
312
|
+
allowUnrecognizedUnionMembers: true,
|
|
313
|
+
allowUnrecognizedEnumValues: true,
|
|
314
|
+
skipValidation: true,
|
|
315
|
+
breadcrumbsPrefix: ["response"],
|
|
316
|
+
}), _response.rawResponse);
|
|
317
|
+
default:
|
|
318
|
+
throw new errors.AgentMailError({
|
|
319
|
+
statusCode: _response.error.statusCode,
|
|
320
|
+
body: _response.error.body,
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/threads/{thread_id}");
|
|
326
|
+
});
|
|
327
|
+
}
|
|
268
328
|
}
|
|
269
329
|
exports.ThreadsClient = ThreadsClient;
|
|
@@ -30,19 +30,6 @@ export declare class WebhooksClient {
|
|
|
30
30
|
*/
|
|
31
31
|
get(webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
32
32
|
private __get;
|
|
33
|
-
/**
|
|
34
|
-
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
35
|
-
* @param {AgentMail.webhooks.UpdateWebhookRequest} request
|
|
36
|
-
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
-
*
|
|
38
|
-
* @throws {@link AgentMail.NotFoundError}
|
|
39
|
-
* @throws {@link AgentMail.ValidationError}
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.webhooks.update("webhook_id", {})
|
|
43
|
-
*/
|
|
44
|
-
update(webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
45
|
-
private __update;
|
|
46
33
|
/**
|
|
47
34
|
* @param {AgentMail.webhooks.CreateWebhookRequest} request
|
|
48
35
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -57,6 +44,19 @@ export declare class WebhooksClient {
|
|
|
57
44
|
*/
|
|
58
45
|
create(request: AgentMail.webhooks.CreateWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
59
46
|
private __create;
|
|
47
|
+
/**
|
|
48
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
49
|
+
* @param {AgentMail.webhooks.UpdateWebhookRequest} request
|
|
50
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
+
*
|
|
52
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
53
|
+
* @throws {@link AgentMail.ValidationError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.webhooks.update("webhook_id", {})
|
|
57
|
+
*/
|
|
58
|
+
update(webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
59
|
+
private __update;
|
|
60
60
|
/**
|
|
61
61
|
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
62
62
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|