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
|
@@ -371,36 +371,27 @@ export class DraftsClient {
|
|
|
371
371
|
/**
|
|
372
372
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
373
373
|
* @param {AgentMail.DraftId} draft_id
|
|
374
|
-
* @param {AgentMail.UpdateMessageRequest} request
|
|
375
374
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
376
375
|
*
|
|
377
376
|
* @throws {@link AgentMail.NotFoundError}
|
|
378
|
-
* @throws {@link AgentMail.ValidationError}
|
|
379
|
-
* @throws {@link AgentMail.MessageRejectedError}
|
|
380
377
|
*
|
|
381
378
|
* @example
|
|
382
|
-
* await client.inboxes.drafts.
|
|
379
|
+
* await client.inboxes.drafts.delete("inbox_id", "draft_id")
|
|
383
380
|
*/
|
|
384
|
-
|
|
385
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
381
|
+
delete(inbox_id, draft_id, requestOptions) {
|
|
382
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, draft_id, requestOptions));
|
|
386
383
|
}
|
|
387
|
-
|
|
384
|
+
__delete(inbox_id, draft_id, requestOptions) {
|
|
388
385
|
return __awaiter(this, void 0, void 0, function* () {
|
|
389
386
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
390
387
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
391
388
|
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);
|
|
392
389
|
const _response = yield core.fetcher({
|
|
393
390
|
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)
|
|
394
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}
|
|
395
|
-
method: "
|
|
391
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}`),
|
|
392
|
+
method: "DELETE",
|
|
396
393
|
headers: _headers,
|
|
397
|
-
contentType: "application/json",
|
|
398
394
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
399
|
-
requestType: "json",
|
|
400
|
-
body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
|
|
401
|
-
unrecognizedObjectKeys: "strip",
|
|
402
|
-
omitUndefined: true,
|
|
403
|
-
}),
|
|
404
395
|
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,
|
|
405
396
|
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,
|
|
406
397
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -408,16 +399,7 @@ export class DraftsClient {
|
|
|
408
399
|
logging: this._options.logging,
|
|
409
400
|
});
|
|
410
401
|
if (_response.ok) {
|
|
411
|
-
return {
|
|
412
|
-
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
413
|
-
unrecognizedObjectKeys: "passthrough",
|
|
414
|
-
allowUnrecognizedUnionMembers: true,
|
|
415
|
-
allowUnrecognizedEnumValues: true,
|
|
416
|
-
skipValidation: true,
|
|
417
|
-
breadcrumbsPrefix: ["response"],
|
|
418
|
-
}),
|
|
419
|
-
rawResponse: _response.rawResponse,
|
|
420
|
-
};
|
|
402
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
421
403
|
}
|
|
422
404
|
if (_response.error.reason === "status-code") {
|
|
423
405
|
switch (_response.error.statusCode) {
|
|
@@ -429,22 +411,6 @@ export class DraftsClient {
|
|
|
429
411
|
skipValidation: true,
|
|
430
412
|
breadcrumbsPrefix: ["response"],
|
|
431
413
|
}), _response.rawResponse);
|
|
432
|
-
case 400:
|
|
433
|
-
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
434
|
-
unrecognizedObjectKeys: "passthrough",
|
|
435
|
-
allowUnrecognizedUnionMembers: true,
|
|
436
|
-
allowUnrecognizedEnumValues: true,
|
|
437
|
-
skipValidation: true,
|
|
438
|
-
breadcrumbsPrefix: ["response"],
|
|
439
|
-
}), _response.rawResponse);
|
|
440
|
-
case 403:
|
|
441
|
-
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
442
|
-
unrecognizedObjectKeys: "passthrough",
|
|
443
|
-
allowUnrecognizedUnionMembers: true,
|
|
444
|
-
allowUnrecognizedEnumValues: true,
|
|
445
|
-
skipValidation: true,
|
|
446
|
-
breadcrumbsPrefix: ["response"],
|
|
447
|
-
}), _response.rawResponse);
|
|
448
414
|
default:
|
|
449
415
|
throw new errors.AgentMailError({
|
|
450
416
|
statusCode: _response.error.statusCode,
|
|
@@ -453,33 +419,42 @@ export class DraftsClient {
|
|
|
453
419
|
});
|
|
454
420
|
}
|
|
455
421
|
}
|
|
456
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
422
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/drafts/{draft_id}");
|
|
457
423
|
});
|
|
458
424
|
}
|
|
459
425
|
/**
|
|
460
426
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
461
427
|
* @param {AgentMail.DraftId} draft_id
|
|
428
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
462
429
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
463
430
|
*
|
|
464
431
|
* @throws {@link AgentMail.NotFoundError}
|
|
432
|
+
* @throws {@link AgentMail.ValidationError}
|
|
433
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
465
434
|
*
|
|
466
435
|
* @example
|
|
467
|
-
* await client.inboxes.drafts.
|
|
436
|
+
* await client.inboxes.drafts.send("inbox_id", "draft_id", {})
|
|
468
437
|
*/
|
|
469
|
-
|
|
470
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
438
|
+
send(inbox_id, draft_id, request, requestOptions) {
|
|
439
|
+
return core.HttpResponsePromise.fromPromise(this.__send(inbox_id, draft_id, request, requestOptions));
|
|
471
440
|
}
|
|
472
|
-
|
|
441
|
+
__send(inbox_id, draft_id, request, requestOptions) {
|
|
473
442
|
return __awaiter(this, void 0, void 0, function* () {
|
|
474
443
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
475
444
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
476
445
|
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);
|
|
477
446
|
const _response = yield core.fetcher({
|
|
478
447
|
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)
|
|
479
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}`),
|
|
480
|
-
method: "
|
|
448
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/send`),
|
|
449
|
+
method: "POST",
|
|
481
450
|
headers: _headers,
|
|
451
|
+
contentType: "application/json",
|
|
482
452
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
453
|
+
requestType: "json",
|
|
454
|
+
body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
|
|
455
|
+
unrecognizedObjectKeys: "strip",
|
|
456
|
+
omitUndefined: true,
|
|
457
|
+
}),
|
|
483
458
|
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,
|
|
484
459
|
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,
|
|
485
460
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -487,7 +462,16 @@ export class DraftsClient {
|
|
|
487
462
|
logging: this._options.logging,
|
|
488
463
|
});
|
|
489
464
|
if (_response.ok) {
|
|
490
|
-
return {
|
|
465
|
+
return {
|
|
466
|
+
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
467
|
+
unrecognizedObjectKeys: "passthrough",
|
|
468
|
+
allowUnrecognizedUnionMembers: true,
|
|
469
|
+
allowUnrecognizedEnumValues: true,
|
|
470
|
+
skipValidation: true,
|
|
471
|
+
breadcrumbsPrefix: ["response"],
|
|
472
|
+
}),
|
|
473
|
+
rawResponse: _response.rawResponse,
|
|
474
|
+
};
|
|
491
475
|
}
|
|
492
476
|
if (_response.error.reason === "status-code") {
|
|
493
477
|
switch (_response.error.statusCode) {
|
|
@@ -499,6 +483,22 @@ export class DraftsClient {
|
|
|
499
483
|
skipValidation: true,
|
|
500
484
|
breadcrumbsPrefix: ["response"],
|
|
501
485
|
}), _response.rawResponse);
|
|
486
|
+
case 400:
|
|
487
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
488
|
+
unrecognizedObjectKeys: "passthrough",
|
|
489
|
+
allowUnrecognizedUnionMembers: true,
|
|
490
|
+
allowUnrecognizedEnumValues: true,
|
|
491
|
+
skipValidation: true,
|
|
492
|
+
breadcrumbsPrefix: ["response"],
|
|
493
|
+
}), _response.rawResponse);
|
|
494
|
+
case 403:
|
|
495
|
+
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
496
|
+
unrecognizedObjectKeys: "passthrough",
|
|
497
|
+
allowUnrecognizedUnionMembers: true,
|
|
498
|
+
allowUnrecognizedEnumValues: true,
|
|
499
|
+
skipValidation: true,
|
|
500
|
+
breadcrumbsPrefix: ["response"],
|
|
501
|
+
}), _response.rawResponse);
|
|
502
502
|
default:
|
|
503
503
|
throw new errors.AgentMailError({
|
|
504
504
|
statusCode: _response.error.statusCode,
|
|
@@ -507,7 +507,7 @@ export class DraftsClient {
|
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
510
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/drafts/{draft_id}/send");
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
513
|
}
|
|
@@ -48,10 +48,31 @@ export declare class MessagesClient {
|
|
|
48
48
|
getAttachment(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, attachment_id: AgentMail.AttachmentId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
|
|
49
49
|
private __getAttachment;
|
|
50
50
|
/**
|
|
51
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
52
|
+
* @param {AgentMail.MessageId} message_id
|
|
53
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
51
55
|
* @throws {@link AgentMail.NotFoundError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.inboxes.messages.getRaw("inbox_id", "message_id")
|
|
52
59
|
*/
|
|
53
|
-
getRaw(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<
|
|
60
|
+
getRaw(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.RawMessageResponse>;
|
|
54
61
|
private __getRaw;
|
|
62
|
+
/**
|
|
63
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
64
|
+
* @param {AgentMail.MessageId} message_id
|
|
65
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
66
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link AgentMail.ValidationError}
|
|
69
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.inboxes.messages.update("inbox_id", "message_id", {})
|
|
73
|
+
*/
|
|
74
|
+
update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Message>;
|
|
75
|
+
private __update;
|
|
55
76
|
/**
|
|
56
77
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
57
78
|
* @param {AgentMail.SendMessageRequest} request
|
|
@@ -111,18 +132,4 @@ export declare class MessagesClient {
|
|
|
111
132
|
*/
|
|
112
133
|
forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
113
134
|
private __forward;
|
|
114
|
-
/**
|
|
115
|
-
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
116
|
-
* @param {AgentMail.MessageId} message_id
|
|
117
|
-
* @param {AgentMail.UpdateMessageRequest} request
|
|
118
|
-
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
|
-
*
|
|
120
|
-
* @throws {@link AgentMail.ValidationError}
|
|
121
|
-
* @throws {@link AgentMail.NotFoundError}
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* await client.inboxes.messages.update("inbox_id", "message_id", {})
|
|
125
|
-
*/
|
|
126
|
-
update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Message>;
|
|
127
|
-
private __update;
|
|
128
135
|
}
|
|
@@ -233,7 +233,14 @@ export class MessagesClient {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
237
|
+
* @param {AgentMail.MessageId} message_id
|
|
238
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
239
|
+
*
|
|
236
240
|
* @throws {@link AgentMail.NotFoundError}
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* await client.inboxes.messages.getRaw("inbox_id", "message_id")
|
|
237
244
|
*/
|
|
238
245
|
getRaw(inbox_id, message_id, requestOptions) {
|
|
239
246
|
return core.HttpResponsePromise.fromPromise(this.__getRaw(inbox_id, message_id, requestOptions));
|
|
@@ -249,7 +256,6 @@ export class MessagesClient {
|
|
|
249
256
|
method: "GET",
|
|
250
257
|
headers: _headers,
|
|
251
258
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
252
|
-
responseType: "binary-response",
|
|
253
259
|
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,
|
|
254
260
|
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,
|
|
255
261
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -257,7 +263,16 @@ export class MessagesClient {
|
|
|
257
263
|
logging: this._options.logging,
|
|
258
264
|
});
|
|
259
265
|
if (_response.ok) {
|
|
260
|
-
return {
|
|
266
|
+
return {
|
|
267
|
+
data: serializers.RawMessageResponse.parseOrThrow(_response.body, {
|
|
268
|
+
unrecognizedObjectKeys: "passthrough",
|
|
269
|
+
allowUnrecognizedUnionMembers: true,
|
|
270
|
+
allowUnrecognizedEnumValues: true,
|
|
271
|
+
skipValidation: true,
|
|
272
|
+
breadcrumbsPrefix: ["response"],
|
|
273
|
+
}),
|
|
274
|
+
rawResponse: _response.rawResponse,
|
|
275
|
+
};
|
|
261
276
|
}
|
|
262
277
|
if (_response.error.reason === "status-code") {
|
|
263
278
|
switch (_response.error.statusCode) {
|
|
@@ -282,33 +297,33 @@ export class MessagesClient {
|
|
|
282
297
|
}
|
|
283
298
|
/**
|
|
284
299
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
285
|
-
* @param {AgentMail.
|
|
300
|
+
* @param {AgentMail.MessageId} message_id
|
|
301
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
286
302
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
287
303
|
*
|
|
288
304
|
* @throws {@link AgentMail.ValidationError}
|
|
289
305
|
* @throws {@link AgentMail.NotFoundError}
|
|
290
|
-
* @throws {@link AgentMail.MessageRejectedError}
|
|
291
306
|
*
|
|
292
307
|
* @example
|
|
293
|
-
* await client.inboxes.messages.
|
|
308
|
+
* await client.inboxes.messages.update("inbox_id", "message_id", {})
|
|
294
309
|
*/
|
|
295
|
-
|
|
296
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
310
|
+
update(inbox_id, message_id, request, requestOptions) {
|
|
311
|
+
return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, message_id, request, requestOptions));
|
|
297
312
|
}
|
|
298
|
-
|
|
313
|
+
__update(inbox_id, message_id, request, requestOptions) {
|
|
299
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
300
315
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
301
316
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
302
317
|
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);
|
|
303
318
|
const _response = yield core.fetcher({
|
|
304
319
|
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)
|
|
305
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages
|
|
306
|
-
method: "
|
|
320
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
|
|
321
|
+
method: "PATCH",
|
|
307
322
|
headers: _headers,
|
|
308
323
|
contentType: "application/json",
|
|
309
324
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
310
325
|
requestType: "json",
|
|
311
|
-
body: serializers.
|
|
326
|
+
body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
|
|
312
327
|
unrecognizedObjectKeys: "strip",
|
|
313
328
|
omitUndefined: true,
|
|
314
329
|
}),
|
|
@@ -320,7 +335,7 @@ export class MessagesClient {
|
|
|
320
335
|
});
|
|
321
336
|
if (_response.ok) {
|
|
322
337
|
return {
|
|
323
|
-
data: serializers.
|
|
338
|
+
data: serializers.Message.parseOrThrow(_response.body, {
|
|
324
339
|
unrecognizedObjectKeys: "passthrough",
|
|
325
340
|
allowUnrecognizedUnionMembers: true,
|
|
326
341
|
allowUnrecognizedEnumValues: true,
|
|
@@ -348,14 +363,6 @@ export class MessagesClient {
|
|
|
348
363
|
skipValidation: true,
|
|
349
364
|
breadcrumbsPrefix: ["response"],
|
|
350
365
|
}), _response.rawResponse);
|
|
351
|
-
case 403:
|
|
352
|
-
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
353
|
-
unrecognizedObjectKeys: "passthrough",
|
|
354
|
-
allowUnrecognizedUnionMembers: true,
|
|
355
|
-
allowUnrecognizedEnumValues: true,
|
|
356
|
-
skipValidation: true,
|
|
357
|
-
breadcrumbsPrefix: ["response"],
|
|
358
|
-
}), _response.rawResponse);
|
|
359
366
|
default:
|
|
360
367
|
throw new errors.AgentMailError({
|
|
361
368
|
statusCode: _response.error.statusCode,
|
|
@@ -364,13 +371,12 @@ export class MessagesClient {
|
|
|
364
371
|
});
|
|
365
372
|
}
|
|
366
373
|
}
|
|
367
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
374
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/messages/{message_id}");
|
|
368
375
|
});
|
|
369
376
|
}
|
|
370
377
|
/**
|
|
371
378
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
372
|
-
* @param {AgentMail.
|
|
373
|
-
* @param {AgentMail.ReplyToMessageRequest} request
|
|
379
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
374
380
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
375
381
|
*
|
|
376
382
|
* @throws {@link AgentMail.ValidationError}
|
|
@@ -378,25 +384,25 @@ export class MessagesClient {
|
|
|
378
384
|
* @throws {@link AgentMail.MessageRejectedError}
|
|
379
385
|
*
|
|
380
386
|
* @example
|
|
381
|
-
* await client.inboxes.messages.
|
|
387
|
+
* await client.inboxes.messages.send("inbox_id", {})
|
|
382
388
|
*/
|
|
383
|
-
|
|
384
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
389
|
+
send(inbox_id, request, requestOptions) {
|
|
390
|
+
return core.HttpResponsePromise.fromPromise(this.__send(inbox_id, request, requestOptions));
|
|
385
391
|
}
|
|
386
|
-
|
|
392
|
+
__send(inbox_id, request, requestOptions) {
|
|
387
393
|
return __awaiter(this, void 0, void 0, function* () {
|
|
388
394
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
389
395
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
390
396
|
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);
|
|
391
397
|
const _response = yield core.fetcher({
|
|
392
398
|
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)
|
|
393
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages
|
|
399
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/send`),
|
|
394
400
|
method: "POST",
|
|
395
401
|
headers: _headers,
|
|
396
402
|
contentType: "application/json",
|
|
397
403
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
398
404
|
requestType: "json",
|
|
399
|
-
body: serializers.
|
|
405
|
+
body: serializers.SendMessageRequest.jsonOrThrow(request, {
|
|
400
406
|
unrecognizedObjectKeys: "strip",
|
|
401
407
|
omitUndefined: true,
|
|
402
408
|
}),
|
|
@@ -452,13 +458,13 @@ export class MessagesClient {
|
|
|
452
458
|
});
|
|
453
459
|
}
|
|
454
460
|
}
|
|
455
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/
|
|
461
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/send");
|
|
456
462
|
});
|
|
457
463
|
}
|
|
458
464
|
/**
|
|
459
465
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
460
466
|
* @param {AgentMail.MessageId} message_id
|
|
461
|
-
* @param {AgentMail.
|
|
467
|
+
* @param {AgentMail.ReplyToMessageRequest} request
|
|
462
468
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
463
469
|
*
|
|
464
470
|
* @throws {@link AgentMail.ValidationError}
|
|
@@ -466,25 +472,25 @@ export class MessagesClient {
|
|
|
466
472
|
* @throws {@link AgentMail.MessageRejectedError}
|
|
467
473
|
*
|
|
468
474
|
* @example
|
|
469
|
-
* await client.inboxes.messages.
|
|
475
|
+
* await client.inboxes.messages.reply("inbox_id", "message_id", {})
|
|
470
476
|
*/
|
|
471
|
-
|
|
472
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
477
|
+
reply(inbox_id, message_id, request, requestOptions) {
|
|
478
|
+
return core.HttpResponsePromise.fromPromise(this.__reply(inbox_id, message_id, request, requestOptions));
|
|
473
479
|
}
|
|
474
|
-
|
|
480
|
+
__reply(inbox_id, message_id, request, requestOptions) {
|
|
475
481
|
return __awaiter(this, void 0, void 0, function* () {
|
|
476
482
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
477
483
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
478
484
|
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);
|
|
479
485
|
const _response = yield core.fetcher({
|
|
480
486
|
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)
|
|
481
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply
|
|
487
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply`),
|
|
482
488
|
method: "POST",
|
|
483
489
|
headers: _headers,
|
|
484
490
|
contentType: "application/json",
|
|
485
491
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
486
492
|
requestType: "json",
|
|
487
|
-
body: serializers.
|
|
493
|
+
body: serializers.ReplyToMessageRequest.jsonOrThrow(request, {
|
|
488
494
|
unrecognizedObjectKeys: "strip",
|
|
489
495
|
omitUndefined: true,
|
|
490
496
|
}),
|
|
@@ -540,13 +546,13 @@ export class MessagesClient {
|
|
|
540
546
|
});
|
|
541
547
|
}
|
|
542
548
|
}
|
|
543
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply
|
|
549
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply");
|
|
544
550
|
});
|
|
545
551
|
}
|
|
546
552
|
/**
|
|
547
553
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
548
554
|
* @param {AgentMail.MessageId} message_id
|
|
549
|
-
* @param {AgentMail.
|
|
555
|
+
* @param {AgentMail.ReplyAllMessageRequest} request
|
|
550
556
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
551
557
|
*
|
|
552
558
|
* @throws {@link AgentMail.ValidationError}
|
|
@@ -554,25 +560,25 @@ export class MessagesClient {
|
|
|
554
560
|
* @throws {@link AgentMail.MessageRejectedError}
|
|
555
561
|
*
|
|
556
562
|
* @example
|
|
557
|
-
* await client.inboxes.messages.
|
|
563
|
+
* await client.inboxes.messages.replyAll("inbox_id", "message_id", {})
|
|
558
564
|
*/
|
|
559
|
-
|
|
560
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
565
|
+
replyAll(inbox_id, message_id, request, requestOptions) {
|
|
566
|
+
return core.HttpResponsePromise.fromPromise(this.__replyAll(inbox_id, message_id, request, requestOptions));
|
|
561
567
|
}
|
|
562
|
-
|
|
568
|
+
__replyAll(inbox_id, message_id, request, requestOptions) {
|
|
563
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
564
570
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
565
571
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
566
572
|
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);
|
|
567
573
|
const _response = yield core.fetcher({
|
|
568
574
|
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)
|
|
569
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/
|
|
575
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply-all`),
|
|
570
576
|
method: "POST",
|
|
571
577
|
headers: _headers,
|
|
572
578
|
contentType: "application/json",
|
|
573
579
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
574
580
|
requestType: "json",
|
|
575
|
-
body: serializers.
|
|
581
|
+
body: serializers.ReplyAllMessageRequest.jsonOrThrow(request, {
|
|
576
582
|
unrecognizedObjectKeys: "strip",
|
|
577
583
|
omitUndefined: true,
|
|
578
584
|
}),
|
|
@@ -628,38 +634,39 @@ export class MessagesClient {
|
|
|
628
634
|
});
|
|
629
635
|
}
|
|
630
636
|
}
|
|
631
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/
|
|
637
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all");
|
|
632
638
|
});
|
|
633
639
|
}
|
|
634
640
|
/**
|
|
635
641
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
636
642
|
* @param {AgentMail.MessageId} message_id
|
|
637
|
-
* @param {AgentMail.
|
|
643
|
+
* @param {AgentMail.SendMessageRequest} request
|
|
638
644
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
639
645
|
*
|
|
640
646
|
* @throws {@link AgentMail.ValidationError}
|
|
641
647
|
* @throws {@link AgentMail.NotFoundError}
|
|
648
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
642
649
|
*
|
|
643
650
|
* @example
|
|
644
|
-
* await client.inboxes.messages.
|
|
651
|
+
* await client.inboxes.messages.forward("inbox_id", "message_id", {})
|
|
645
652
|
*/
|
|
646
|
-
|
|
647
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
653
|
+
forward(inbox_id, message_id, request, requestOptions) {
|
|
654
|
+
return core.HttpResponsePromise.fromPromise(this.__forward(inbox_id, message_id, request, requestOptions));
|
|
648
655
|
}
|
|
649
|
-
|
|
656
|
+
__forward(inbox_id, message_id, request, requestOptions) {
|
|
650
657
|
return __awaiter(this, void 0, void 0, function* () {
|
|
651
658
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
652
659
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
653
660
|
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);
|
|
654
661
|
const _response = yield core.fetcher({
|
|
655
662
|
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)
|
|
656
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
|
|
657
|
-
method: "
|
|
663
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
|
|
664
|
+
method: "POST",
|
|
658
665
|
headers: _headers,
|
|
659
666
|
contentType: "application/json",
|
|
660
667
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
661
668
|
requestType: "json",
|
|
662
|
-
body: serializers.
|
|
669
|
+
body: serializers.SendMessageRequest.jsonOrThrow(request, {
|
|
663
670
|
unrecognizedObjectKeys: "strip",
|
|
664
671
|
omitUndefined: true,
|
|
665
672
|
}),
|
|
@@ -671,7 +678,7 @@ export class MessagesClient {
|
|
|
671
678
|
});
|
|
672
679
|
if (_response.ok) {
|
|
673
680
|
return {
|
|
674
|
-
data: serializers.
|
|
681
|
+
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
675
682
|
unrecognizedObjectKeys: "passthrough",
|
|
676
683
|
allowUnrecognizedUnionMembers: true,
|
|
677
684
|
allowUnrecognizedEnumValues: true,
|
|
@@ -699,6 +706,14 @@ export class MessagesClient {
|
|
|
699
706
|
skipValidation: true,
|
|
700
707
|
breadcrumbsPrefix: ["response"],
|
|
701
708
|
}), _response.rawResponse);
|
|
709
|
+
case 403:
|
|
710
|
+
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
711
|
+
unrecognizedObjectKeys: "passthrough",
|
|
712
|
+
allowUnrecognizedUnionMembers: true,
|
|
713
|
+
allowUnrecognizedEnumValues: true,
|
|
714
|
+
skipValidation: true,
|
|
715
|
+
breadcrumbsPrefix: ["response"],
|
|
716
|
+
}), _response.rawResponse);
|
|
702
717
|
default:
|
|
703
718
|
throw new errors.AgentMailError({
|
|
704
719
|
statusCode: _response.error.statusCode,
|
|
@@ -707,7 +722,7 @@ export class MessagesClient {
|
|
|
707
722
|
});
|
|
708
723
|
}
|
|
709
724
|
}
|
|
710
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
725
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
|
|
711
726
|
});
|
|
712
727
|
}
|
|
713
728
|
}
|
|
@@ -10,21 +10,6 @@ export declare namespace ListsClient {
|
|
|
10
10
|
export declare class ListsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ListsClient.Options>;
|
|
12
12
|
constructor(options?: ListsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* @param {AgentMail.Direction} direction
|
|
15
|
-
* @param {AgentMail.ListType} type
|
|
16
|
-
* @param {AgentMail.CreateListEntryRequest} request
|
|
17
|
-
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
-
*
|
|
19
|
-
* @throws {@link AgentMail.ValidationError}
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* await client.lists.create("send", "allow", {
|
|
23
|
-
* entry: "entry"
|
|
24
|
-
* })
|
|
25
|
-
*/
|
|
26
|
-
create(direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
|
|
27
|
-
private __create;
|
|
28
13
|
/**
|
|
29
14
|
* @param {AgentMail.Direction} direction
|
|
30
15
|
* @param {AgentMail.ListType} type
|
|
@@ -49,6 +34,21 @@ export declare class ListsClient {
|
|
|
49
34
|
*/
|
|
50
35
|
get(direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
|
|
51
36
|
private __get;
|
|
37
|
+
/**
|
|
38
|
+
* @param {AgentMail.Direction} direction
|
|
39
|
+
* @param {AgentMail.ListType} type
|
|
40
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
41
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
+
*
|
|
43
|
+
* @throws {@link AgentMail.ValidationError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.lists.create("send", "allow", {
|
|
47
|
+
* entry: "entry"
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
create(direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
|
|
51
|
+
private __create;
|
|
52
52
|
/**
|
|
53
53
|
* @param {AgentMail.Direction} direction
|
|
54
54
|
* @param {AgentMail.ListType} type
|