revdoku 0.0.0-stage → 2.2.0
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/LICENSE +21 -0
- package/README.md +250 -2
- package/REFERENCE.md +654 -0
- package/dist/apis/DefaultApi.d.ts +1643 -0
- package/dist/apis/DefaultApi.js +3161 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +19 -0
- package/dist/client.d.ts +74 -0
- package/dist/client.js +241 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/models/AccountIdentity.d.ts +77 -0
- package/dist/models/AccountIdentity.js +90 -0
- package/dist/models/AccountIdentityAgencyAccount.d.ts +34 -0
- package/dist/models/AccountIdentityAgencyAccount.js +50 -0
- package/dist/models/AccountIdentityPermissions.d.ts +55 -0
- package/dist/models/AccountIdentityPermissions.js +68 -0
- package/dist/models/AccountLimits.d.ts +106 -0
- package/dist/models/AccountLimits.js +126 -0
- package/dist/models/AccountList.d.ts +40 -0
- package/dist/models/AccountList.js +60 -0
- package/dist/models/ActionRequest.d.ts +34 -0
- package/dist/models/ActionRequest.js +50 -0
- package/dist/models/AddUploadSessionFilesRequest.d.ts +39 -0
- package/dist/models/AddUploadSessionFilesRequest.js +55 -0
- package/dist/models/AgentConnection.d.ts +99 -0
- package/dist/models/AgentConnection.js +93 -0
- package/dist/models/ApiError.d.ts +35 -0
- package/dist/models/ApiError.js +55 -0
- package/dist/models/ApiErrorError.d.ts +62 -0
- package/dist/models/ApiErrorError.js +69 -0
- package/dist/models/AppendText200Response.d.ts +35 -0
- package/dist/models/AppendText200Response.js +55 -0
- package/dist/models/AppendTextRequest.d.ts +50 -0
- package/dist/models/AppendTextRequest.js +62 -0
- package/dist/models/AppendTextResult.d.ts +52 -0
- package/dist/models/AppendTextResult.js +72 -0
- package/dist/models/BrowserLink.d.ts +46 -0
- package/dist/models/BrowserLink.js +60 -0
- package/dist/models/ChangeMailboxAddressRequest.d.ts +54 -0
- package/dist/models/ChangeMailboxAddressRequest.js +64 -0
- package/dist/models/CheckEmailDomain200Response.d.ts +35 -0
- package/dist/models/CheckEmailDomain200Response.js +55 -0
- package/dist/models/CodeRequested.d.ts +46 -0
- package/dist/models/CodeRequested.js +56 -0
- package/dist/models/Connection.d.ts +112 -0
- package/dist/models/Connection.js +99 -0
- package/dist/models/ConnectionPermissions.d.ts +38 -0
- package/dist/models/ConnectionPermissions.js +52 -0
- package/dist/models/ConnectionRenewal.d.ts +38 -0
- package/dist/models/ConnectionRenewal.js +52 -0
- package/dist/models/CreateBrowserLink201Response.d.ts +35 -0
- package/dist/models/CreateBrowserLink201Response.js +55 -0
- package/dist/models/CreateBrowserLinkRequest.d.ts +38 -0
- package/dist/models/CreateBrowserLinkRequest.js +52 -0
- package/dist/models/CreateClientAccount201Response.d.ts +35 -0
- package/dist/models/CreateClientAccount201Response.js +55 -0
- package/dist/models/CreateClientAccount201ResponseData.d.ts +31 -0
- package/dist/models/CreateClientAccount201ResponseData.js +51 -0
- package/dist/models/CreateClientAccountRequest.d.ts +42 -0
- package/dist/models/CreateClientAccountRequest.js +56 -0
- package/dist/models/CreateEmailAliasRequest.d.ts +42 -0
- package/dist/models/CreateEmailAliasRequest.js +56 -0
- package/dist/models/CreateEmailDomain201Response.d.ts +35 -0
- package/dist/models/CreateEmailDomain201Response.js +55 -0
- package/dist/models/CreateEmailDomain201ResponseData.d.ts +31 -0
- package/dist/models/CreateEmailDomain201ResponseData.js +51 -0
- package/dist/models/CreateEmailDomainRequest.d.ts +38 -0
- package/dist/models/CreateEmailDomainRequest.js +54 -0
- package/dist/models/CreateMailbox201Response.d.ts +35 -0
- package/dist/models/CreateMailbox201Response.js +55 -0
- package/dist/models/CreateMailbox201ResponseData.d.ts +31 -0
- package/dist/models/CreateMailbox201ResponseData.js +51 -0
- package/dist/models/CreateMailboxRequest.d.ts +39 -0
- package/dist/models/CreateMailboxRequest.js +53 -0
- package/dist/models/CreateUploadSession201Response.d.ts +35 -0
- package/dist/models/CreateUploadSession201Response.js +55 -0
- package/dist/models/CreateUploadSessionRequest.d.ts +63 -0
- package/dist/models/CreateUploadSessionRequest.js +69 -0
- package/dist/models/DecodedEmailAddress.d.ts +34 -0
- package/dist/models/DecodedEmailAddress.js +54 -0
- package/dist/models/DecodedIncomingMessage.d.ts +151 -0
- package/dist/models/DecodedIncomingMessage.js +142 -0
- package/dist/models/DecodedIncomingMessageAttachmentsInner.d.ts +56 -0
- package/dist/models/DecodedIncomingMessageAttachmentsInner.js +74 -0
- package/dist/models/DeleteEmailDomain200Response.d.ts +35 -0
- package/dist/models/DeleteEmailDomain200Response.js +55 -0
- package/dist/models/DeleteEmailDomainRequest.d.ts +42 -0
- package/dist/models/DeleteEmailDomainRequest.js +58 -0
- package/dist/models/DeleteMailboxRequest.d.ts +38 -0
- package/dist/models/DeleteMailboxRequest.js +54 -0
- package/dist/models/DeleteResult.d.ts +34 -0
- package/dist/models/DeleteResult.js +54 -0
- package/dist/models/DnsRecord.d.ts +50 -0
- package/dist/models/DnsRecord.js +70 -0
- package/dist/models/Download.d.ts +53 -0
- package/dist/models/Download.js +75 -0
- package/dist/models/EmailAlias.d.ts +38 -0
- package/dist/models/EmailAlias.js +58 -0
- package/dist/models/EmailAttachment.d.ts +60 -0
- package/dist/models/EmailAttachment.js +76 -0
- package/dist/models/EmailDelivery.d.ts +49 -0
- package/dist/models/EmailDelivery.js +67 -0
- package/dist/models/EmailDetail.d.ts +167 -0
- package/dist/models/EmailDetail.js +157 -0
- package/dist/models/EmailDomain.d.ts +101 -0
- package/dist/models/EmailDomain.js +92 -0
- package/dist/models/EmailDomainAssignedMailboxesInner.d.ts +35 -0
- package/dist/models/EmailDomainAssignedMailboxesInner.js +51 -0
- package/dist/models/EmailDomainAssignedMailboxesInnerEmail.d.ts +30 -0
- package/dist/models/EmailDomainAssignedMailboxesInnerEmail.js +48 -0
- package/dist/models/EmailDomainCheck.d.ts +42 -0
- package/dist/models/EmailDomainCheck.js +58 -0
- package/dist/models/EmailDomainError.d.ts +38 -0
- package/dist/models/EmailDomainError.js +52 -0
- package/dist/models/EmailDomainList.d.ts +44 -0
- package/dist/models/EmailDomainList.js +62 -0
- package/dist/models/EmailForwarding.d.ts +77 -0
- package/dist/models/EmailForwarding.js +89 -0
- package/dist/models/EmailForwardingContent.d.ts +95 -0
- package/dist/models/EmailForwardingContent.js +102 -0
- package/dist/models/EmailLabel.d.ts +51 -0
- package/dist/models/EmailLabel.js +71 -0
- package/dist/models/EmailList.d.ts +36 -0
- package/dist/models/EmailList.js +56 -0
- package/dist/models/EmailReceivedEvent.d.ts +50 -0
- package/dist/models/EmailReceivedEvent.js +73 -0
- package/dist/models/EmailReceivedEventData.d.ts +46 -0
- package/dist/models/EmailReceivedEventData.js +67 -0
- package/dist/models/EmailSenderAllowlist.d.ts +46 -0
- package/dist/models/EmailSenderAllowlist.js +66 -0
- package/dist/models/EmailSubscription.d.ts +64 -0
- package/dist/models/EmailSubscription.js +87 -0
- package/dist/models/EmailSummary.d.ts +158 -0
- package/dist/models/EmailSummary.js +146 -0
- package/dist/models/EmailSummaryFiles.d.ts +42 -0
- package/dist/models/EmailSummaryFiles.js +60 -0
- package/dist/models/ErrorCode.d.ts +172 -0
- package/dist/models/ErrorCode.js +198 -0
- package/dist/models/ExchangeConnectionGrantRequest.d.ts +42 -0
- package/dist/models/ExchangeConnectionGrantRequest.js +56 -0
- package/dist/models/FileActor.d.ts +38 -0
- package/dist/models/FileActor.js +52 -0
- package/dist/models/FileDownload.d.ts +40 -0
- package/dist/models/FileDownload.js +58 -0
- package/dist/models/FileKey.d.ts +38 -0
- package/dist/models/FileKey.js +52 -0
- package/dist/models/FileList.d.ts +36 -0
- package/dist/models/FileList.js +56 -0
- package/dist/models/FileUploadSkip.d.ts +52 -0
- package/dist/models/FileUploadSkip.js +58 -0
- package/dist/models/FileVersion.d.ts +128 -0
- package/dist/models/FileVersion.js +101 -0
- package/dist/models/FileVersionList.d.ts +36 -0
- package/dist/models/FileVersionList.js +56 -0
- package/dist/models/FileVersionReason.d.ts +46 -0
- package/dist/models/FileVersionReason.js +57 -0
- package/dist/models/FinalizeUploadSessionRequest.d.ts +38 -0
- package/dist/models/FinalizeUploadSessionRequest.js +52 -0
- package/dist/models/GetAccountLimits200Response.d.ts +35 -0
- package/dist/models/GetAccountLimits200Response.js +55 -0
- package/dist/models/GetAccountLimits200ResponseData.d.ts +40 -0
- package/dist/models/GetAccountLimits200ResponseData.js +58 -0
- package/dist/models/GetAccountLimits200ResponseDataUsage.d.ts +31 -0
- package/dist/models/GetAccountLimits200ResponseDataUsage.js +49 -0
- package/dist/models/GetAccountLimits200ResponseDataUsageMailboxCreations.d.ts +42 -0
- package/dist/models/GetAccountLimits200ResponseDataUsageMailboxCreations.js +55 -0
- package/dist/models/GetEmail200Response.d.ts +35 -0
- package/dist/models/GetEmail200Response.js +55 -0
- package/dist/models/GetEmail200ResponseData.d.ts +31 -0
- package/dist/models/GetEmail200ResponseData.js +51 -0
- package/dist/models/GetEmailDomainSetupLink200Response.d.ts +35 -0
- package/dist/models/GetEmailDomainSetupLink200Response.js +55 -0
- package/dist/models/GetEmailDomainSetupLink200ResponseData.d.ts +31 -0
- package/dist/models/GetEmailDomainSetupLink200ResponseData.js +51 -0
- package/dist/models/GetEmailDomainSetupLink200ResponseDataSetupLink.d.ts +34 -0
- package/dist/models/GetEmailDomainSetupLink200ResponseDataSetupLink.js +54 -0
- package/dist/models/GetEmailOriginalDownload200Response.d.ts +35 -0
- package/dist/models/GetEmailOriginalDownload200Response.js +55 -0
- package/dist/models/GetEmailOriginalDownload200ResponseData.d.ts +31 -0
- package/dist/models/GetEmailOriginalDownload200ResponseData.js +51 -0
- package/dist/models/GetEmailSubscription200Response.d.ts +35 -0
- package/dist/models/GetEmailSubscription200Response.js +55 -0
- package/dist/models/GetEmailSubscription200ResponseData.d.ts +31 -0
- package/dist/models/GetEmailSubscription200ResponseData.js +51 -0
- package/dist/models/GetEmailWebhook200Response.d.ts +35 -0
- package/dist/models/GetEmailWebhook200Response.js +55 -0
- package/dist/models/GetEmailWebhook200ResponseData.d.ts +31 -0
- package/dist/models/GetEmailWebhook200ResponseData.js +51 -0
- package/dist/models/GetFileByPath200Response.d.ts +35 -0
- package/dist/models/GetFileByPath200Response.js +55 -0
- package/dist/models/GetFileByPath200ResponseData.d.ts +31 -0
- package/dist/models/GetFileByPath200ResponseData.js +51 -0
- package/dist/models/GetFileDownload200Response.d.ts +35 -0
- package/dist/models/GetFileDownload200Response.js +55 -0
- package/dist/models/GetMailboxEmailSettings200Response.d.ts +35 -0
- package/dist/models/GetMailboxEmailSettings200Response.js +55 -0
- package/dist/models/GetStatus200Response.d.ts +35 -0
- package/dist/models/GetStatus200Response.js +55 -0
- package/dist/models/ListAccounts200Response.d.ts +35 -0
- package/dist/models/ListAccounts200Response.js +55 -0
- package/dist/models/ListEmailDomains200Response.d.ts +35 -0
- package/dist/models/ListEmailDomains200Response.js +55 -0
- package/dist/models/ListEmails200Response.d.ts +35 -0
- package/dist/models/ListEmails200Response.js +55 -0
- package/dist/models/ListFileVersions200Response.d.ts +35 -0
- package/dist/models/ListFileVersions200Response.js +55 -0
- package/dist/models/ListFiles200Response.d.ts +35 -0
- package/dist/models/ListFiles200Response.js +55 -0
- package/dist/models/ListMailboxes200Response.d.ts +35 -0
- package/dist/models/ListMailboxes200Response.js +55 -0
- package/dist/models/Mailbox.d.ts +111 -0
- package/dist/models/Mailbox.js +110 -0
- package/dist/models/MailboxAction.d.ts +42 -0
- package/dist/models/MailboxAction.js +56 -0
- package/dist/models/MailboxCounts.d.ts +38 -0
- package/dist/models/MailboxCounts.js +58 -0
- package/dist/models/MailboxCreate.d.ts +45 -0
- package/dist/models/MailboxCreate.js +55 -0
- package/dist/models/MailboxEmail.d.ts +58 -0
- package/dist/models/MailboxEmail.js +73 -0
- package/dist/models/MailboxEmailOptions.d.ts +34 -0
- package/dist/models/MailboxEmailOptions.js +50 -0
- package/dist/models/MailboxEmailSettings.d.ts +87 -0
- package/dist/models/MailboxEmailSettings.js +92 -0
- package/dist/models/MailboxEmailSettingsAssignment.d.ts +52 -0
- package/dist/models/MailboxEmailSettingsAssignment.js +64 -0
- package/dist/models/MailboxEmailSettingsAssignmentError.d.ts +38 -0
- package/dist/models/MailboxEmailSettingsAssignmentError.js +52 -0
- package/dist/models/MailboxEmailSettingsAvailableDomainsInner.d.ts +42 -0
- package/dist/models/MailboxEmailSettingsAvailableDomainsInner.js +58 -0
- package/dist/models/MailboxEmailSettingsCustomization.d.ts +38 -0
- package/dist/models/MailboxEmailSettingsCustomization.js +52 -0
- package/dist/models/MailboxFile.d.ts +128 -0
- package/dist/models/MailboxFile.js +99 -0
- package/dist/models/MailboxList.d.ts +41 -0
- package/dist/models/MailboxList.js +61 -0
- package/dist/models/MailboxLock.d.ts +58 -0
- package/dist/models/MailboxLock.js +65 -0
- package/dist/models/MailboxUpdate.d.ts +40 -0
- package/dist/models/MailboxUpdate.js +52 -0
- package/dist/models/MoveFileRequest.d.ts +46 -0
- package/dist/models/MoveFileRequest.js +56 -0
- package/dist/models/Pagination.d.ts +38 -0
- package/dist/models/Pagination.js +58 -0
- package/dist/models/PathOperationResult.d.ts +73 -0
- package/dist/models/PathOperationResult.js +81 -0
- package/dist/models/PrepareFileUpload201Response.d.ts +35 -0
- package/dist/models/PrepareFileUpload201Response.js +55 -0
- package/dist/models/PrepareFileUploadRequest.d.ts +59 -0
- package/dist/models/PrepareFileUploadRequest.js +73 -0
- package/dist/models/PreparedFileUpload.d.ts +79 -0
- package/dist/models/PreparedFileUpload.js +73 -0
- package/dist/models/RenameFile200Response.d.ts +35 -0
- package/dist/models/RenameFile200Response.js +55 -0
- package/dist/models/RenameFileRequest.d.ts +38 -0
- package/dist/models/RenameFileRequest.js +54 -0
- package/dist/models/RequestSignInCode200Response.d.ts +35 -0
- package/dist/models/RequestSignInCode200Response.js +55 -0
- package/dist/models/RequestSignInCodeRequest.d.ts +38 -0
- package/dist/models/RequestSignInCodeRequest.js +54 -0
- package/dist/models/RestoreFileVersion201Response.d.ts +35 -0
- package/dist/models/RestoreFileVersion201Response.js +55 -0
- package/dist/models/RestoredFileVersion.d.ts +40 -0
- package/dist/models/RestoredFileVersion.js +60 -0
- package/dist/models/SaveUploadSessionBatchRequest.d.ts +38 -0
- package/dist/models/SaveUploadSessionBatchRequest.js +52 -0
- package/dist/models/SaveUploadedFile201Response.d.ts +35 -0
- package/dist/models/SaveUploadedFile201Response.js +55 -0
- package/dist/models/SaveUploadedFileRequest.d.ts +78 -0
- package/dist/models/SaveUploadedFileRequest.js +85 -0
- package/dist/models/SavedFile.d.ts +49 -0
- package/dist/models/SavedFile.js +65 -0
- package/dist/models/SendEmail202Response.d.ts +35 -0
- package/dist/models/SendEmail202Response.js +55 -0
- package/dist/models/SendEmail202ResponseData.d.ts +31 -0
- package/dist/models/SendEmail202ResponseData.js +51 -0
- package/dist/models/SendEmailRequest.d.ts +62 -0
- package/dist/models/SendEmailRequest.js +66 -0
- package/dist/models/SetEmailWebhook200Response.d.ts +35 -0
- package/dist/models/SetEmailWebhook200Response.js +55 -0
- package/dist/models/SetEmailWebhook200ResponseData.d.ts +31 -0
- package/dist/models/SetEmailWebhook200ResponseData.js +51 -0
- package/dist/models/SetEmailWebhookRequest.d.ts +42 -0
- package/dist/models/SetEmailWebhookRequest.js +56 -0
- package/dist/models/Status.d.ts +73 -0
- package/dist/models/Status.js +75 -0
- package/dist/models/StatusFeatures.d.ts +30 -0
- package/dist/models/StatusFeatures.js +48 -0
- package/dist/models/StatusUser.d.ts +38 -0
- package/dist/models/StatusUser.js +52 -0
- package/dist/models/StorageUpload.d.ts +36 -0
- package/dist/models/StorageUpload.js +54 -0
- package/dist/models/UpdateEmailAllowlist200Response.d.ts +35 -0
- package/dist/models/UpdateEmailAllowlist200Response.js +55 -0
- package/dist/models/UpdateEmailAllowlist200ResponseData.d.ts +31 -0
- package/dist/models/UpdateEmailAllowlist200ResponseData.js +51 -0
- package/dist/models/UpdateEmailAllowlistRequest.d.ts +43 -0
- package/dist/models/UpdateEmailAllowlistRequest.js +59 -0
- package/dist/models/UpdateEmailAllowlistRequestSenderAllowlist.d.ts +34 -0
- package/dist/models/UpdateEmailAllowlistRequestSenderAllowlist.js +54 -0
- package/dist/models/UpdateEmailRequest.d.ts +46 -0
- package/dist/models/UpdateEmailRequest.js +56 -0
- package/dist/models/UpdateMailboxRequest.d.ts +43 -0
- package/dist/models/UpdateMailboxRequest.js +57 -0
- package/dist/models/UploadBlob.d.ts +57 -0
- package/dist/models/UploadBlob.js +79 -0
- package/dist/models/UploadSession.d.ts +94 -0
- package/dist/models/UploadSession.js +91 -0
- package/dist/models/UploadSessionFile.d.ts +46 -0
- package/dist/models/UploadSessionFile.js +66 -0
- package/dist/models/UploadSessionResult.d.ts +82 -0
- package/dist/models/UploadSessionResult.js +86 -0
- package/dist/models/UploadSessionUpload.d.ts +47 -0
- package/dist/models/UploadSessionUpload.js +61 -0
- package/dist/models/UploadedFile.d.ts +48 -0
- package/dist/models/UploadedFile.js +66 -0
- package/dist/models/VerifyEmailDomainRequest.d.ts +34 -0
- package/dist/models/VerifyEmailDomainRequest.js +50 -0
- package/dist/models/VerifySignInCode201Response.d.ts +35 -0
- package/dist/models/VerifySignInCode201Response.js +55 -0
- package/dist/models/VerifySignInCodeRequest.d.ts +89 -0
- package/dist/models/VerifySignInCodeRequest.js +91 -0
- package/dist/models/Webhook.d.ts +41 -0
- package/dist/models/Webhook.js +63 -0
- package/dist/models/WebhookWithSecret.d.ts +45 -0
- package/dist/models/WebhookWithSecret.js +65 -0
- package/dist/models/index.d.ts +158 -0
- package/dist/models/index.js +176 -0
- package/dist/runtime.d.ts +196 -0
- package/dist/runtime.js +421 -0
- package/package.json +54 -4
|
@@ -0,0 +1,3161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Revdoku API
|
|
6
|
+
* Mailboxes for AI agents, with private file storage. Create mailboxes, read and reply to email, and store files. Guide: https://revdoku.com/api.md. Create an account at https://app.revdoku.com/users/sign_up.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2.2.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ListMailboxesStatusEnum = exports.ListEmailsDirectionEnum = exports.ListEmailsOrderEnum = exports.DefaultApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const ActionRequest_1 = require("../models/ActionRequest");
|
|
28
|
+
const AddUploadSessionFilesRequest_1 = require("../models/AddUploadSessionFilesRequest");
|
|
29
|
+
const AppendText200Response_1 = require("../models/AppendText200Response");
|
|
30
|
+
const AppendTextRequest_1 = require("../models/AppendTextRequest");
|
|
31
|
+
const ChangeMailboxAddressRequest_1 = require("../models/ChangeMailboxAddressRequest");
|
|
32
|
+
const CheckEmailDomain200Response_1 = require("../models/CheckEmailDomain200Response");
|
|
33
|
+
const CreateBrowserLink201Response_1 = require("../models/CreateBrowserLink201Response");
|
|
34
|
+
const CreateBrowserLinkRequest_1 = require("../models/CreateBrowserLinkRequest");
|
|
35
|
+
const CreateClientAccount201Response_1 = require("../models/CreateClientAccount201Response");
|
|
36
|
+
const CreateClientAccountRequest_1 = require("../models/CreateClientAccountRequest");
|
|
37
|
+
const CreateEmailAliasRequest_1 = require("../models/CreateEmailAliasRequest");
|
|
38
|
+
const CreateEmailDomain201Response_1 = require("../models/CreateEmailDomain201Response");
|
|
39
|
+
const CreateEmailDomainRequest_1 = require("../models/CreateEmailDomainRequest");
|
|
40
|
+
const CreateMailbox201Response_1 = require("../models/CreateMailbox201Response");
|
|
41
|
+
const CreateMailboxRequest_1 = require("../models/CreateMailboxRequest");
|
|
42
|
+
const CreateUploadSession201Response_1 = require("../models/CreateUploadSession201Response");
|
|
43
|
+
const CreateUploadSessionRequest_1 = require("../models/CreateUploadSessionRequest");
|
|
44
|
+
const DeleteEmailDomain200Response_1 = require("../models/DeleteEmailDomain200Response");
|
|
45
|
+
const DeleteEmailDomainRequest_1 = require("../models/DeleteEmailDomainRequest");
|
|
46
|
+
const DeleteMailboxRequest_1 = require("../models/DeleteMailboxRequest");
|
|
47
|
+
const ExchangeConnectionGrantRequest_1 = require("../models/ExchangeConnectionGrantRequest");
|
|
48
|
+
const FinalizeUploadSessionRequest_1 = require("../models/FinalizeUploadSessionRequest");
|
|
49
|
+
const GetAccountLimits200Response_1 = require("../models/GetAccountLimits200Response");
|
|
50
|
+
const GetEmail200Response_1 = require("../models/GetEmail200Response");
|
|
51
|
+
const GetEmailDomainSetupLink200Response_1 = require("../models/GetEmailDomainSetupLink200Response");
|
|
52
|
+
const GetEmailOriginalDownload200Response_1 = require("../models/GetEmailOriginalDownload200Response");
|
|
53
|
+
const GetEmailSubscription200Response_1 = require("../models/GetEmailSubscription200Response");
|
|
54
|
+
const GetEmailWebhook200Response_1 = require("../models/GetEmailWebhook200Response");
|
|
55
|
+
const GetFileByPath200Response_1 = require("../models/GetFileByPath200Response");
|
|
56
|
+
const GetFileDownload200Response_1 = require("../models/GetFileDownload200Response");
|
|
57
|
+
const GetMailboxEmailSettings200Response_1 = require("../models/GetMailboxEmailSettings200Response");
|
|
58
|
+
const GetStatus200Response_1 = require("../models/GetStatus200Response");
|
|
59
|
+
const ListAccounts200Response_1 = require("../models/ListAccounts200Response");
|
|
60
|
+
const ListEmailDomains200Response_1 = require("../models/ListEmailDomains200Response");
|
|
61
|
+
const ListEmails200Response_1 = require("../models/ListEmails200Response");
|
|
62
|
+
const ListFileVersions200Response_1 = require("../models/ListFileVersions200Response");
|
|
63
|
+
const ListFiles200Response_1 = require("../models/ListFiles200Response");
|
|
64
|
+
const ListMailboxes200Response_1 = require("../models/ListMailboxes200Response");
|
|
65
|
+
const MoveFileRequest_1 = require("../models/MoveFileRequest");
|
|
66
|
+
const PrepareFileUpload201Response_1 = require("../models/PrepareFileUpload201Response");
|
|
67
|
+
const PrepareFileUploadRequest_1 = require("../models/PrepareFileUploadRequest");
|
|
68
|
+
const RenameFile200Response_1 = require("../models/RenameFile200Response");
|
|
69
|
+
const RenameFileRequest_1 = require("../models/RenameFileRequest");
|
|
70
|
+
const RequestSignInCode200Response_1 = require("../models/RequestSignInCode200Response");
|
|
71
|
+
const RequestSignInCodeRequest_1 = require("../models/RequestSignInCodeRequest");
|
|
72
|
+
const RestoreFileVersion201Response_1 = require("../models/RestoreFileVersion201Response");
|
|
73
|
+
const SaveUploadSessionBatchRequest_1 = require("../models/SaveUploadSessionBatchRequest");
|
|
74
|
+
const SaveUploadedFile201Response_1 = require("../models/SaveUploadedFile201Response");
|
|
75
|
+
const SaveUploadedFileRequest_1 = require("../models/SaveUploadedFileRequest");
|
|
76
|
+
const SendEmail202Response_1 = require("../models/SendEmail202Response");
|
|
77
|
+
const SendEmailRequest_1 = require("../models/SendEmailRequest");
|
|
78
|
+
const SetEmailWebhook200Response_1 = require("../models/SetEmailWebhook200Response");
|
|
79
|
+
const SetEmailWebhookRequest_1 = require("../models/SetEmailWebhookRequest");
|
|
80
|
+
const UpdateEmailAllowlist200Response_1 = require("../models/UpdateEmailAllowlist200Response");
|
|
81
|
+
const UpdateEmailAllowlistRequest_1 = require("../models/UpdateEmailAllowlistRequest");
|
|
82
|
+
const UpdateEmailRequest_1 = require("../models/UpdateEmailRequest");
|
|
83
|
+
const UpdateMailboxRequest_1 = require("../models/UpdateMailboxRequest");
|
|
84
|
+
const VerifyEmailDomainRequest_1 = require("../models/VerifyEmailDomainRequest");
|
|
85
|
+
const VerifySignInCode201Response_1 = require("../models/VerifySignInCode201Response");
|
|
86
|
+
const VerifySignInCodeRequest_1 = require("../models/VerifySignInCodeRequest");
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
class DefaultApi extends runtime.BaseAPI {
|
|
91
|
+
/**
|
|
92
|
+
* Creates request options for addUploadSessionFiles without sending the request
|
|
93
|
+
*/
|
|
94
|
+
addUploadSessionFilesRequestOpts(requestParameters) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
if (requestParameters['mailboxId'] == null) {
|
|
97
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling addUploadSessionFiles().');
|
|
98
|
+
}
|
|
99
|
+
if (requestParameters['sessionId'] == null) {
|
|
100
|
+
throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling addUploadSessionFiles().');
|
|
101
|
+
}
|
|
102
|
+
if (requestParameters['addUploadSessionFilesRequest'] == null) {
|
|
103
|
+
throw new runtime.RequiredError('addUploadSessionFilesRequest', 'Required parameter "addUploadSessionFilesRequest" was null or undefined when calling addUploadSessionFiles().');
|
|
104
|
+
}
|
|
105
|
+
const queryParameters = {};
|
|
106
|
+
const headerParameters = {};
|
|
107
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
108
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
109
|
+
const token = this.configuration.accessToken;
|
|
110
|
+
const tokenString = yield token("bearerAuth", []);
|
|
111
|
+
if (tokenString) {
|
|
112
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/upload_sessions/{session_id}/uploads`;
|
|
116
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
117
|
+
urlPath = urlPath.replace('{session_id}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
118
|
+
return {
|
|
119
|
+
path: urlPath,
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: headerParameters,
|
|
122
|
+
query: queryParameters,
|
|
123
|
+
body: (0, AddUploadSessionFilesRequest_1.AddUploadSessionFilesRequestToJSON)(requestParameters['addUploadSessionFilesRequest']),
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns upload.url and upload.headers for each file that needs bytes. Repeating a path returns a fresh target, for example after a failed PUT. Files with identical content are skipped.
|
|
129
|
+
* Get storage targets for a batch
|
|
130
|
+
*/
|
|
131
|
+
addUploadSessionFilesRaw(requestParameters, initOverrides) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const requestOptions = yield this.addUploadSessionFilesRequestOpts(requestParameters);
|
|
134
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
135
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateUploadSession201Response_1.CreateUploadSession201ResponseFromJSON)(jsonValue));
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Returns upload.url and upload.headers for each file that needs bytes. Repeating a path returns a fresh target, for example after a failed PUT. Files with identical content are skipped.
|
|
140
|
+
* Get storage targets for a batch
|
|
141
|
+
*/
|
|
142
|
+
addUploadSessionFiles(requestParameters, initOverrides) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const response = yield this.addUploadSessionFilesRaw(requestParameters, initOverrides);
|
|
145
|
+
return yield response.value();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Creates request options for appendText without sending the request
|
|
150
|
+
*/
|
|
151
|
+
appendTextRequestOpts(requestParameters) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
if (requestParameters['mailboxId'] == null) {
|
|
154
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling appendText().');
|
|
155
|
+
}
|
|
156
|
+
if (requestParameters['appendTextRequest'] == null) {
|
|
157
|
+
throw new runtime.RequiredError('appendTextRequest', 'Required parameter "appendTextRequest" was null or undefined when calling appendText().');
|
|
158
|
+
}
|
|
159
|
+
const queryParameters = {};
|
|
160
|
+
const headerParameters = {};
|
|
161
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
162
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
163
|
+
const token = this.configuration.accessToken;
|
|
164
|
+
const tokenString = yield token("bearerAuth", []);
|
|
165
|
+
if (tokenString) {
|
|
166
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/append_text`;
|
|
170
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
171
|
+
return {
|
|
172
|
+
path: urlPath,
|
|
173
|
+
method: 'POST',
|
|
174
|
+
headers: headerParameters,
|
|
175
|
+
query: queryParameters,
|
|
176
|
+
body: (0, AppendTextRequest_1.AppendTextRequestToJSON)(requestParameters['appendTextRequest']),
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Appends UTF-8 text to an existing text file and creates a new version. A missing file returns MAILBOX_FILE_NOT_FOUND.
|
|
182
|
+
* Append text to a file
|
|
183
|
+
*/
|
|
184
|
+
appendTextRaw(requestParameters, initOverrides) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
const requestOptions = yield this.appendTextRequestOpts(requestParameters);
|
|
187
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
188
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, AppendText200Response_1.AppendText200ResponseFromJSON)(jsonValue));
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Appends UTF-8 text to an existing text file and creates a new version. A missing file returns MAILBOX_FILE_NOT_FOUND.
|
|
193
|
+
* Append text to a file
|
|
194
|
+
*/
|
|
195
|
+
appendText(requestParameters, initOverrides) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const response = yield this.appendTextRaw(requestParameters, initOverrides);
|
|
198
|
+
return yield response.value();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Creates request options for archiveMailbox without sending the request
|
|
203
|
+
*/
|
|
204
|
+
archiveMailboxRequestOpts(requestParameters) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
if (requestParameters['mailboxId'] == null) {
|
|
207
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling archiveMailbox().');
|
|
208
|
+
}
|
|
209
|
+
if (requestParameters['actionRequest'] == null) {
|
|
210
|
+
throw new runtime.RequiredError('actionRequest', 'Required parameter "actionRequest" was null or undefined when calling archiveMailbox().');
|
|
211
|
+
}
|
|
212
|
+
const queryParameters = {};
|
|
213
|
+
const headerParameters = {};
|
|
214
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
215
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
216
|
+
const token = this.configuration.accessToken;
|
|
217
|
+
const tokenString = yield token("bearerAuth", []);
|
|
218
|
+
if (tokenString) {
|
|
219
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/archive`;
|
|
223
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
224
|
+
return {
|
|
225
|
+
path: urlPath,
|
|
226
|
+
method: 'POST',
|
|
227
|
+
headers: headerParameters,
|
|
228
|
+
query: queryParameters,
|
|
229
|
+
body: (0, ActionRequest_1.ActionRequestToJSON)(requestParameters['actionRequest']),
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Archived mailboxes keep their files and emails and become read-only.
|
|
235
|
+
* Archive a mailbox
|
|
236
|
+
*/
|
|
237
|
+
archiveMailboxRaw(requestParameters, initOverrides) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
const requestOptions = yield this.archiveMailboxRequestOpts(requestParameters);
|
|
240
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
241
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateMailbox201Response_1.CreateMailbox201ResponseFromJSON)(jsonValue));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Archived mailboxes keep their files and emails and become read-only.
|
|
246
|
+
* Archive a mailbox
|
|
247
|
+
*/
|
|
248
|
+
archiveMailbox(requestParameters, initOverrides) {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
const response = yield this.archiveMailboxRaw(requestParameters, initOverrides);
|
|
251
|
+
return yield response.value();
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Creates request options for changeMailboxAddress without sending the request
|
|
256
|
+
*/
|
|
257
|
+
changeMailboxAddressRequestOpts(requestParameters) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
if (requestParameters['mailboxId'] == null) {
|
|
260
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling changeMailboxAddress().');
|
|
261
|
+
}
|
|
262
|
+
if (requestParameters['changeMailboxAddressRequest'] == null) {
|
|
263
|
+
throw new runtime.RequiredError('changeMailboxAddressRequest', 'Required parameter "changeMailboxAddressRequest" was null or undefined when calling changeMailboxAddress().');
|
|
264
|
+
}
|
|
265
|
+
const queryParameters = {};
|
|
266
|
+
const headerParameters = {};
|
|
267
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
268
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
269
|
+
const token = this.configuration.accessToken;
|
|
270
|
+
const tokenString = yield token("bearerAuth", []);
|
|
271
|
+
if (tokenString) {
|
|
272
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/rotate`;
|
|
276
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
277
|
+
return {
|
|
278
|
+
path: urlPath,
|
|
279
|
+
method: 'POST',
|
|
280
|
+
headers: headerParameters,
|
|
281
|
+
query: queryParameters,
|
|
282
|
+
body: (0, ChangeMailboxAddressRequest_1.ChangeMailboxAddressRequestToJSON)(requestParameters['changeMailboxAddressRequest']),
|
|
283
|
+
};
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Requires mailbox admin permission and a paid plan, except for a change back to revdokumail.com. Send the current address as expected_address. Omit username for a generated name. A custom-domain change returns 202; read the settings until assignment.status is active or failed. For account owners and administrators the old address becomes an alias unless keep_old_as_alias is false. Without a free alias slot the request returns EMAIL_ALIAS_LIMIT; send false to retire the old address. A change from revdokumail.com to a customer domain always keeps the old address as the revdokumail.com base address, which uses no alias slot. A change from a customer domain back to revdokumail.com makes that base address the main address again at once (200, assignment.status active): username is ignored, no address change is counted and it works on every plan.
|
|
288
|
+
* Change the primary address
|
|
289
|
+
*/
|
|
290
|
+
changeMailboxAddressRaw(requestParameters, initOverrides) {
|
|
291
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
292
|
+
const requestOptions = yield this.changeMailboxAddressRequestOpts(requestParameters);
|
|
293
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
294
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetMailboxEmailSettings200Response_1.GetMailboxEmailSettings200ResponseFromJSON)(jsonValue));
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Requires mailbox admin permission and a paid plan, except for a change back to revdokumail.com. Send the current address as expected_address. Omit username for a generated name. A custom-domain change returns 202; read the settings until assignment.status is active or failed. For account owners and administrators the old address becomes an alias unless keep_old_as_alias is false. Without a free alias slot the request returns EMAIL_ALIAS_LIMIT; send false to retire the old address. A change from revdokumail.com to a customer domain always keeps the old address as the revdokumail.com base address, which uses no alias slot. A change from a customer domain back to revdokumail.com makes that base address the main address again at once (200, assignment.status active): username is ignored, no address change is counted and it works on every plan.
|
|
299
|
+
* Change the primary address
|
|
300
|
+
*/
|
|
301
|
+
changeMailboxAddress(requestParameters, initOverrides) {
|
|
302
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
303
|
+
const response = yield this.changeMailboxAddressRaw(requestParameters, initOverrides);
|
|
304
|
+
return yield response.value();
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Creates request options for checkEmailDomain without sending the request
|
|
309
|
+
*/
|
|
310
|
+
checkEmailDomainRequestOpts(requestParameters) {
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
if (requestParameters['createEmailDomainRequest'] == null) {
|
|
313
|
+
throw new runtime.RequiredError('createEmailDomainRequest', 'Required parameter "createEmailDomainRequest" was null or undefined when calling checkEmailDomain().');
|
|
314
|
+
}
|
|
315
|
+
const queryParameters = {};
|
|
316
|
+
const headerParameters = {};
|
|
317
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
318
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
319
|
+
const token = this.configuration.accessToken;
|
|
320
|
+
const tokenString = yield token("bearerAuth", []);
|
|
321
|
+
if (tokenString) {
|
|
322
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
let urlPath = `/v1/account/email_domains/check`;
|
|
326
|
+
return {
|
|
327
|
+
path: urlPath,
|
|
328
|
+
method: 'POST',
|
|
329
|
+
headers: headerParameters,
|
|
330
|
+
query: queryParameters,
|
|
331
|
+
body: (0, CreateEmailDomainRequest_1.CreateEmailDomainRequestToJSON)(requestParameters['createEmailDomainRequest']),
|
|
332
|
+
};
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Makes no claim and changes no DNS. If the root domain already receives email, use an unused subdomain such as inbox.example.com.
|
|
337
|
+
* Check a hostname for conflicting DNS
|
|
338
|
+
*/
|
|
339
|
+
checkEmailDomainRaw(requestParameters, initOverrides) {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
+
const requestOptions = yield this.checkEmailDomainRequestOpts(requestParameters);
|
|
342
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
343
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CheckEmailDomain200Response_1.CheckEmailDomain200ResponseFromJSON)(jsonValue));
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Makes no claim and changes no DNS. If the root domain already receives email, use an unused subdomain such as inbox.example.com.
|
|
348
|
+
* Check a hostname for conflicting DNS
|
|
349
|
+
*/
|
|
350
|
+
checkEmailDomain(requestParameters, initOverrides) {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
const response = yield this.checkEmailDomainRaw(requestParameters, initOverrides);
|
|
353
|
+
return yield response.value();
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Creates request options for copyFile without sending the request
|
|
358
|
+
*/
|
|
359
|
+
copyFileRequestOpts(requestParameters) {
|
|
360
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
if (requestParameters['mailboxId'] == null) {
|
|
362
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling copyFile().');
|
|
363
|
+
}
|
|
364
|
+
if (requestParameters['fileId'] == null) {
|
|
365
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling copyFile().');
|
|
366
|
+
}
|
|
367
|
+
if (requestParameters['moveFileRequest'] == null) {
|
|
368
|
+
throw new runtime.RequiredError('moveFileRequest', 'Required parameter "moveFileRequest" was null or undefined when calling copyFile().');
|
|
369
|
+
}
|
|
370
|
+
const queryParameters = {};
|
|
371
|
+
const headerParameters = {};
|
|
372
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
373
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
374
|
+
const token = this.configuration.accessToken;
|
|
375
|
+
const tokenString = yield token("bearerAuth", []);
|
|
376
|
+
if (tokenString) {
|
|
377
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/copy`;
|
|
381
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
382
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
383
|
+
return {
|
|
384
|
+
path: urlPath,
|
|
385
|
+
method: 'POST',
|
|
386
|
+
headers: headerParameters,
|
|
387
|
+
query: queryParameters,
|
|
388
|
+
body: (0, MoveFileRequest_1.MoveFileRequestToJSON)(requestParameters['moveFileRequest']),
|
|
389
|
+
};
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Works in the same mailbox or into target_mailbox_id. Content is not uploaded again. Send target_path for an exact path or target_folder to keep the name.
|
|
394
|
+
* Copy a file
|
|
395
|
+
*/
|
|
396
|
+
copyFileRaw(requestParameters, initOverrides) {
|
|
397
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
398
|
+
const requestOptions = yield this.copyFileRequestOpts(requestParameters);
|
|
399
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
400
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, RenameFile200Response_1.RenameFile200ResponseFromJSON)(jsonValue));
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Works in the same mailbox or into target_mailbox_id. Content is not uploaded again. Send target_path for an exact path or target_folder to keep the name.
|
|
405
|
+
* Copy a file
|
|
406
|
+
*/
|
|
407
|
+
copyFile(requestParameters, initOverrides) {
|
|
408
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
+
const response = yield this.copyFileRaw(requestParameters, initOverrides);
|
|
410
|
+
return yield response.value();
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Creates request options for createBrowserLink without sending the request
|
|
415
|
+
*/
|
|
416
|
+
createBrowserLinkRequestOpts(requestParameters) {
|
|
417
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
418
|
+
if (requestParameters['createBrowserLinkRequest'] == null) {
|
|
419
|
+
throw new runtime.RequiredError('createBrowserLinkRequest', 'Required parameter "createBrowserLinkRequest" was null or undefined when calling createBrowserLink().');
|
|
420
|
+
}
|
|
421
|
+
const queryParameters = {};
|
|
422
|
+
const headerParameters = {};
|
|
423
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
424
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
425
|
+
const token = this.configuration.accessToken;
|
|
426
|
+
const tokenString = yield token("bearerAuth", []);
|
|
427
|
+
if (tokenString) {
|
|
428
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
let urlPath = `/v1/agent_auth/browser_login_link`;
|
|
432
|
+
return {
|
|
433
|
+
path: urlPath,
|
|
434
|
+
method: 'POST',
|
|
435
|
+
headers: headerParameters,
|
|
436
|
+
query: queryParameters,
|
|
437
|
+
body: (0, CreateBrowserLinkRequest_1.CreateBrowserLinkRequestToJSON)(requestParameters['createBrowserLinkRequest']),
|
|
438
|
+
};
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Returns a dashboard URL for a path such as /mailboxes. The user signs in normally; the link grants no access.
|
|
443
|
+
* Create a dashboard link for the user
|
|
444
|
+
*/
|
|
445
|
+
createBrowserLinkRaw(requestParameters, initOverrides) {
|
|
446
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
447
|
+
const requestOptions = yield this.createBrowserLinkRequestOpts(requestParameters);
|
|
448
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
449
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateBrowserLink201Response_1.CreateBrowserLink201ResponseFromJSON)(jsonValue));
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Returns a dashboard URL for a path such as /mailboxes. The user signs in normally; the link grants no access.
|
|
454
|
+
* Create a dashboard link for the user
|
|
455
|
+
*/
|
|
456
|
+
createBrowserLink(requestParameters, initOverrides) {
|
|
457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
+
const response = yield this.createBrowserLinkRaw(requestParameters, initOverrides);
|
|
459
|
+
return yield response.value();
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Creates request options for createClientAccount without sending the request
|
|
464
|
+
*/
|
|
465
|
+
createClientAccountRequestOpts(requestParameters) {
|
|
466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
+
if (requestParameters['createClientAccountRequest'] == null) {
|
|
468
|
+
throw new runtime.RequiredError('createClientAccountRequest', 'Required parameter "createClientAccountRequest" was null or undefined when calling createClientAccount().');
|
|
469
|
+
}
|
|
470
|
+
const queryParameters = {};
|
|
471
|
+
const headerParameters = {};
|
|
472
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
473
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
474
|
+
const token = this.configuration.accessToken;
|
|
475
|
+
const tokenString = yield token("bearerAuth", []);
|
|
476
|
+
if (tokenString) {
|
|
477
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
let urlPath = `/v1/accounts`;
|
|
481
|
+
return {
|
|
482
|
+
path: urlPath,
|
|
483
|
+
method: 'POST',
|
|
484
|
+
headers: headerParameters,
|
|
485
|
+
query: queryParameters,
|
|
486
|
+
body: (0, CreateClientAccountRequest_1.CreateClientAccountRequestToJSON)(requestParameters['createClientAccountRequest']),
|
|
487
|
+
};
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Requires an agency owner credential with client-account access. The credential default does not change; send the new account_id on later requests.
|
|
492
|
+
* Create a client account
|
|
493
|
+
*/
|
|
494
|
+
createClientAccountRaw(requestParameters, initOverrides) {
|
|
495
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
+
const requestOptions = yield this.createClientAccountRequestOpts(requestParameters);
|
|
497
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
498
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateClientAccount201Response_1.CreateClientAccount201ResponseFromJSON)(jsonValue));
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Requires an agency owner credential with client-account access. The credential default does not change; send the new account_id on later requests.
|
|
503
|
+
* Create a client account
|
|
504
|
+
*/
|
|
505
|
+
createClientAccount(requestParameters, initOverrides) {
|
|
506
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
507
|
+
const response = yield this.createClientAccountRaw(requestParameters, initOverrides);
|
|
508
|
+
return yield response.value();
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Creates request options for createEmailAlias without sending the request
|
|
513
|
+
*/
|
|
514
|
+
createEmailAliasRequestOpts(requestParameters) {
|
|
515
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
+
if (requestParameters['mailboxId'] == null) {
|
|
517
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling createEmailAlias().');
|
|
518
|
+
}
|
|
519
|
+
if (requestParameters['createEmailAliasRequest'] == null) {
|
|
520
|
+
throw new runtime.RequiredError('createEmailAliasRequest', 'Required parameter "createEmailAliasRequest" was null or undefined when calling createEmailAlias().');
|
|
521
|
+
}
|
|
522
|
+
const queryParameters = {};
|
|
523
|
+
const headerParameters = {};
|
|
524
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
525
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
526
|
+
const token = this.configuration.accessToken;
|
|
527
|
+
const tokenString = yield token("bearerAuth", []);
|
|
528
|
+
if (tokenString) {
|
|
529
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/aliases`;
|
|
533
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
534
|
+
return {
|
|
535
|
+
path: urlPath,
|
|
536
|
+
method: 'POST',
|
|
537
|
+
headers: headerParameters,
|
|
538
|
+
query: queryParameters,
|
|
539
|
+
body: (0, CreateEmailAliasRequest_1.CreateEmailAliasRequestToJSON)(requestParameters['createEmailAliasRequest']),
|
|
540
|
+
};
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Requires a paid plan and a full-account owner or administrator with mailbox-admin permission. The primary address stays unchanged. On a mailbox whose primary address is on your domain, the first revdokumail.com alias becomes its base address and uses no alias slot.
|
|
545
|
+
* Add an alias address
|
|
546
|
+
*/
|
|
547
|
+
createEmailAliasRaw(requestParameters, initOverrides) {
|
|
548
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
+
const requestOptions = yield this.createEmailAliasRequestOpts(requestParameters);
|
|
550
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
551
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetMailboxEmailSettings200Response_1.GetMailboxEmailSettings200ResponseFromJSON)(jsonValue));
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Requires a paid plan and a full-account owner or administrator with mailbox-admin permission. The primary address stays unchanged. On a mailbox whose primary address is on your domain, the first revdokumail.com alias becomes its base address and uses no alias slot.
|
|
556
|
+
* Add an alias address
|
|
557
|
+
*/
|
|
558
|
+
createEmailAlias(requestParameters, initOverrides) {
|
|
559
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
560
|
+
const response = yield this.createEmailAliasRaw(requestParameters, initOverrides);
|
|
561
|
+
return yield response.value();
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Creates request options for createEmailDomain without sending the request
|
|
566
|
+
*/
|
|
567
|
+
createEmailDomainRequestOpts(requestParameters) {
|
|
568
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
569
|
+
if (requestParameters['createEmailDomainRequest'] == null) {
|
|
570
|
+
throw new runtime.RequiredError('createEmailDomainRequest', 'Required parameter "createEmailDomainRequest" was null or undefined when calling createEmailDomain().');
|
|
571
|
+
}
|
|
572
|
+
const queryParameters = {};
|
|
573
|
+
const headerParameters = {};
|
|
574
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
575
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
576
|
+
const token = this.configuration.accessToken;
|
|
577
|
+
const tokenString = yield token("bearerAuth", []);
|
|
578
|
+
if (tokenString) {
|
|
579
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
let urlPath = `/v1/account/email_domains`;
|
|
583
|
+
return {
|
|
584
|
+
path: urlPath,
|
|
585
|
+
method: 'POST',
|
|
586
|
+
headers: headerParameters,
|
|
587
|
+
query: queryParameters,
|
|
588
|
+
body: (0, CreateEmailDomainRequest_1.CreateEmailDomainRequestToJSON)(requestParameters['createEmailDomainRequest']),
|
|
589
|
+
};
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Claims an exact hostname and returns the ownership record. Read the domain again shortly after for all `required_dns_records`. Never change DNS without the domain owner\'s authorization.
|
|
594
|
+
* Connect a custom email domain
|
|
595
|
+
*/
|
|
596
|
+
createEmailDomainRaw(requestParameters, initOverrides) {
|
|
597
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
598
|
+
const requestOptions = yield this.createEmailDomainRequestOpts(requestParameters);
|
|
599
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
600
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateEmailDomain201Response_1.CreateEmailDomain201ResponseFromJSON)(jsonValue));
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Claims an exact hostname and returns the ownership record. Read the domain again shortly after for all `required_dns_records`. Never change DNS without the domain owner\'s authorization.
|
|
605
|
+
* Connect a custom email domain
|
|
606
|
+
*/
|
|
607
|
+
createEmailDomain(requestParameters, initOverrides) {
|
|
608
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
609
|
+
const response = yield this.createEmailDomainRaw(requestParameters, initOverrides);
|
|
610
|
+
return yield response.value();
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Creates request options for createMailbox without sending the request
|
|
615
|
+
*/
|
|
616
|
+
createMailboxRequestOpts(requestParameters) {
|
|
617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
618
|
+
if (requestParameters['createMailboxRequest'] == null) {
|
|
619
|
+
throw new runtime.RequiredError('createMailboxRequest', 'Required parameter "createMailboxRequest" was null or undefined when calling createMailbox().');
|
|
620
|
+
}
|
|
621
|
+
const queryParameters = {};
|
|
622
|
+
const headerParameters = {};
|
|
623
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
624
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
625
|
+
const token = this.configuration.accessToken;
|
|
626
|
+
const tokenString = yield token("bearerAuth", []);
|
|
627
|
+
if (tokenString) {
|
|
628
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
let urlPath = `/v1/mailboxes`;
|
|
632
|
+
return {
|
|
633
|
+
path: urlPath,
|
|
634
|
+
method: 'POST',
|
|
635
|
+
headers: headerParameters,
|
|
636
|
+
query: queryParameters,
|
|
637
|
+
body: (0, CreateMailboxRequest_1.CreateMailboxRequestToJSON)(requestParameters['createMailboxRequest']),
|
|
638
|
+
};
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Waits until the address can receive email. On revdokumail.com, email.username is a prefix with a permanent 4-character random suffix on every plan; a custom domain takes the exact name. If confirmation does not finish, EMAIL_NOT_READY returns the created mailbox_id in error.details: read that mailbox instead of creating another. The title defaults to email.username; a title that another active mailbox uses returns 409 MAILBOX_TITLE_TAKEN. Never retry a creation automatically.
|
|
643
|
+
* Create a mailbox
|
|
644
|
+
*/
|
|
645
|
+
createMailboxRaw(requestParameters, initOverrides) {
|
|
646
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
647
|
+
const requestOptions = yield this.createMailboxRequestOpts(requestParameters);
|
|
648
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
649
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateMailbox201Response_1.CreateMailbox201ResponseFromJSON)(jsonValue));
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Waits until the address can receive email. On revdokumail.com, email.username is a prefix with a permanent 4-character random suffix on every plan; a custom domain takes the exact name. If confirmation does not finish, EMAIL_NOT_READY returns the created mailbox_id in error.details: read that mailbox instead of creating another. The title defaults to email.username; a title that another active mailbox uses returns 409 MAILBOX_TITLE_TAKEN. Never retry a creation automatically.
|
|
654
|
+
* Create a mailbox
|
|
655
|
+
*/
|
|
656
|
+
createMailbox(requestParameters, initOverrides) {
|
|
657
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
658
|
+
const response = yield this.createMailboxRaw(requestParameters, initOverrides);
|
|
659
|
+
return yield response.value();
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Creates request options for createUploadSession without sending the request
|
|
664
|
+
*/
|
|
665
|
+
createUploadSessionRequestOpts(requestParameters) {
|
|
666
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
667
|
+
if (requestParameters['mailboxId'] == null) {
|
|
668
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling createUploadSession().');
|
|
669
|
+
}
|
|
670
|
+
if (requestParameters['createUploadSessionRequest'] == null) {
|
|
671
|
+
throw new runtime.RequiredError('createUploadSessionRequest', 'Required parameter "createUploadSessionRequest" was null or undefined when calling createUploadSession().');
|
|
672
|
+
}
|
|
673
|
+
const queryParameters = {};
|
|
674
|
+
const headerParameters = {};
|
|
675
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
676
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
677
|
+
const token = this.configuration.accessToken;
|
|
678
|
+
const tokenString = yield token("bearerAuth", []);
|
|
679
|
+
if (tokenString) {
|
|
680
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/upload_sessions`;
|
|
684
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
685
|
+
return {
|
|
686
|
+
path: urlPath,
|
|
687
|
+
method: 'POST',
|
|
688
|
+
headers: headerParameters,
|
|
689
|
+
query: queryParameters,
|
|
690
|
+
body: (0, CreateUploadSessionRequest_1.CreateUploadSessionRequestToJSON)(requestParameters['createUploadSessionRequest']),
|
|
691
|
+
};
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Starts an upload session for many files and returns storage targets for the first files. The session locks the mailbox for other writers; incoming email still arrives. Send files in batches with POST .../uploads, PUT the bytes to each upload.url, save each batch with POST .../finalize_batch, then call POST .../finalize. Unsaved uploads are discarded when the session expires.
|
|
696
|
+
* Start a batch upload
|
|
697
|
+
*/
|
|
698
|
+
createUploadSessionRaw(requestParameters, initOverrides) {
|
|
699
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
700
|
+
const requestOptions = yield this.createUploadSessionRequestOpts(requestParameters);
|
|
701
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
702
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateUploadSession201Response_1.CreateUploadSession201ResponseFromJSON)(jsonValue));
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Starts an upload session for many files and returns storage targets for the first files. The session locks the mailbox for other writers; incoming email still arrives. Send files in batches with POST .../uploads, PUT the bytes to each upload.url, save each batch with POST .../finalize_batch, then call POST .../finalize. Unsaved uploads are discarded when the session expires.
|
|
707
|
+
* Start a batch upload
|
|
708
|
+
*/
|
|
709
|
+
createUploadSession(requestParameters, initOverrides) {
|
|
710
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
711
|
+
const response = yield this.createUploadSessionRaw(requestParameters, initOverrides);
|
|
712
|
+
return yield response.value();
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Creates request options for deleteEmail without sending the request
|
|
717
|
+
*/
|
|
718
|
+
deleteEmailRequestOpts(requestParameters) {
|
|
719
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
720
|
+
if (requestParameters['mailboxId'] == null) {
|
|
721
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling deleteEmail().');
|
|
722
|
+
}
|
|
723
|
+
if (requestParameters['emailId'] == null) {
|
|
724
|
+
throw new runtime.RequiredError('emailId', 'Required parameter "emailId" was null or undefined when calling deleteEmail().');
|
|
725
|
+
}
|
|
726
|
+
const queryParameters = {};
|
|
727
|
+
if (requestParameters['accountId'] != null) {
|
|
728
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
729
|
+
}
|
|
730
|
+
if (requestParameters['reason'] != null) {
|
|
731
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
732
|
+
}
|
|
733
|
+
const headerParameters = {};
|
|
734
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
735
|
+
const token = this.configuration.accessToken;
|
|
736
|
+
const tokenString = yield token("bearerAuth", []);
|
|
737
|
+
if (tokenString) {
|
|
738
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails/{email_id}`;
|
|
742
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
743
|
+
urlPath = urlPath.replace('{email_id}', encodeURIComponent(String(requestParameters['emailId'])));
|
|
744
|
+
return {
|
|
745
|
+
path: urlPath,
|
|
746
|
+
method: 'DELETE',
|
|
747
|
+
headers: headerParameters,
|
|
748
|
+
query: queryParameters,
|
|
749
|
+
};
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Requires mailbox-admin permission. Deletes the stored message and its attachments. There is no trash.
|
|
754
|
+
* Delete an email
|
|
755
|
+
*/
|
|
756
|
+
deleteEmailRaw(requestParameters, initOverrides) {
|
|
757
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
758
|
+
const requestOptions = yield this.deleteEmailRequestOpts(requestParameters);
|
|
759
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
760
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Requires mailbox-admin permission. Deletes the stored message and its attachments. There is no trash.
|
|
765
|
+
* Delete an email
|
|
766
|
+
*/
|
|
767
|
+
deleteEmail(requestParameters, initOverrides) {
|
|
768
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
769
|
+
const response = yield this.deleteEmailRaw(requestParameters, initOverrides);
|
|
770
|
+
return yield response.value();
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Creates request options for deleteEmailAlias without sending the request
|
|
775
|
+
*/
|
|
776
|
+
deleteEmailAliasRequestOpts(requestParameters) {
|
|
777
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
778
|
+
if (requestParameters['mailboxId'] == null) {
|
|
779
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling deleteEmailAlias().');
|
|
780
|
+
}
|
|
781
|
+
if (requestParameters['aliasId'] == null) {
|
|
782
|
+
throw new runtime.RequiredError('aliasId', 'Required parameter "aliasId" was null or undefined when calling deleteEmailAlias().');
|
|
783
|
+
}
|
|
784
|
+
const queryParameters = {};
|
|
785
|
+
if (requestParameters['accountId'] != null) {
|
|
786
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
787
|
+
}
|
|
788
|
+
if (requestParameters['reason'] != null) {
|
|
789
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
790
|
+
}
|
|
791
|
+
const headerParameters = {};
|
|
792
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
793
|
+
const token = this.configuration.accessToken;
|
|
794
|
+
const tokenString = yield token("bearerAuth", []);
|
|
795
|
+
if (tokenString) {
|
|
796
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/aliases/{alias_id}`;
|
|
800
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
801
|
+
urlPath = urlPath.replace('{alias_id}', encodeURIComponent(String(requestParameters['aliasId'])));
|
|
802
|
+
return {
|
|
803
|
+
path: urlPath,
|
|
804
|
+
method: 'DELETE',
|
|
805
|
+
headers: headerParameters,
|
|
806
|
+
query: queryParameters,
|
|
807
|
+
};
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Stops new and queued deliveries to the alias. Saved emails stay. The base address of a mailbox whose primary address is on your domain cannot be removed (`409 EMAIL_ALIAS_BASE`).
|
|
812
|
+
* Remove an alias address
|
|
813
|
+
*/
|
|
814
|
+
deleteEmailAliasRaw(requestParameters, initOverrides) {
|
|
815
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
const requestOptions = yield this.deleteEmailAliasRequestOpts(requestParameters);
|
|
817
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
818
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Stops new and queued deliveries to the alias. Saved emails stay. The base address of a mailbox whose primary address is on your domain cannot be removed (`409 EMAIL_ALIAS_BASE`).
|
|
823
|
+
* Remove an alias address
|
|
824
|
+
*/
|
|
825
|
+
deleteEmailAlias(requestParameters, initOverrides) {
|
|
826
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
827
|
+
const response = yield this.deleteEmailAliasRaw(requestParameters, initOverrides);
|
|
828
|
+
return yield response.value();
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Creates request options for deleteEmailDomain without sending the request
|
|
833
|
+
*/
|
|
834
|
+
deleteEmailDomainRequestOpts(requestParameters) {
|
|
835
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
836
|
+
if (requestParameters['domainId'] == null) {
|
|
837
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling deleteEmailDomain().');
|
|
838
|
+
}
|
|
839
|
+
if (requestParameters['deleteEmailDomainRequest'] == null) {
|
|
840
|
+
throw new runtime.RequiredError('deleteEmailDomainRequest', 'Required parameter "deleteEmailDomainRequest" was null or undefined when calling deleteEmailDomain().');
|
|
841
|
+
}
|
|
842
|
+
const queryParameters = {};
|
|
843
|
+
const headerParameters = {};
|
|
844
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
845
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
846
|
+
const token = this.configuration.accessToken;
|
|
847
|
+
const tokenString = yield token("bearerAuth", []);
|
|
848
|
+
if (tokenString) {
|
|
849
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
let urlPath = `/v1/account/email_domains/{domain_id}`;
|
|
853
|
+
urlPath = urlPath.replace('{domain_id}', encodeURIComponent(String(requestParameters['domainId'])));
|
|
854
|
+
return {
|
|
855
|
+
path: urlPath,
|
|
856
|
+
method: 'DELETE',
|
|
857
|
+
headers: headerParameters,
|
|
858
|
+
query: queryParameters,
|
|
859
|
+
body: (0, DeleteEmailDomainRequest_1.DeleteEmailDomainRequestToJSON)(requestParameters['deleteEmailDomainRequest']),
|
|
860
|
+
};
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Send the domain hostname and confirm=true. A domain that mailbox addresses still use returns EMAIL_DOMAIN_IN_USE.
|
|
865
|
+
* Remove an unused custom email domain
|
|
866
|
+
*/
|
|
867
|
+
deleteEmailDomainRaw(requestParameters, initOverrides) {
|
|
868
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
869
|
+
const requestOptions = yield this.deleteEmailDomainRequestOpts(requestParameters);
|
|
870
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
871
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Send the domain hostname and confirm=true. A domain that mailbox addresses still use returns EMAIL_DOMAIN_IN_USE.
|
|
876
|
+
* Remove an unused custom email domain
|
|
877
|
+
*/
|
|
878
|
+
deleteEmailDomain(requestParameters, initOverrides) {
|
|
879
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
880
|
+
const response = yield this.deleteEmailDomainRaw(requestParameters, initOverrides);
|
|
881
|
+
return yield response.value();
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Creates request options for deleteEmailWebhook without sending the request
|
|
886
|
+
*/
|
|
887
|
+
deleteEmailWebhookRequestOpts(requestParameters) {
|
|
888
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
889
|
+
if (requestParameters['mailboxId'] == null) {
|
|
890
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling deleteEmailWebhook().');
|
|
891
|
+
}
|
|
892
|
+
const queryParameters = {};
|
|
893
|
+
if (requestParameters['accountId'] != null) {
|
|
894
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
895
|
+
}
|
|
896
|
+
const headerParameters = {};
|
|
897
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
898
|
+
const token = this.configuration.accessToken;
|
|
899
|
+
const tokenString = yield token("bearerAuth", []);
|
|
900
|
+
if (tokenString) {
|
|
901
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/webhook`;
|
|
905
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
906
|
+
return {
|
|
907
|
+
path: urlPath,
|
|
908
|
+
method: 'DELETE',
|
|
909
|
+
headers: headerParameters,
|
|
910
|
+
query: queryParameters,
|
|
911
|
+
};
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Cancels queued deliveries. A delivery already in progress can finish. Returns the mailbox ID, also when no webhook is set.
|
|
916
|
+
* Remove the email webhook
|
|
917
|
+
*/
|
|
918
|
+
deleteEmailWebhookRaw(requestParameters, initOverrides) {
|
|
919
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
920
|
+
const requestOptions = yield this.deleteEmailWebhookRequestOpts(requestParameters);
|
|
921
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
922
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Cancels queued deliveries. A delivery already in progress can finish. Returns the mailbox ID, also when no webhook is set.
|
|
927
|
+
* Remove the email webhook
|
|
928
|
+
*/
|
|
929
|
+
deleteEmailWebhook(requestParameters, initOverrides) {
|
|
930
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
931
|
+
const response = yield this.deleteEmailWebhookRaw(requestParameters, initOverrides);
|
|
932
|
+
return yield response.value();
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Creates request options for deleteFile without sending the request
|
|
937
|
+
*/
|
|
938
|
+
deleteFileRequestOpts(requestParameters) {
|
|
939
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
940
|
+
if (requestParameters['mailboxId'] == null) {
|
|
941
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling deleteFile().');
|
|
942
|
+
}
|
|
943
|
+
if (requestParameters['fileId'] == null) {
|
|
944
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFile().');
|
|
945
|
+
}
|
|
946
|
+
const queryParameters = {};
|
|
947
|
+
if (requestParameters['accountId'] != null) {
|
|
948
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
949
|
+
}
|
|
950
|
+
if (requestParameters['reason'] != null) {
|
|
951
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
952
|
+
}
|
|
953
|
+
const headerParameters = {};
|
|
954
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
955
|
+
const token = this.configuration.accessToken;
|
|
956
|
+
const tokenString = yield token("bearerAuth", []);
|
|
957
|
+
if (tokenString) {
|
|
958
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}`;
|
|
962
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
963
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
964
|
+
return {
|
|
965
|
+
path: urlPath,
|
|
966
|
+
method: 'DELETE',
|
|
967
|
+
headers: headerParameters,
|
|
968
|
+
query: queryParameters,
|
|
969
|
+
};
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Requires mailbox-admin permission. Files under _email/ return EMAIL_PATH_READ_ONLY; delete the email instead. Other top-level folders that start with _ return RESERVED_PATH.
|
|
974
|
+
* Delete a file
|
|
975
|
+
*/
|
|
976
|
+
deleteFileRaw(requestParameters, initOverrides) {
|
|
977
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
978
|
+
const requestOptions = yield this.deleteFileRequestOpts(requestParameters);
|
|
979
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
980
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Requires mailbox-admin permission. Files under _email/ return EMAIL_PATH_READ_ONLY; delete the email instead. Other top-level folders that start with _ return RESERVED_PATH.
|
|
985
|
+
* Delete a file
|
|
986
|
+
*/
|
|
987
|
+
deleteFile(requestParameters, initOverrides) {
|
|
988
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
989
|
+
const response = yield this.deleteFileRaw(requestParameters, initOverrides);
|
|
990
|
+
return yield response.value();
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* Creates request options for deleteMailbox without sending the request
|
|
995
|
+
*/
|
|
996
|
+
deleteMailboxRequestOpts(requestParameters) {
|
|
997
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
998
|
+
if (requestParameters['mailboxId'] == null) {
|
|
999
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling deleteMailbox().');
|
|
1000
|
+
}
|
|
1001
|
+
if (requestParameters['deleteMailboxRequest'] == null) {
|
|
1002
|
+
throw new runtime.RequiredError('deleteMailboxRequest', 'Required parameter "deleteMailboxRequest" was null or undefined when calling deleteMailbox().');
|
|
1003
|
+
}
|
|
1004
|
+
const queryParameters = {};
|
|
1005
|
+
const headerParameters = {};
|
|
1006
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1007
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1008
|
+
const token = this.configuration.accessToken;
|
|
1009
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1010
|
+
if (tokenString) {
|
|
1011
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}`;
|
|
1015
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1016
|
+
return {
|
|
1017
|
+
path: urlPath,
|
|
1018
|
+
method: 'DELETE',
|
|
1019
|
+
headers: headerParameters,
|
|
1020
|
+
query: queryParameters,
|
|
1021
|
+
body: (0, DeleteMailboxRequest_1.DeleteMailboxRequestToJSON)(requestParameters['deleteMailboxRequest']),
|
|
1022
|
+
};
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Archive the mailbox first. Send delete.confirmation from the mailbox read after the user confirms. Large mailboxes finish deleting in the background.
|
|
1027
|
+
* Permanently delete an archived mailbox
|
|
1028
|
+
*/
|
|
1029
|
+
deleteMailboxRaw(requestParameters, initOverrides) {
|
|
1030
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1031
|
+
const requestOptions = yield this.deleteMailboxRequestOpts(requestParameters);
|
|
1032
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1033
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeleteEmailDomain200Response_1.DeleteEmailDomain200ResponseFromJSON)(jsonValue));
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Archive the mailbox first. Send delete.confirmation from the mailbox read after the user confirms. Large mailboxes finish deleting in the background.
|
|
1038
|
+
* Permanently delete an archived mailbox
|
|
1039
|
+
*/
|
|
1040
|
+
deleteMailbox(requestParameters, initOverrides) {
|
|
1041
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1042
|
+
const response = yield this.deleteMailboxRaw(requestParameters, initOverrides);
|
|
1043
|
+
return yield response.value();
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Creates request options for exchangeConnectionGrant without sending the request
|
|
1048
|
+
*/
|
|
1049
|
+
exchangeConnectionGrantRequestOpts(requestParameters) {
|
|
1050
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1051
|
+
if (requestParameters['exchangeConnectionGrantRequest'] == null) {
|
|
1052
|
+
throw new runtime.RequiredError('exchangeConnectionGrantRequest', 'Required parameter "exchangeConnectionGrantRequest" was null or undefined when calling exchangeConnectionGrant().');
|
|
1053
|
+
}
|
|
1054
|
+
const queryParameters = {};
|
|
1055
|
+
const headerParameters = {};
|
|
1056
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1057
|
+
let urlPath = `/v1/agent_auth/exchange_grant`;
|
|
1058
|
+
return {
|
|
1059
|
+
path: urlPath,
|
|
1060
|
+
method: 'POST',
|
|
1061
|
+
headers: headerParameters,
|
|
1062
|
+
query: queryParameters,
|
|
1063
|
+
body: (0, ExchangeConnectionGrantRequest_1.ExchangeConnectionGrantRequestToJSON)(requestParameters['exchangeConnectionGrantRequest']),
|
|
1064
|
+
};
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* The dashboard creates the one-time code when a signed-in administrator copies a connection prompt.
|
|
1069
|
+
* Exchange a one-time dashboard connection code for an API key
|
|
1070
|
+
*/
|
|
1071
|
+
exchangeConnectionGrantRaw(requestParameters, initOverrides) {
|
|
1072
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1073
|
+
const requestOptions = yield this.exchangeConnectionGrantRequestOpts(requestParameters);
|
|
1074
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1075
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, VerifySignInCode201Response_1.VerifySignInCode201ResponseFromJSON)(jsonValue));
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* The dashboard creates the one-time code when a signed-in administrator copies a connection prompt.
|
|
1080
|
+
* Exchange a one-time dashboard connection code for an API key
|
|
1081
|
+
*/
|
|
1082
|
+
exchangeConnectionGrant(requestParameters, initOverrides) {
|
|
1083
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1084
|
+
const response = yield this.exchangeConnectionGrantRaw(requestParameters, initOverrides);
|
|
1085
|
+
return yield response.value();
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Creates request options for finalizeUploadSession without sending the request
|
|
1090
|
+
*/
|
|
1091
|
+
finalizeUploadSessionRequestOpts(requestParameters) {
|
|
1092
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1093
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1094
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling finalizeUploadSession().');
|
|
1095
|
+
}
|
|
1096
|
+
if (requestParameters['sessionId'] == null) {
|
|
1097
|
+
throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling finalizeUploadSession().');
|
|
1098
|
+
}
|
|
1099
|
+
const queryParameters = {};
|
|
1100
|
+
const headerParameters = {};
|
|
1101
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1102
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1103
|
+
const token = this.configuration.accessToken;
|
|
1104
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1105
|
+
if (tokenString) {
|
|
1106
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/upload_sessions/{session_id}/finalize`;
|
|
1110
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1111
|
+
urlPath = urlPath.replace('{session_id}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
1112
|
+
return {
|
|
1113
|
+
path: urlPath,
|
|
1114
|
+
method: 'POST',
|
|
1115
|
+
headers: headerParameters,
|
|
1116
|
+
query: queryParameters,
|
|
1117
|
+
body: (0, FinalizeUploadSessionRequest_1.FinalizeUploadSessionRequestToJSON)(requestParameters['finalizeUploadSessionRequest']),
|
|
1118
|
+
};
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* complete=true saves the remaining uploaded files, creates one mailbox version and releases the lock. A 202 response with finalize_pending=true means more files remain: call finalize again after Retry-After. complete=false cancels the session and discards its unsaved files. Finalizing a finished session returns it unchanged.
|
|
1123
|
+
* Finish or cancel a batch upload
|
|
1124
|
+
*/
|
|
1125
|
+
finalizeUploadSessionRaw(requestParameters, initOverrides) {
|
|
1126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1127
|
+
const requestOptions = yield this.finalizeUploadSessionRequestOpts(requestParameters);
|
|
1128
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1129
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateUploadSession201Response_1.CreateUploadSession201ResponseFromJSON)(jsonValue));
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* complete=true saves the remaining uploaded files, creates one mailbox version and releases the lock. A 202 response with finalize_pending=true means more files remain: call finalize again after Retry-After. complete=false cancels the session and discards its unsaved files. Finalizing a finished session returns it unchanged.
|
|
1134
|
+
* Finish or cancel a batch upload
|
|
1135
|
+
*/
|
|
1136
|
+
finalizeUploadSession(requestParameters, initOverrides) {
|
|
1137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1138
|
+
const response = yield this.finalizeUploadSessionRaw(requestParameters, initOverrides);
|
|
1139
|
+
return yield response.value();
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Creates request options for getAccount without sending the request
|
|
1144
|
+
*/
|
|
1145
|
+
getAccountRequestOpts(requestParameters) {
|
|
1146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1147
|
+
if (requestParameters['accountId'] == null) {
|
|
1148
|
+
throw new runtime.RequiredError('accountId', 'Required parameter "accountId" was null or undefined when calling getAccount().');
|
|
1149
|
+
}
|
|
1150
|
+
const queryParameters = {};
|
|
1151
|
+
const headerParameters = {};
|
|
1152
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1153
|
+
const token = this.configuration.accessToken;
|
|
1154
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1155
|
+
if (tokenString) {
|
|
1156
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
let urlPath = `/v1/accounts/{account_id}`;
|
|
1160
|
+
urlPath = urlPath.replace('{account_id}', encodeURIComponent(String(requestParameters['accountId'])));
|
|
1161
|
+
return {
|
|
1162
|
+
path: urlPath,
|
|
1163
|
+
method: 'GET',
|
|
1164
|
+
headers: headerParameters,
|
|
1165
|
+
query: queryParameters,
|
|
1166
|
+
};
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Works with every API key. Returns the name, kind, region and status of one account that this credential can use, and the permissions of the credential in it. Other account IDs return 403.
|
|
1171
|
+
* Read one granted account
|
|
1172
|
+
*/
|
|
1173
|
+
getAccountRaw(requestParameters, initOverrides) {
|
|
1174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1175
|
+
const requestOptions = yield this.getAccountRequestOpts(requestParameters);
|
|
1176
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1177
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateClientAccount201Response_1.CreateClientAccount201ResponseFromJSON)(jsonValue));
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Works with every API key. Returns the name, kind, region and status of one account that this credential can use, and the permissions of the credential in it. Other account IDs return 403.
|
|
1182
|
+
* Read one granted account
|
|
1183
|
+
*/
|
|
1184
|
+
getAccount(requestParameters, initOverrides) {
|
|
1185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1186
|
+
const response = yield this.getAccountRaw(requestParameters, initOverrides);
|
|
1187
|
+
return yield response.value();
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Creates request options for getAccountLimits without sending the request
|
|
1192
|
+
*/
|
|
1193
|
+
getAccountLimitsRequestOpts(requestParameters) {
|
|
1194
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1195
|
+
const queryParameters = {};
|
|
1196
|
+
if (requestParameters['accountId'] != null) {
|
|
1197
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1198
|
+
}
|
|
1199
|
+
const headerParameters = {};
|
|
1200
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1201
|
+
const token = this.configuration.accessToken;
|
|
1202
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1203
|
+
if (tokenString) {
|
|
1204
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
let urlPath = `/v1/account/limits`;
|
|
1208
|
+
return {
|
|
1209
|
+
path: urlPath,
|
|
1210
|
+
method: 'GET',
|
|
1211
|
+
headers: headerParameters,
|
|
1212
|
+
query: queryParameters,
|
|
1213
|
+
};
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Values come from the plan and account overrides. Zero means no allowance; null means no cap. Storage, mailbox and email traffic allowances are shared within a billing group.
|
|
1218
|
+
* Read effective account limits
|
|
1219
|
+
*/
|
|
1220
|
+
getAccountLimitsRaw(requestParameters, initOverrides) {
|
|
1221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1222
|
+
const requestOptions = yield this.getAccountLimitsRequestOpts(requestParameters);
|
|
1223
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1224
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetAccountLimits200Response_1.GetAccountLimits200ResponseFromJSON)(jsonValue));
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Values come from the plan and account overrides. Zero means no allowance; null means no cap. Storage, mailbox and email traffic allowances are shared within a billing group.
|
|
1229
|
+
* Read effective account limits
|
|
1230
|
+
*/
|
|
1231
|
+
getAccountLimits() {
|
|
1232
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
1233
|
+
const response = yield this.getAccountLimitsRaw(requestParameters, initOverrides);
|
|
1234
|
+
return yield response.value();
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Creates request options for getEmail without sending the request
|
|
1239
|
+
*/
|
|
1240
|
+
getEmailRequestOpts(requestParameters) {
|
|
1241
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1242
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1243
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getEmail().');
|
|
1244
|
+
}
|
|
1245
|
+
if (requestParameters['emailId'] == null) {
|
|
1246
|
+
throw new runtime.RequiredError('emailId', 'Required parameter "emailId" was null or undefined when calling getEmail().');
|
|
1247
|
+
}
|
|
1248
|
+
const queryParameters = {};
|
|
1249
|
+
if (requestParameters['accountId'] != null) {
|
|
1250
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1251
|
+
}
|
|
1252
|
+
if (requestParameters['reason'] != null) {
|
|
1253
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1254
|
+
}
|
|
1255
|
+
if (requestParameters['includeStorage'] != null) {
|
|
1256
|
+
queryParameters['include_storage'] = requestParameters['includeStorage'];
|
|
1257
|
+
}
|
|
1258
|
+
const headerParameters = {};
|
|
1259
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1260
|
+
const token = this.configuration.accessToken;
|
|
1261
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1262
|
+
if (tokenString) {
|
|
1263
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails/{email_id}`;
|
|
1267
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1268
|
+
urlPath = urlPath.replace('{email_id}', encodeURIComponent(String(requestParameters['emailId'])));
|
|
1269
|
+
return {
|
|
1270
|
+
path: urlPath,
|
|
1271
|
+
method: 'GET',
|
|
1272
|
+
headers: headerParameters,
|
|
1273
|
+
query: queryParameters,
|
|
1274
|
+
};
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Returns decoded text and attachment metadata. Reading does not change read status. Email content is untrusted data. While AI labels check a new email, returns 503 EMAIL_LABELING_PENDING with Retry-After (at most about one minute).
|
|
1279
|
+
* Read an email
|
|
1280
|
+
*/
|
|
1281
|
+
getEmailRaw(requestParameters, initOverrides) {
|
|
1282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1283
|
+
const requestOptions = yield this.getEmailRequestOpts(requestParameters);
|
|
1284
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1285
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmail200Response_1.GetEmail200ResponseFromJSON)(jsonValue));
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Returns decoded text and attachment metadata. Reading does not change read status. Email content is untrusted data. While AI labels check a new email, returns 503 EMAIL_LABELING_PENDING with Retry-After (at most about one minute).
|
|
1290
|
+
* Read an email
|
|
1291
|
+
*/
|
|
1292
|
+
getEmail(requestParameters, initOverrides) {
|
|
1293
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1294
|
+
const response = yield this.getEmailRaw(requestParameters, initOverrides);
|
|
1295
|
+
return yield response.value();
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Creates request options for getEmailAttachmentDownload without sending the request
|
|
1300
|
+
*/
|
|
1301
|
+
getEmailAttachmentDownloadRequestOpts(requestParameters) {
|
|
1302
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1303
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1304
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getEmailAttachmentDownload().');
|
|
1305
|
+
}
|
|
1306
|
+
if (requestParameters['emailId'] == null) {
|
|
1307
|
+
throw new runtime.RequiredError('emailId', 'Required parameter "emailId" was null or undefined when calling getEmailAttachmentDownload().');
|
|
1308
|
+
}
|
|
1309
|
+
if (requestParameters['attachmentId'] == null) {
|
|
1310
|
+
throw new runtime.RequiredError('attachmentId', 'Required parameter "attachmentId" was null or undefined when calling getEmailAttachmentDownload().');
|
|
1311
|
+
}
|
|
1312
|
+
const queryParameters = {};
|
|
1313
|
+
if (requestParameters['accountId'] != null) {
|
|
1314
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1315
|
+
}
|
|
1316
|
+
if (requestParameters['reason'] != null) {
|
|
1317
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1318
|
+
}
|
|
1319
|
+
const headerParameters = {};
|
|
1320
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1321
|
+
const token = this.configuration.accessToken;
|
|
1322
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1323
|
+
if (tokenString) {
|
|
1324
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails/{email_id}/attachments/{attachment_id}`;
|
|
1328
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1329
|
+
urlPath = urlPath.replace('{email_id}', encodeURIComponent(String(requestParameters['emailId'])));
|
|
1330
|
+
urlPath = urlPath.replace('{attachment_id}', encodeURIComponent(String(requestParameters['attachmentId'])));
|
|
1331
|
+
return {
|
|
1332
|
+
path: urlPath,
|
|
1333
|
+
method: 'GET',
|
|
1334
|
+
headers: headerParameters,
|
|
1335
|
+
query: queryParameters,
|
|
1336
|
+
};
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Returns a temporary link. No extraction or analysis is done. Junk email returns 403 EMAIL_WITHHELD. A new email that AI labels are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After.
|
|
1341
|
+
* Get a download link for an attachment
|
|
1342
|
+
*/
|
|
1343
|
+
getEmailAttachmentDownloadRaw(requestParameters, initOverrides) {
|
|
1344
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1345
|
+
const requestOptions = yield this.getEmailAttachmentDownloadRequestOpts(requestParameters);
|
|
1346
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1347
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmailOriginalDownload200Response_1.GetEmailOriginalDownload200ResponseFromJSON)(jsonValue));
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Returns a temporary link. No extraction or analysis is done. Junk email returns 403 EMAIL_WITHHELD. A new email that AI labels are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After.
|
|
1352
|
+
* Get a download link for an attachment
|
|
1353
|
+
*/
|
|
1354
|
+
getEmailAttachmentDownload(requestParameters, initOverrides) {
|
|
1355
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1356
|
+
const response = yield this.getEmailAttachmentDownloadRaw(requestParameters, initOverrides);
|
|
1357
|
+
return yield response.value();
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Creates request options for getEmailDomain without sending the request
|
|
1362
|
+
*/
|
|
1363
|
+
getEmailDomainRequestOpts(requestParameters) {
|
|
1364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1365
|
+
if (requestParameters['domainId'] == null) {
|
|
1366
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling getEmailDomain().');
|
|
1367
|
+
}
|
|
1368
|
+
const queryParameters = {};
|
|
1369
|
+
if (requestParameters['accountId'] != null) {
|
|
1370
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1371
|
+
}
|
|
1372
|
+
const headerParameters = {};
|
|
1373
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1374
|
+
const token = this.configuration.accessToken;
|
|
1375
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1376
|
+
if (tokenString) {
|
|
1377
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
let urlPath = `/v1/account/email_domains/{domain_id}`;
|
|
1381
|
+
urlPath = urlPath.replace('{domain_id}', encodeURIComponent(String(requestParameters['domainId'])));
|
|
1382
|
+
return {
|
|
1383
|
+
path: urlPath,
|
|
1384
|
+
method: 'GET',
|
|
1385
|
+
headers: headerParameters,
|
|
1386
|
+
query: queryParameters,
|
|
1387
|
+
};
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Requires a full-account owner or administrator credential. Returns the domain status and the DNS records to publish.
|
|
1392
|
+
* Read a custom email domain
|
|
1393
|
+
*/
|
|
1394
|
+
getEmailDomainRaw(requestParameters, initOverrides) {
|
|
1395
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1396
|
+
const requestOptions = yield this.getEmailDomainRequestOpts(requestParameters);
|
|
1397
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1398
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateEmailDomain201Response_1.CreateEmailDomain201ResponseFromJSON)(jsonValue));
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Requires a full-account owner or administrator credential. Returns the domain status and the DNS records to publish.
|
|
1403
|
+
* Read a custom email domain
|
|
1404
|
+
*/
|
|
1405
|
+
getEmailDomain(requestParameters, initOverrides) {
|
|
1406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1407
|
+
const response = yield this.getEmailDomainRaw(requestParameters, initOverrides);
|
|
1408
|
+
return yield response.value();
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Creates request options for getEmailDomainSetupLink without sending the request
|
|
1413
|
+
*/
|
|
1414
|
+
getEmailDomainSetupLinkRequestOpts(requestParameters) {
|
|
1415
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1416
|
+
if (requestParameters['domainId'] == null) {
|
|
1417
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling getEmailDomainSetupLink().');
|
|
1418
|
+
}
|
|
1419
|
+
const queryParameters = {};
|
|
1420
|
+
if (requestParameters['accountId'] != null) {
|
|
1421
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1422
|
+
}
|
|
1423
|
+
const headerParameters = {};
|
|
1424
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1425
|
+
const token = this.configuration.accessToken;
|
|
1426
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1427
|
+
if (tokenString) {
|
|
1428
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
let urlPath = `/v1/account/email_domains/{domain_id}/setup_link`;
|
|
1432
|
+
urlPath = urlPath.replace('{domain_id}', encodeURIComponent(String(requestParameters['domainId'])));
|
|
1433
|
+
return {
|
|
1434
|
+
path: urlPath,
|
|
1435
|
+
method: 'GET',
|
|
1436
|
+
headers: headerParameters,
|
|
1437
|
+
query: queryParameters,
|
|
1438
|
+
};
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Signs a Domain Connect link for a domain whose `setup_provider` is set. Give the URL to the domain owner to open in a browser. The DNS provider adds `required_dns_records` after the owner approves them, then returns to Account Settings → Domains. Errors: 422 `EMAIL_DOMAIN_SETUP_UNSUPPORTED` when the provider or the domain state does not allow one-click setup, 422 `EMAIL_DOMAIN_SETUP_UNAVAILABLE` while the deployment cannot sign links, 422 `EMAIL_DNS_CONFLICT` when the hostname has records of another mail provider, 403 `EMAIL_DOMAINS_UPGRADE_REQUIRED` when the plan no longer includes custom email domains, and 503 `EMAIL_DNS_TEMPORARY` when DNS cannot be checked. Add the records manually, or try again later after a 503.
|
|
1443
|
+
* Get a one-click DNS setup link
|
|
1444
|
+
*/
|
|
1445
|
+
getEmailDomainSetupLinkRaw(requestParameters, initOverrides) {
|
|
1446
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1447
|
+
const requestOptions = yield this.getEmailDomainSetupLinkRequestOpts(requestParameters);
|
|
1448
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1449
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmailDomainSetupLink200Response_1.GetEmailDomainSetupLink200ResponseFromJSON)(jsonValue));
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Signs a Domain Connect link for a domain whose `setup_provider` is set. Give the URL to the domain owner to open in a browser. The DNS provider adds `required_dns_records` after the owner approves them, then returns to Account Settings → Domains. Errors: 422 `EMAIL_DOMAIN_SETUP_UNSUPPORTED` when the provider or the domain state does not allow one-click setup, 422 `EMAIL_DOMAIN_SETUP_UNAVAILABLE` while the deployment cannot sign links, 422 `EMAIL_DNS_CONFLICT` when the hostname has records of another mail provider, 403 `EMAIL_DOMAINS_UPGRADE_REQUIRED` when the plan no longer includes custom email domains, and 503 `EMAIL_DNS_TEMPORARY` when DNS cannot be checked. Add the records manually, or try again later after a 503.
|
|
1454
|
+
* Get a one-click DNS setup link
|
|
1455
|
+
*/
|
|
1456
|
+
getEmailDomainSetupLink(requestParameters, initOverrides) {
|
|
1457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1458
|
+
const response = yield this.getEmailDomainSetupLinkRaw(requestParameters, initOverrides);
|
|
1459
|
+
return yield response.value();
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Creates request options for getEmailOriginalDownload without sending the request
|
|
1464
|
+
*/
|
|
1465
|
+
getEmailOriginalDownloadRequestOpts(requestParameters) {
|
|
1466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1467
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1468
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getEmailOriginalDownload().');
|
|
1469
|
+
}
|
|
1470
|
+
if (requestParameters['emailId'] == null) {
|
|
1471
|
+
throw new runtime.RequiredError('emailId', 'Required parameter "emailId" was null or undefined when calling getEmailOriginalDownload().');
|
|
1472
|
+
}
|
|
1473
|
+
const queryParameters = {};
|
|
1474
|
+
if (requestParameters['accountId'] != null) {
|
|
1475
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1476
|
+
}
|
|
1477
|
+
if (requestParameters['reason'] != null) {
|
|
1478
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1479
|
+
}
|
|
1480
|
+
const headerParameters = {};
|
|
1481
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1482
|
+
const token = this.configuration.accessToken;
|
|
1483
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1484
|
+
if (tokenString) {
|
|
1485
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails/{email_id}/raw`;
|
|
1489
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1490
|
+
urlPath = urlPath.replace('{email_id}', encodeURIComponent(String(requestParameters['emailId'])));
|
|
1491
|
+
return {
|
|
1492
|
+
path: urlPath,
|
|
1493
|
+
method: 'GET',
|
|
1494
|
+
headers: headerParameters,
|
|
1495
|
+
query: queryParameters,
|
|
1496
|
+
};
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Returns a temporary link to the original .eml file. Downloads do not change read status. Junk email returns 403 EMAIL_WITHHELD. A new email that AI labels are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After.
|
|
1501
|
+
* Get a download link for the original email
|
|
1502
|
+
*/
|
|
1503
|
+
getEmailOriginalDownloadRaw(requestParameters, initOverrides) {
|
|
1504
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1505
|
+
const requestOptions = yield this.getEmailOriginalDownloadRequestOpts(requestParameters);
|
|
1506
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1507
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmailOriginalDownload200Response_1.GetEmailOriginalDownload200ResponseFromJSON)(jsonValue));
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Returns a temporary link to the original .eml file. Downloads do not change read status. Junk email returns 403 EMAIL_WITHHELD. A new email that AI labels are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After.
|
|
1512
|
+
* Get a download link for the original email
|
|
1513
|
+
*/
|
|
1514
|
+
getEmailOriginalDownload(requestParameters, initOverrides) {
|
|
1515
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1516
|
+
const response = yield this.getEmailOriginalDownloadRaw(requestParameters, initOverrides);
|
|
1517
|
+
return yield response.value();
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Creates request options for getEmailSubscription without sending the request
|
|
1522
|
+
*/
|
|
1523
|
+
getEmailSubscriptionRequestOpts(requestParameters) {
|
|
1524
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1525
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1526
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getEmailSubscription().');
|
|
1527
|
+
}
|
|
1528
|
+
const queryParameters = {};
|
|
1529
|
+
if (requestParameters['accountId'] != null) {
|
|
1530
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1531
|
+
}
|
|
1532
|
+
const headerParameters = {};
|
|
1533
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1534
|
+
const token = this.configuration.accessToken;
|
|
1535
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1536
|
+
if (tokenString) {
|
|
1537
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/subscription`;
|
|
1541
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1542
|
+
return {
|
|
1543
|
+
path: urlPath,
|
|
1544
|
+
method: 'GET',
|
|
1545
|
+
headers: headerParameters,
|
|
1546
|
+
query: queryParameters,
|
|
1547
|
+
};
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Requires mailbox read permission. Connect to websocket_url with email_subscription_token=TOKEN within 60 seconds, then subscribe to EmailReceivedChannel. Catch up with the email list cursor after every connect.
|
|
1552
|
+
* Get a live email subscription ticket
|
|
1553
|
+
*/
|
|
1554
|
+
getEmailSubscriptionRaw(requestParameters, initOverrides) {
|
|
1555
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1556
|
+
const requestOptions = yield this.getEmailSubscriptionRequestOpts(requestParameters);
|
|
1557
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1558
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmailSubscription200Response_1.GetEmailSubscription200ResponseFromJSON)(jsonValue));
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Requires mailbox read permission. Connect to websocket_url with email_subscription_token=TOKEN within 60 seconds, then subscribe to EmailReceivedChannel. Catch up with the email list cursor after every connect.
|
|
1563
|
+
* Get a live email subscription ticket
|
|
1564
|
+
*/
|
|
1565
|
+
getEmailSubscription(requestParameters, initOverrides) {
|
|
1566
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1567
|
+
const response = yield this.getEmailSubscriptionRaw(requestParameters, initOverrides);
|
|
1568
|
+
return yield response.value();
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Creates request options for getEmailWebhook without sending the request
|
|
1573
|
+
*/
|
|
1574
|
+
getEmailWebhookRequestOpts(requestParameters) {
|
|
1575
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1576
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1577
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getEmailWebhook().');
|
|
1578
|
+
}
|
|
1579
|
+
const queryParameters = {};
|
|
1580
|
+
if (requestParameters['accountId'] != null) {
|
|
1581
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1582
|
+
}
|
|
1583
|
+
const headerParameters = {};
|
|
1584
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1585
|
+
const token = this.configuration.accessToken;
|
|
1586
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1587
|
+
if (tokenString) {
|
|
1588
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/webhook`;
|
|
1592
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1593
|
+
return {
|
|
1594
|
+
path: urlPath,
|
|
1595
|
+
method: 'GET',
|
|
1596
|
+
headers: headerParameters,
|
|
1597
|
+
query: queryParameters,
|
|
1598
|
+
};
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Requires mailbox-admin permission. webhook is null when no webhook is set. The signing secret is never returned here.
|
|
1603
|
+
* Read the email webhook
|
|
1604
|
+
*/
|
|
1605
|
+
getEmailWebhookRaw(requestParameters, initOverrides) {
|
|
1606
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1607
|
+
const requestOptions = yield this.getEmailWebhookRequestOpts(requestParameters);
|
|
1608
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1609
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetEmailWebhook200Response_1.GetEmailWebhook200ResponseFromJSON)(jsonValue));
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Requires mailbox-admin permission. webhook is null when no webhook is set. The signing secret is never returned here.
|
|
1614
|
+
* Read the email webhook
|
|
1615
|
+
*/
|
|
1616
|
+
getEmailWebhook(requestParameters, initOverrides) {
|
|
1617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1618
|
+
const response = yield this.getEmailWebhookRaw(requestParameters, initOverrides);
|
|
1619
|
+
return yield response.value();
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Creates request options for getFile without sending the request
|
|
1624
|
+
*/
|
|
1625
|
+
getFileRequestOpts(requestParameters) {
|
|
1626
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1627
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1628
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getFile().');
|
|
1629
|
+
}
|
|
1630
|
+
if (requestParameters['fileId'] == null) {
|
|
1631
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFile().');
|
|
1632
|
+
}
|
|
1633
|
+
const queryParameters = {};
|
|
1634
|
+
if (requestParameters['accountId'] != null) {
|
|
1635
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1636
|
+
}
|
|
1637
|
+
if (requestParameters['reason'] != null) {
|
|
1638
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1639
|
+
}
|
|
1640
|
+
const headerParameters = {};
|
|
1641
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1642
|
+
const token = this.configuration.accessToken;
|
|
1643
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1644
|
+
if (tokenString) {
|
|
1645
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}`;
|
|
1649
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1650
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
1651
|
+
return {
|
|
1652
|
+
path: urlPath,
|
|
1653
|
+
method: 'GET',
|
|
1654
|
+
headers: headerParameters,
|
|
1655
|
+
query: queryParameters,
|
|
1656
|
+
};
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Reading metadata never marks the file read.
|
|
1661
|
+
* Read file metadata
|
|
1662
|
+
*/
|
|
1663
|
+
getFileRaw(requestParameters, initOverrides) {
|
|
1664
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1665
|
+
const requestOptions = yield this.getFileRequestOpts(requestParameters);
|
|
1666
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1667
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetFileByPath200Response_1.GetFileByPath200ResponseFromJSON)(jsonValue));
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Reading metadata never marks the file read.
|
|
1672
|
+
* Read file metadata
|
|
1673
|
+
*/
|
|
1674
|
+
getFile(requestParameters, initOverrides) {
|
|
1675
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1676
|
+
const response = yield this.getFileRaw(requestParameters, initOverrides);
|
|
1677
|
+
return yield response.value();
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Creates request options for getFileByPath without sending the request
|
|
1682
|
+
*/
|
|
1683
|
+
getFileByPathRequestOpts(requestParameters) {
|
|
1684
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1685
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1686
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getFileByPath().');
|
|
1687
|
+
}
|
|
1688
|
+
if (requestParameters['path'] == null) {
|
|
1689
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling getFileByPath().');
|
|
1690
|
+
}
|
|
1691
|
+
const queryParameters = {};
|
|
1692
|
+
if (requestParameters['path'] != null) {
|
|
1693
|
+
queryParameters['path'] = requestParameters['path'];
|
|
1694
|
+
}
|
|
1695
|
+
if (requestParameters['accountId'] != null) {
|
|
1696
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1697
|
+
}
|
|
1698
|
+
if (requestParameters['reason'] != null) {
|
|
1699
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1700
|
+
}
|
|
1701
|
+
const headerParameters = {};
|
|
1702
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1703
|
+
const token = this.configuration.accessToken;
|
|
1704
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1705
|
+
if (tokenString) {
|
|
1706
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/by_path`;
|
|
1710
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1711
|
+
return {
|
|
1712
|
+
path: urlPath,
|
|
1713
|
+
method: 'GET',
|
|
1714
|
+
headers: headerParameters,
|
|
1715
|
+
query: queryParameters,
|
|
1716
|
+
};
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Returns file metadata only. Read content with the download endpoint. The disposition and content_url parameters return INVALID_ARGUMENT.
|
|
1721
|
+
* Find a file by path
|
|
1722
|
+
*/
|
|
1723
|
+
getFileByPathRaw(requestParameters, initOverrides) {
|
|
1724
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1725
|
+
const requestOptions = yield this.getFileByPathRequestOpts(requestParameters);
|
|
1726
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1727
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetFileByPath200Response_1.GetFileByPath200ResponseFromJSON)(jsonValue));
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Returns file metadata only. Read content with the download endpoint. The disposition and content_url parameters return INVALID_ARGUMENT.
|
|
1732
|
+
* Find a file by path
|
|
1733
|
+
*/
|
|
1734
|
+
getFileByPath(requestParameters, initOverrides) {
|
|
1735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1736
|
+
const response = yield this.getFileByPathRaw(requestParameters, initOverrides);
|
|
1737
|
+
return yield response.value();
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Creates request options for getFileDownload without sending the request
|
|
1742
|
+
*/
|
|
1743
|
+
getFileDownloadRequestOpts(requestParameters) {
|
|
1744
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1745
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1746
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getFileDownload().');
|
|
1747
|
+
}
|
|
1748
|
+
if (requestParameters['fileId'] == null) {
|
|
1749
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileDownload().');
|
|
1750
|
+
}
|
|
1751
|
+
const queryParameters = {};
|
|
1752
|
+
if (requestParameters['versionId'] != null) {
|
|
1753
|
+
queryParameters['version_id'] = requestParameters['versionId'];
|
|
1754
|
+
}
|
|
1755
|
+
if (requestParameters['accountId'] != null) {
|
|
1756
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1757
|
+
}
|
|
1758
|
+
if (requestParameters['reason'] != null) {
|
|
1759
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1760
|
+
}
|
|
1761
|
+
const headerParameters = {};
|
|
1762
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1763
|
+
const token = this.configuration.accessToken;
|
|
1764
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1765
|
+
if (tokenString) {
|
|
1766
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/download`;
|
|
1770
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1771
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
1772
|
+
return {
|
|
1773
|
+
path: urlPath,
|
|
1774
|
+
method: 'GET',
|
|
1775
|
+
headers: headerParameters,
|
|
1776
|
+
query: queryParameters,
|
|
1777
|
+
};
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Returns a temporary link and marks this version read. Send version_id for an older version.
|
|
1782
|
+
* Get a download link for a file
|
|
1783
|
+
*/
|
|
1784
|
+
getFileDownloadRaw(requestParameters, initOverrides) {
|
|
1785
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1786
|
+
const requestOptions = yield this.getFileDownloadRequestOpts(requestParameters);
|
|
1787
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1788
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetFileDownload200Response_1.GetFileDownload200ResponseFromJSON)(jsonValue));
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Returns a temporary link and marks this version read. Send version_id for an older version.
|
|
1793
|
+
* Get a download link for a file
|
|
1794
|
+
*/
|
|
1795
|
+
getFileDownload(requestParameters, initOverrides) {
|
|
1796
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1797
|
+
const response = yield this.getFileDownloadRaw(requestParameters, initOverrides);
|
|
1798
|
+
return yield response.value();
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Creates request options for getMailbox without sending the request
|
|
1803
|
+
*/
|
|
1804
|
+
getMailboxRequestOpts(requestParameters) {
|
|
1805
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1806
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1807
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getMailbox().');
|
|
1808
|
+
}
|
|
1809
|
+
const queryParameters = {};
|
|
1810
|
+
if (requestParameters['accountId'] != null) {
|
|
1811
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1812
|
+
}
|
|
1813
|
+
if (requestParameters['reason'] != null) {
|
|
1814
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1815
|
+
}
|
|
1816
|
+
const headerParameters = {};
|
|
1817
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1818
|
+
const token = this.configuration.accessToken;
|
|
1819
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1820
|
+
if (tokenString) {
|
|
1821
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}`;
|
|
1825
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1826
|
+
return {
|
|
1827
|
+
path: urlPath,
|
|
1828
|
+
method: 'GET',
|
|
1829
|
+
headers: headerParameters,
|
|
1830
|
+
query: queryParameters,
|
|
1831
|
+
};
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Reading never changes the mailbox. Read address settings, emails and files through their own endpoints.
|
|
1836
|
+
* Read a mailbox
|
|
1837
|
+
*/
|
|
1838
|
+
getMailboxRaw(requestParameters, initOverrides) {
|
|
1839
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1840
|
+
const requestOptions = yield this.getMailboxRequestOpts(requestParameters);
|
|
1841
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1842
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateMailbox201Response_1.CreateMailbox201ResponseFromJSON)(jsonValue));
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Reading never changes the mailbox. Read address settings, emails and files through their own endpoints.
|
|
1847
|
+
* Read a mailbox
|
|
1848
|
+
*/
|
|
1849
|
+
getMailbox(requestParameters, initOverrides) {
|
|
1850
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1851
|
+
const response = yield this.getMailboxRaw(requestParameters, initOverrides);
|
|
1852
|
+
return yield response.value();
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* Creates request options for getMailboxEmailSettings without sending the request
|
|
1857
|
+
*/
|
|
1858
|
+
getMailboxEmailSettingsRequestOpts(requestParameters) {
|
|
1859
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1860
|
+
if (requestParameters['mailboxId'] == null) {
|
|
1861
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling getMailboxEmailSettings().');
|
|
1862
|
+
}
|
|
1863
|
+
const queryParameters = {};
|
|
1864
|
+
if (requestParameters['accountId'] != null) {
|
|
1865
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1866
|
+
}
|
|
1867
|
+
if (requestParameters['reason'] != null) {
|
|
1868
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1869
|
+
}
|
|
1870
|
+
const headerParameters = {};
|
|
1871
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1872
|
+
const token = this.configuration.accessToken;
|
|
1873
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1874
|
+
if (tokenString) {
|
|
1875
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email`;
|
|
1879
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
1880
|
+
return {
|
|
1881
|
+
path: urlPath,
|
|
1882
|
+
method: 'GET',
|
|
1883
|
+
headers: headerParameters,
|
|
1884
|
+
query: queryParameters,
|
|
1885
|
+
};
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Requires mailbox write permission.
|
|
1890
|
+
* Read address settings
|
|
1891
|
+
*/
|
|
1892
|
+
getMailboxEmailSettingsRaw(requestParameters, initOverrides) {
|
|
1893
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1894
|
+
const requestOptions = yield this.getMailboxEmailSettingsRequestOpts(requestParameters);
|
|
1895
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1896
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetMailboxEmailSettings200Response_1.GetMailboxEmailSettings200ResponseFromJSON)(jsonValue));
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
/**
|
|
1900
|
+
* Requires mailbox write permission.
|
|
1901
|
+
* Read address settings
|
|
1902
|
+
*/
|
|
1903
|
+
getMailboxEmailSettings(requestParameters, initOverrides) {
|
|
1904
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1905
|
+
const response = yield this.getMailboxEmailSettingsRaw(requestParameters, initOverrides);
|
|
1906
|
+
return yield response.value();
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Creates request options for getStatus without sending the request
|
|
1911
|
+
*/
|
|
1912
|
+
getStatusRequestOpts(requestParameters) {
|
|
1913
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1914
|
+
const queryParameters = {};
|
|
1915
|
+
if (requestParameters['accountId'] != null) {
|
|
1916
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
1917
|
+
}
|
|
1918
|
+
if (requestParameters['reason'] != null) {
|
|
1919
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
1920
|
+
}
|
|
1921
|
+
const headerParameters = {};
|
|
1922
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1923
|
+
const token = this.configuration.accessToken;
|
|
1924
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1925
|
+
if (tokenString) {
|
|
1926
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
let urlPath = `/v1/status`;
|
|
1930
|
+
return {
|
|
1931
|
+
path: urlPath,
|
|
1932
|
+
method: 'GET',
|
|
1933
|
+
headers: headerParameters,
|
|
1934
|
+
query: queryParameters,
|
|
1935
|
+
};
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Works with every API key, including mailbox-scoped keys. Read quotas with GET /v1/account/limits.
|
|
1940
|
+
* Read the connection and selected account
|
|
1941
|
+
*/
|
|
1942
|
+
getStatusRaw(requestParameters, initOverrides) {
|
|
1943
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1944
|
+
const requestOptions = yield this.getStatusRequestOpts(requestParameters);
|
|
1945
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1946
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetStatus200Response_1.GetStatus200ResponseFromJSON)(jsonValue));
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Works with every API key, including mailbox-scoped keys. Read quotas with GET /v1/account/limits.
|
|
1951
|
+
* Read the connection and selected account
|
|
1952
|
+
*/
|
|
1953
|
+
getStatus() {
|
|
1954
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
1955
|
+
const response = yield this.getStatusRaw(requestParameters, initOverrides);
|
|
1956
|
+
return yield response.value();
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* Creates request options for listAccounts without sending the request
|
|
1961
|
+
*/
|
|
1962
|
+
listAccountsRequestOpts(requestParameters) {
|
|
1963
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1964
|
+
const queryParameters = {};
|
|
1965
|
+
if (requestParameters['limit'] != null) {
|
|
1966
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
1967
|
+
}
|
|
1968
|
+
if (requestParameters['cursor'] != null) {
|
|
1969
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
1970
|
+
}
|
|
1971
|
+
const headerParameters = {};
|
|
1972
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1973
|
+
const token = this.configuration.accessToken;
|
|
1974
|
+
const tokenString = yield token("bearerAuth", []);
|
|
1975
|
+
if (tokenString) {
|
|
1976
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
let urlPath = `/v1/accounts`;
|
|
1980
|
+
return {
|
|
1981
|
+
path: urlPath,
|
|
1982
|
+
method: 'GET',
|
|
1983
|
+
headers: headerParameters,
|
|
1984
|
+
query: queryParameters,
|
|
1985
|
+
};
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Works with every API key. Lists the account of this credential and the client accounts that an agency owner granted to it. Send an id from this list as account_id to act in that account.
|
|
1990
|
+
* List accounts granted to this credential
|
|
1991
|
+
*/
|
|
1992
|
+
listAccountsRaw(requestParameters, initOverrides) {
|
|
1993
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1994
|
+
const requestOptions = yield this.listAccountsRequestOpts(requestParameters);
|
|
1995
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
1996
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListAccounts200Response_1.ListAccounts200ResponseFromJSON)(jsonValue));
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Works with every API key. Lists the account of this credential and the client accounts that an agency owner granted to it. Send an id from this list as account_id to act in that account.
|
|
2001
|
+
* List accounts granted to this credential
|
|
2002
|
+
*/
|
|
2003
|
+
listAccounts() {
|
|
2004
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
2005
|
+
const response = yield this.listAccountsRaw(requestParameters, initOverrides);
|
|
2006
|
+
return yield response.value();
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Creates request options for listEmailDomains without sending the request
|
|
2011
|
+
*/
|
|
2012
|
+
listEmailDomainsRequestOpts(requestParameters) {
|
|
2013
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2014
|
+
const queryParameters = {};
|
|
2015
|
+
if (requestParameters['accountId'] != null) {
|
|
2016
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
2017
|
+
}
|
|
2018
|
+
if (requestParameters['limit'] != null) {
|
|
2019
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2020
|
+
}
|
|
2021
|
+
if (requestParameters['cursor'] != null) {
|
|
2022
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2023
|
+
}
|
|
2024
|
+
const headerParameters = {};
|
|
2025
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2026
|
+
const token = this.configuration.accessToken;
|
|
2027
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2028
|
+
if (tokenString) {
|
|
2029
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
let urlPath = `/v1/account/email_domains`;
|
|
2033
|
+
return {
|
|
2034
|
+
path: urlPath,
|
|
2035
|
+
method: 'GET',
|
|
2036
|
+
headers: headerParameters,
|
|
2037
|
+
query: queryParameters,
|
|
2038
|
+
};
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Requires a full-account owner or administrator credential.
|
|
2043
|
+
* List custom email domains
|
|
2044
|
+
*/
|
|
2045
|
+
listEmailDomainsRaw(requestParameters, initOverrides) {
|
|
2046
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2047
|
+
const requestOptions = yield this.listEmailDomainsRequestOpts(requestParameters);
|
|
2048
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2049
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListEmailDomains200Response_1.ListEmailDomains200ResponseFromJSON)(jsonValue));
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* Requires a full-account owner or administrator credential.
|
|
2054
|
+
* List custom email domains
|
|
2055
|
+
*/
|
|
2056
|
+
listEmailDomains() {
|
|
2057
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
2058
|
+
const response = yield this.listEmailDomainsRaw(requestParameters, initOverrides);
|
|
2059
|
+
return yield response.value();
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* Creates request options for listEmails without sending the request
|
|
2064
|
+
*/
|
|
2065
|
+
listEmailsRequestOpts(requestParameters) {
|
|
2066
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2067
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2068
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling listEmails().');
|
|
2069
|
+
}
|
|
2070
|
+
const queryParameters = {};
|
|
2071
|
+
if (requestParameters['accountId'] != null) {
|
|
2072
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
2073
|
+
}
|
|
2074
|
+
if (requestParameters['reason'] != null) {
|
|
2075
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
2076
|
+
}
|
|
2077
|
+
if (requestParameters['limit'] != null) {
|
|
2078
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2079
|
+
}
|
|
2080
|
+
if (requestParameters['cursor'] != null) {
|
|
2081
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2082
|
+
}
|
|
2083
|
+
if (requestParameters['order'] != null) {
|
|
2084
|
+
queryParameters['order'] = requestParameters['order'];
|
|
2085
|
+
}
|
|
2086
|
+
if (requestParameters['direction'] != null) {
|
|
2087
|
+
queryParameters['direction'] = requestParameters['direction'];
|
|
2088
|
+
}
|
|
2089
|
+
if (requestParameters['sender'] != null) {
|
|
2090
|
+
queryParameters['sender'] = requestParameters['sender'];
|
|
2091
|
+
}
|
|
2092
|
+
if (requestParameters['subject'] != null) {
|
|
2093
|
+
queryParameters['subject'] = requestParameters['subject'];
|
|
2094
|
+
}
|
|
2095
|
+
if (requestParameters['receivedAfter'] != null) {
|
|
2096
|
+
queryParameters['received_after'] = runtime.serializeDateTime(requestParameters['receivedAfter']);
|
|
2097
|
+
}
|
|
2098
|
+
if (requestParameters['receivedBefore'] != null) {
|
|
2099
|
+
queryParameters['received_before'] = runtime.serializeDateTime(requestParameters['receivedBefore']);
|
|
2100
|
+
}
|
|
2101
|
+
if (requestParameters['read'] != null) {
|
|
2102
|
+
queryParameters['read'] = requestParameters['read'];
|
|
2103
|
+
}
|
|
2104
|
+
if (requestParameters['hasAttachments'] != null) {
|
|
2105
|
+
queryParameters['has_attachments'] = requestParameters['hasAttachments'];
|
|
2106
|
+
}
|
|
2107
|
+
if (requestParameters['conversationId'] != null) {
|
|
2108
|
+
queryParameters['conversation_id'] = requestParameters['conversationId'];
|
|
2109
|
+
}
|
|
2110
|
+
if (requestParameters['includeStorage'] != null) {
|
|
2111
|
+
queryParameters['include_storage'] = requestParameters['includeStorage'];
|
|
2112
|
+
}
|
|
2113
|
+
const headerParameters = {};
|
|
2114
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2115
|
+
const token = this.configuration.accessToken;
|
|
2116
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2117
|
+
if (tokenString) {
|
|
2118
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails`;
|
|
2122
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2123
|
+
return {
|
|
2124
|
+
path: urlPath,
|
|
2125
|
+
method: 'GET',
|
|
2126
|
+
headers: headerParameters,
|
|
2127
|
+
query: queryParameters,
|
|
2128
|
+
};
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Requires mailbox read permission. Lists received email by default. To poll, list in ascending order, save pagination.next_cursor after every page (including an empty page) and send it next time with the same filters. Listing never marks email read.
|
|
2133
|
+
* List emails
|
|
2134
|
+
*/
|
|
2135
|
+
listEmailsRaw(requestParameters, initOverrides) {
|
|
2136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2137
|
+
const requestOptions = yield this.listEmailsRequestOpts(requestParameters);
|
|
2138
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2139
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListEmails200Response_1.ListEmails200ResponseFromJSON)(jsonValue));
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Requires mailbox read permission. Lists received email by default. To poll, list in ascending order, save pagination.next_cursor after every page (including an empty page) and send it next time with the same filters. Listing never marks email read.
|
|
2144
|
+
* List emails
|
|
2145
|
+
*/
|
|
2146
|
+
listEmails(requestParameters, initOverrides) {
|
|
2147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2148
|
+
const response = yield this.listEmailsRaw(requestParameters, initOverrides);
|
|
2149
|
+
return yield response.value();
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Creates request options for listFileVersions without sending the request
|
|
2154
|
+
*/
|
|
2155
|
+
listFileVersionsRequestOpts(requestParameters) {
|
|
2156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2157
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2158
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling listFileVersions().');
|
|
2159
|
+
}
|
|
2160
|
+
if (requestParameters['fileId'] == null) {
|
|
2161
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling listFileVersions().');
|
|
2162
|
+
}
|
|
2163
|
+
const queryParameters = {};
|
|
2164
|
+
if (requestParameters['accountId'] != null) {
|
|
2165
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
2166
|
+
}
|
|
2167
|
+
if (requestParameters['reason'] != null) {
|
|
2168
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
2169
|
+
}
|
|
2170
|
+
if (requestParameters['limit'] != null) {
|
|
2171
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2172
|
+
}
|
|
2173
|
+
if (requestParameters['cursor'] != null) {
|
|
2174
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2175
|
+
}
|
|
2176
|
+
const headerParameters = {};
|
|
2177
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2178
|
+
const token = this.configuration.accessToken;
|
|
2179
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2180
|
+
if (tokenString) {
|
|
2181
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/versions`;
|
|
2185
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2186
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
2187
|
+
return {
|
|
2188
|
+
path: urlPath,
|
|
2189
|
+
method: 'GET',
|
|
2190
|
+
headers: headerParameters,
|
|
2191
|
+
query: queryParameters,
|
|
2192
|
+
};
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
/**
|
|
2196
|
+
* Newest first.
|
|
2197
|
+
* List file versions
|
|
2198
|
+
*/
|
|
2199
|
+
listFileVersionsRaw(requestParameters, initOverrides) {
|
|
2200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2201
|
+
const requestOptions = yield this.listFileVersionsRequestOpts(requestParameters);
|
|
2202
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2203
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListFileVersions200Response_1.ListFileVersions200ResponseFromJSON)(jsonValue));
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Newest first.
|
|
2208
|
+
* List file versions
|
|
2209
|
+
*/
|
|
2210
|
+
listFileVersions(requestParameters, initOverrides) {
|
|
2211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2212
|
+
const response = yield this.listFileVersionsRaw(requestParameters, initOverrides);
|
|
2213
|
+
return yield response.value();
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
/**
|
|
2217
|
+
* Creates request options for listFiles without sending the request
|
|
2218
|
+
*/
|
|
2219
|
+
listFilesRequestOpts(requestParameters) {
|
|
2220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2221
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2222
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling listFiles().');
|
|
2223
|
+
}
|
|
2224
|
+
const queryParameters = {};
|
|
2225
|
+
if (requestParameters['accountId'] != null) {
|
|
2226
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
2227
|
+
}
|
|
2228
|
+
if (requestParameters['reason'] != null) {
|
|
2229
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
2230
|
+
}
|
|
2231
|
+
if (requestParameters['q'] != null) {
|
|
2232
|
+
queryParameters['q'] = requestParameters['q'];
|
|
2233
|
+
}
|
|
2234
|
+
if (requestParameters['folder'] != null) {
|
|
2235
|
+
queryParameters['folder'] = requestParameters['folder'];
|
|
2236
|
+
}
|
|
2237
|
+
if (requestParameters['limit'] != null) {
|
|
2238
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2239
|
+
}
|
|
2240
|
+
if (requestParameters['cursor'] != null) {
|
|
2241
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2242
|
+
}
|
|
2243
|
+
const headerParameters = {};
|
|
2244
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2245
|
+
const token = this.configuration.accessToken;
|
|
2246
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2247
|
+
if (tokenString) {
|
|
2248
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files`;
|
|
2252
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2253
|
+
return {
|
|
2254
|
+
path: urlPath,
|
|
2255
|
+
method: 'GET',
|
|
2256
|
+
headers: headerParameters,
|
|
2257
|
+
query: queryParameters,
|
|
2258
|
+
};
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
/**
|
|
2262
|
+
* Lists current files, including stored emails under _email/. Listing never marks files read.
|
|
2263
|
+
* List files
|
|
2264
|
+
*/
|
|
2265
|
+
listFilesRaw(requestParameters, initOverrides) {
|
|
2266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2267
|
+
const requestOptions = yield this.listFilesRequestOpts(requestParameters);
|
|
2268
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2269
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListFiles200Response_1.ListFiles200ResponseFromJSON)(jsonValue));
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Lists current files, including stored emails under _email/. Listing never marks files read.
|
|
2274
|
+
* List files
|
|
2275
|
+
*/
|
|
2276
|
+
listFiles(requestParameters, initOverrides) {
|
|
2277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2278
|
+
const response = yield this.listFilesRaw(requestParameters, initOverrides);
|
|
2279
|
+
return yield response.value();
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Creates request options for listMailboxes without sending the request
|
|
2284
|
+
*/
|
|
2285
|
+
listMailboxesRequestOpts(requestParameters) {
|
|
2286
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2287
|
+
const queryParameters = {};
|
|
2288
|
+
if (requestParameters['accountId'] != null) {
|
|
2289
|
+
queryParameters['account_id'] = requestParameters['accountId'];
|
|
2290
|
+
}
|
|
2291
|
+
if (requestParameters['reason'] != null) {
|
|
2292
|
+
queryParameters['reason'] = requestParameters['reason'];
|
|
2293
|
+
}
|
|
2294
|
+
if (requestParameters['status'] != null) {
|
|
2295
|
+
queryParameters['status'] = requestParameters['status'];
|
|
2296
|
+
}
|
|
2297
|
+
if (requestParameters['q'] != null) {
|
|
2298
|
+
queryParameters['q'] = requestParameters['q'];
|
|
2299
|
+
}
|
|
2300
|
+
if (requestParameters['limit'] != null) {
|
|
2301
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2302
|
+
}
|
|
2303
|
+
if (requestParameters['cursor'] != null) {
|
|
2304
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2305
|
+
}
|
|
2306
|
+
const headerParameters = {};
|
|
2307
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2308
|
+
const token = this.configuration.accessToken;
|
|
2309
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2310
|
+
if (tokenString) {
|
|
2311
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
let urlPath = `/v1/mailboxes`;
|
|
2315
|
+
return {
|
|
2316
|
+
path: urlPath,
|
|
2317
|
+
method: 'GET',
|
|
2318
|
+
headers: headerParameters,
|
|
2319
|
+
query: queryParameters,
|
|
2320
|
+
};
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Lists active mailboxes by default, newest first. Counts and pages cover only mailboxes this credential can access. Reads no email content.
|
|
2325
|
+
* List mailboxes
|
|
2326
|
+
*/
|
|
2327
|
+
listMailboxesRaw(requestParameters, initOverrides) {
|
|
2328
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2329
|
+
const requestOptions = yield this.listMailboxesRequestOpts(requestParameters);
|
|
2330
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2331
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListMailboxes200Response_1.ListMailboxes200ResponseFromJSON)(jsonValue));
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Lists active mailboxes by default, newest first. Counts and pages cover only mailboxes this credential can access. Reads no email content.
|
|
2336
|
+
* List mailboxes
|
|
2337
|
+
*/
|
|
2338
|
+
listMailboxes() {
|
|
2339
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
2340
|
+
const response = yield this.listMailboxesRaw(requestParameters, initOverrides);
|
|
2341
|
+
return yield response.value();
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Creates request options for moveFile without sending the request
|
|
2346
|
+
*/
|
|
2347
|
+
moveFileRequestOpts(requestParameters) {
|
|
2348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2349
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2350
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling moveFile().');
|
|
2351
|
+
}
|
|
2352
|
+
if (requestParameters['fileId'] == null) {
|
|
2353
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling moveFile().');
|
|
2354
|
+
}
|
|
2355
|
+
if (requestParameters['moveFileRequest'] == null) {
|
|
2356
|
+
throw new runtime.RequiredError('moveFileRequest', 'Required parameter "moveFileRequest" was null or undefined when calling moveFile().');
|
|
2357
|
+
}
|
|
2358
|
+
const queryParameters = {};
|
|
2359
|
+
const headerParameters = {};
|
|
2360
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2361
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2362
|
+
const token = this.configuration.accessToken;
|
|
2363
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2364
|
+
if (tokenString) {
|
|
2365
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/move`;
|
|
2369
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2370
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
2371
|
+
return {
|
|
2372
|
+
path: urlPath,
|
|
2373
|
+
method: 'POST',
|
|
2374
|
+
headers: headerParameters,
|
|
2375
|
+
query: queryParameters,
|
|
2376
|
+
body: (0, MoveFileRequest_1.MoveFileRequestToJSON)(requestParameters['moveFileRequest']),
|
|
2377
|
+
};
|
|
2378
|
+
});
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Works in the same mailbox or into target_mailbox_id. Content is not uploaded again. Send target_path for an exact path or target_folder to keep the name.
|
|
2382
|
+
* Move a file
|
|
2383
|
+
*/
|
|
2384
|
+
moveFileRaw(requestParameters, initOverrides) {
|
|
2385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2386
|
+
const requestOptions = yield this.moveFileRequestOpts(requestParameters);
|
|
2387
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2388
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, RenameFile200Response_1.RenameFile200ResponseFromJSON)(jsonValue));
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Works in the same mailbox or into target_mailbox_id. Content is not uploaded again. Send target_path for an exact path or target_folder to keep the name.
|
|
2393
|
+
* Move a file
|
|
2394
|
+
*/
|
|
2395
|
+
moveFile(requestParameters, initOverrides) {
|
|
2396
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2397
|
+
const response = yield this.moveFileRaw(requestParameters, initOverrides);
|
|
2398
|
+
return yield response.value();
|
|
2399
|
+
});
|
|
2400
|
+
}
|
|
2401
|
+
/**
|
|
2402
|
+
* Creates request options for prepareFileUpload without sending the request
|
|
2403
|
+
*/
|
|
2404
|
+
prepareFileUploadRequestOpts(requestParameters) {
|
|
2405
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2406
|
+
if (requestParameters['prepareFileUploadRequest'] == null) {
|
|
2407
|
+
throw new runtime.RequiredError('prepareFileUploadRequest', 'Required parameter "prepareFileUploadRequest" was null or undefined when calling prepareFileUpload().');
|
|
2408
|
+
}
|
|
2409
|
+
const queryParameters = {};
|
|
2410
|
+
const headerParameters = {};
|
|
2411
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2412
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2413
|
+
const token = this.configuration.accessToken;
|
|
2414
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2415
|
+
if (tokenString) {
|
|
2416
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
let urlPath = `/v1/direct_uploads`;
|
|
2420
|
+
return {
|
|
2421
|
+
path: urlPath,
|
|
2422
|
+
method: 'POST',
|
|
2423
|
+
headers: headerParameters,
|
|
2424
|
+
query: queryParameters,
|
|
2425
|
+
body: (0, PrepareFileUploadRequest_1.PrepareFileUploadRequestToJSON)(requestParameters['prepareFileUploadRequest']),
|
|
2426
|
+
};
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Returns a storage URL. Then PUT the bytes to direct_upload.url with exactly direct_upload.headers and no API key (step 2), and save the file with POST /v1/mailboxes/{mailbox_id}/files (step 3). Identical content at the same path returns skipped=true and duplicate=true without an upload.
|
|
2431
|
+
* Prepare a file upload (step 1 of 3)
|
|
2432
|
+
*/
|
|
2433
|
+
prepareFileUploadRaw(requestParameters, initOverrides) {
|
|
2434
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2435
|
+
const requestOptions = yield this.prepareFileUploadRequestOpts(requestParameters);
|
|
2436
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2437
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, PrepareFileUpload201Response_1.PrepareFileUpload201ResponseFromJSON)(jsonValue));
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
/**
|
|
2441
|
+
* Returns a storage URL. Then PUT the bytes to direct_upload.url with exactly direct_upload.headers and no API key (step 2), and save the file with POST /v1/mailboxes/{mailbox_id}/files (step 3). Identical content at the same path returns skipped=true and duplicate=true without an upload.
|
|
2442
|
+
* Prepare a file upload (step 1 of 3)
|
|
2443
|
+
*/
|
|
2444
|
+
prepareFileUpload(requestParameters, initOverrides) {
|
|
2445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2446
|
+
const response = yield this.prepareFileUploadRaw(requestParameters, initOverrides);
|
|
2447
|
+
return yield response.value();
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* Creates request options for renameFile without sending the request
|
|
2452
|
+
*/
|
|
2453
|
+
renameFileRequestOpts(requestParameters) {
|
|
2454
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2455
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2456
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling renameFile().');
|
|
2457
|
+
}
|
|
2458
|
+
if (requestParameters['fileId'] == null) {
|
|
2459
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling renameFile().');
|
|
2460
|
+
}
|
|
2461
|
+
if (requestParameters['renameFileRequest'] == null) {
|
|
2462
|
+
throw new runtime.RequiredError('renameFileRequest', 'Required parameter "renameFileRequest" was null or undefined when calling renameFile().');
|
|
2463
|
+
}
|
|
2464
|
+
const queryParameters = {};
|
|
2465
|
+
const headerParameters = {};
|
|
2466
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2467
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2468
|
+
const token = this.configuration.accessToken;
|
|
2469
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2470
|
+
if (tokenString) {
|
|
2471
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/rename`;
|
|
2475
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2476
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
2477
|
+
return {
|
|
2478
|
+
path: urlPath,
|
|
2479
|
+
method: 'POST',
|
|
2480
|
+
headers: headerParameters,
|
|
2481
|
+
query: queryParameters,
|
|
2482
|
+
body: (0, RenameFileRequest_1.RenameFileRequestToJSON)(requestParameters['renameFileRequest']),
|
|
2483
|
+
};
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* Changes the path without uploading the content again.
|
|
2488
|
+
* Rename or move a file in the same mailbox
|
|
2489
|
+
*/
|
|
2490
|
+
renameFileRaw(requestParameters, initOverrides) {
|
|
2491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2492
|
+
const requestOptions = yield this.renameFileRequestOpts(requestParameters);
|
|
2493
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2494
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, RenameFile200Response_1.RenameFile200ResponseFromJSON)(jsonValue));
|
|
2495
|
+
});
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Changes the path without uploading the content again.
|
|
2499
|
+
* Rename or move a file in the same mailbox
|
|
2500
|
+
*/
|
|
2501
|
+
renameFile(requestParameters, initOverrides) {
|
|
2502
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2503
|
+
const response = yield this.renameFileRaw(requestParameters, initOverrides);
|
|
2504
|
+
return yield response.value();
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
/**
|
|
2508
|
+
* Creates request options for requestSignInCode without sending the request
|
|
2509
|
+
*/
|
|
2510
|
+
requestSignInCodeRequestOpts(requestParameters) {
|
|
2511
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2512
|
+
if (requestParameters['requestSignInCodeRequest'] == null) {
|
|
2513
|
+
throw new runtime.RequiredError('requestSignInCodeRequest', 'Required parameter "requestSignInCodeRequest" was null or undefined when calling requestSignInCode().');
|
|
2514
|
+
}
|
|
2515
|
+
const queryParameters = {};
|
|
2516
|
+
const headerParameters = {};
|
|
2517
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2518
|
+
let urlPath = `/v1/agent_auth/request_code`;
|
|
2519
|
+
return {
|
|
2520
|
+
path: urlPath,
|
|
2521
|
+
method: 'POST',
|
|
2522
|
+
headers: headerParameters,
|
|
2523
|
+
query: queryParameters,
|
|
2524
|
+
body: (0, RequestSignInCodeRequest_1.RequestSignInCodeRequestToJSON)(requestParameters['requestSignInCodeRequest']),
|
|
2525
|
+
};
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
/**
|
|
2529
|
+
* Sends a six-digit code to an existing account email. The response is the same for every address, so it never reveals whether an account exists. Create new accounts in the browser at https://app.revdoku.com/users/sign_up.
|
|
2530
|
+
* Email a sign-in code
|
|
2531
|
+
*/
|
|
2532
|
+
requestSignInCodeRaw(requestParameters, initOverrides) {
|
|
2533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2534
|
+
const requestOptions = yield this.requestSignInCodeRequestOpts(requestParameters);
|
|
2535
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2536
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, RequestSignInCode200Response_1.RequestSignInCode200ResponseFromJSON)(jsonValue));
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Sends a six-digit code to an existing account email. The response is the same for every address, so it never reveals whether an account exists. Create new accounts in the browser at https://app.revdoku.com/users/sign_up.
|
|
2541
|
+
* Email a sign-in code
|
|
2542
|
+
*/
|
|
2543
|
+
requestSignInCode(requestParameters, initOverrides) {
|
|
2544
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2545
|
+
const response = yield this.requestSignInCodeRaw(requestParameters, initOverrides);
|
|
2546
|
+
return yield response.value();
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2549
|
+
/**
|
|
2550
|
+
* Creates request options for restoreFileVersion without sending the request
|
|
2551
|
+
*/
|
|
2552
|
+
restoreFileVersionRequestOpts(requestParameters) {
|
|
2553
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2554
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2555
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling restoreFileVersion().');
|
|
2556
|
+
}
|
|
2557
|
+
if (requestParameters['fileId'] == null) {
|
|
2558
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling restoreFileVersion().');
|
|
2559
|
+
}
|
|
2560
|
+
if (requestParameters['versionId'] == null) {
|
|
2561
|
+
throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling restoreFileVersion().');
|
|
2562
|
+
}
|
|
2563
|
+
if (requestParameters['actionRequest'] == null) {
|
|
2564
|
+
throw new runtime.RequiredError('actionRequest', 'Required parameter "actionRequest" was null or undefined when calling restoreFileVersion().');
|
|
2565
|
+
}
|
|
2566
|
+
const queryParameters = {};
|
|
2567
|
+
const headerParameters = {};
|
|
2568
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2569
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2570
|
+
const token = this.configuration.accessToken;
|
|
2571
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2572
|
+
if (tokenString) {
|
|
2573
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files/{file_id}/versions/{version_id}/restore`;
|
|
2577
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2578
|
+
urlPath = urlPath.replace('{file_id}', encodeURIComponent(String(requestParameters['fileId'])));
|
|
2579
|
+
urlPath = urlPath.replace('{version_id}', encodeURIComponent(String(requestParameters['versionId'])));
|
|
2580
|
+
return {
|
|
2581
|
+
path: urlPath,
|
|
2582
|
+
method: 'POST',
|
|
2583
|
+
headers: headerParameters,
|
|
2584
|
+
query: queryParameters,
|
|
2585
|
+
body: (0, ActionRequest_1.ActionRequestToJSON)(requestParameters['actionRequest']),
|
|
2586
|
+
};
|
|
2587
|
+
});
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Creates a new current version with the content of the selected version. History is kept. Requires a plan with version restore.
|
|
2591
|
+
* Restore a file version
|
|
2592
|
+
*/
|
|
2593
|
+
restoreFileVersionRaw(requestParameters, initOverrides) {
|
|
2594
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2595
|
+
const requestOptions = yield this.restoreFileVersionRequestOpts(requestParameters);
|
|
2596
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2597
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, RestoreFileVersion201Response_1.RestoreFileVersion201ResponseFromJSON)(jsonValue));
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* Creates a new current version with the content of the selected version. History is kept. Requires a plan with version restore.
|
|
2602
|
+
* Restore a file version
|
|
2603
|
+
*/
|
|
2604
|
+
restoreFileVersion(requestParameters, initOverrides) {
|
|
2605
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2606
|
+
const response = yield this.restoreFileVersionRaw(requestParameters, initOverrides);
|
|
2607
|
+
return yield response.value();
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Creates request options for saveUploadSessionBatch without sending the request
|
|
2612
|
+
*/
|
|
2613
|
+
saveUploadSessionBatchRequestOpts(requestParameters) {
|
|
2614
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2615
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2616
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling saveUploadSessionBatch().');
|
|
2617
|
+
}
|
|
2618
|
+
if (requestParameters['sessionId'] == null) {
|
|
2619
|
+
throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling saveUploadSessionBatch().');
|
|
2620
|
+
}
|
|
2621
|
+
const queryParameters = {};
|
|
2622
|
+
const headerParameters = {};
|
|
2623
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2624
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2625
|
+
const token = this.configuration.accessToken;
|
|
2626
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2627
|
+
if (tokenString) {
|
|
2628
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/upload_sessions/{session_id}/finalize_batch`;
|
|
2632
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2633
|
+
urlPath = urlPath.replace('{session_id}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
2634
|
+
return {
|
|
2635
|
+
path: urlPath,
|
|
2636
|
+
method: 'POST',
|
|
2637
|
+
headers: headerParameters,
|
|
2638
|
+
query: queryParameters,
|
|
2639
|
+
body: (0, SaveUploadSessionBatchRequest_1.SaveUploadSessionBatchRequestToJSON)(requestParameters['saveUploadSessionBatchRequest']),
|
|
2640
|
+
};
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Saves up to limit files whose bytes were uploaded. Call it after each batch to keep each request short. DIRECT_UPLOAD_NOT_FOUND names a file whose bytes are missing in error.details.path; upload it again and retry.
|
|
2645
|
+
* Save uploaded files
|
|
2646
|
+
*/
|
|
2647
|
+
saveUploadSessionBatchRaw(requestParameters, initOverrides) {
|
|
2648
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2649
|
+
const requestOptions = yield this.saveUploadSessionBatchRequestOpts(requestParameters);
|
|
2650
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2651
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateUploadSession201Response_1.CreateUploadSession201ResponseFromJSON)(jsonValue));
|
|
2652
|
+
});
|
|
2653
|
+
}
|
|
2654
|
+
/**
|
|
2655
|
+
* Saves up to limit files whose bytes were uploaded. Call it after each batch to keep each request short. DIRECT_UPLOAD_NOT_FOUND names a file whose bytes are missing in error.details.path; upload it again and retry.
|
|
2656
|
+
* Save uploaded files
|
|
2657
|
+
*/
|
|
2658
|
+
saveUploadSessionBatch(requestParameters, initOverrides) {
|
|
2659
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2660
|
+
const response = yield this.saveUploadSessionBatchRaw(requestParameters, initOverrides);
|
|
2661
|
+
return yield response.value();
|
|
2662
|
+
});
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Creates request options for saveUploadedFile without sending the request
|
|
2666
|
+
*/
|
|
2667
|
+
saveUploadedFileRequestOpts(requestParameters) {
|
|
2668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2669
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2670
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling saveUploadedFile().');
|
|
2671
|
+
}
|
|
2672
|
+
if (requestParameters['saveUploadedFileRequest'] == null) {
|
|
2673
|
+
throw new runtime.RequiredError('saveUploadedFileRequest', 'Required parameter "saveUploadedFileRequest" was null or undefined when calling saveUploadedFile().');
|
|
2674
|
+
}
|
|
2675
|
+
const queryParameters = {};
|
|
2676
|
+
const headerParameters = {};
|
|
2677
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2678
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2679
|
+
const token = this.configuration.accessToken;
|
|
2680
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2681
|
+
if (tokenString) {
|
|
2682
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/files`;
|
|
2686
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2687
|
+
return {
|
|
2688
|
+
path: urlPath,
|
|
2689
|
+
method: 'POST',
|
|
2690
|
+
headers: headerParameters,
|
|
2691
|
+
query: queryParameters,
|
|
2692
|
+
body: (0, SaveUploadedFileRequest_1.SaveUploadedFileRequestToJSON)(requestParameters['saveUploadedFileRequest']),
|
|
2693
|
+
};
|
|
2694
|
+
});
|
|
2695
|
+
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Saves the uploaded blob at path. An existing path gets a new version.
|
|
2698
|
+
* Save an uploaded file (step 3 of 3)
|
|
2699
|
+
*/
|
|
2700
|
+
saveUploadedFileRaw(requestParameters, initOverrides) {
|
|
2701
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2702
|
+
const requestOptions = yield this.saveUploadedFileRequestOpts(requestParameters);
|
|
2703
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2704
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, SaveUploadedFile201Response_1.SaveUploadedFile201ResponseFromJSON)(jsonValue));
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2708
|
+
* Saves the uploaded blob at path. An existing path gets a new version.
|
|
2709
|
+
* Save an uploaded file (step 3 of 3)
|
|
2710
|
+
*/
|
|
2711
|
+
saveUploadedFile(requestParameters, initOverrides) {
|
|
2712
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2713
|
+
const response = yield this.saveUploadedFileRaw(requestParameters, initOverrides);
|
|
2714
|
+
return yield response.value();
|
|
2715
|
+
});
|
|
2716
|
+
}
|
|
2717
|
+
/**
|
|
2718
|
+
* Creates request options for sendEmail without sending the request
|
|
2719
|
+
*/
|
|
2720
|
+
sendEmailRequestOpts(requestParameters) {
|
|
2721
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2722
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2723
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling sendEmail().');
|
|
2724
|
+
}
|
|
2725
|
+
if (requestParameters['sendEmailRequest'] == null) {
|
|
2726
|
+
throw new runtime.RequiredError('sendEmailRequest', 'Required parameter "sendEmailRequest" was null or undefined when calling sendEmail().');
|
|
2727
|
+
}
|
|
2728
|
+
const queryParameters = {};
|
|
2729
|
+
const headerParameters = {};
|
|
2730
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2731
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2732
|
+
const token = this.configuration.accessToken;
|
|
2733
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2734
|
+
if (tokenString) {
|
|
2735
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails`;
|
|
2739
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2740
|
+
return {
|
|
2741
|
+
path: urlPath,
|
|
2742
|
+
method: 'POST',
|
|
2743
|
+
headers: headerParameters,
|
|
2744
|
+
query: queryParameters,
|
|
2745
|
+
body: (0, SendEmailRequest_1.SendEmailRequestToJSON)(requestParameters['sendEmailRequest']),
|
|
2746
|
+
};
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
/**
|
|
2750
|
+
* Requires mailbox write permission. Send only to account members, to other mailboxes of the account, or to addresses that emailed this mailbox and passed sender authentication; an administrator can turn off each kind. When the mailbox requires approval, delivery.status is awaiting_approval until a person sends, edits or declines the email; do not send it again. Replying to or attaching an email that AI labels marked as Junk returns 403 EMAIL_WITHHELD; one they are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After. The From name is the mailbox title. On the Free plan, the email ends with one line about Revdoku. Set in_reply_to to reply. Delivery is asynchronous: read delivery.status later. After an unknown result, list direction=sent before you send again.
|
|
2751
|
+
* Send an email
|
|
2752
|
+
*/
|
|
2753
|
+
sendEmailRaw(requestParameters, initOverrides) {
|
|
2754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2755
|
+
const requestOptions = yield this.sendEmailRequestOpts(requestParameters);
|
|
2756
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2757
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, SendEmail202Response_1.SendEmail202ResponseFromJSON)(jsonValue));
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
/**
|
|
2761
|
+
* Requires mailbox write permission. Send only to account members, to other mailboxes of the account, or to addresses that emailed this mailbox and passed sender authentication; an administrator can turn off each kind. When the mailbox requires approval, delivery.status is awaiting_approval until a person sends, edits or declines the email; do not send it again. Replying to or attaching an email that AI labels marked as Junk returns 403 EMAIL_WITHHELD; one they are still checking returns 503 EMAIL_LABELING_PENDING with Retry-After. The From name is the mailbox title. On the Free plan, the email ends with one line about Revdoku. Set in_reply_to to reply. Delivery is asynchronous: read delivery.status later. After an unknown result, list direction=sent before you send again.
|
|
2762
|
+
* Send an email
|
|
2763
|
+
*/
|
|
2764
|
+
sendEmail(requestParameters, initOverrides) {
|
|
2765
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2766
|
+
const response = yield this.sendEmailRaw(requestParameters, initOverrides);
|
|
2767
|
+
return yield response.value();
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* Creates request options for setEmailWebhook without sending the request
|
|
2772
|
+
*/
|
|
2773
|
+
setEmailWebhookRequestOpts(requestParameters) {
|
|
2774
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2775
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2776
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling setEmailWebhook().');
|
|
2777
|
+
}
|
|
2778
|
+
if (requestParameters['setEmailWebhookRequest'] == null) {
|
|
2779
|
+
throw new runtime.RequiredError('setEmailWebhookRequest', 'Required parameter "setEmailWebhookRequest" was null or undefined when calling setEmailWebhook().');
|
|
2780
|
+
}
|
|
2781
|
+
const queryParameters = {};
|
|
2782
|
+
const headerParameters = {};
|
|
2783
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2784
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2785
|
+
const token = this.configuration.accessToken;
|
|
2786
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2787
|
+
if (tokenString) {
|
|
2788
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/webhook`;
|
|
2792
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2793
|
+
return {
|
|
2794
|
+
path: urlPath,
|
|
2795
|
+
method: 'PUT',
|
|
2796
|
+
headers: headerParameters,
|
|
2797
|
+
query: queryParameters,
|
|
2798
|
+
body: (0, SetEmailWebhookRequest_1.SetEmailWebhookRequestToJSON)(requestParameters['setEmailWebhookRequest']),
|
|
2799
|
+
};
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
/**
|
|
2803
|
+
* Requires mailbox-admin permission and a public HTTPS URL. A new URL or rotate_secret=true creates a new signing secret, returns it once and cancels pending deliveries. The same URL without rotate_secret returns the webhook without a secret.
|
|
2804
|
+
* Set the email webhook
|
|
2805
|
+
*/
|
|
2806
|
+
setEmailWebhookRaw(requestParameters, initOverrides) {
|
|
2807
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2808
|
+
const requestOptions = yield this.setEmailWebhookRequestOpts(requestParameters);
|
|
2809
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2810
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, SetEmailWebhook200Response_1.SetEmailWebhook200ResponseFromJSON)(jsonValue));
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
/**
|
|
2814
|
+
* Requires mailbox-admin permission and a public HTTPS URL. A new URL or rotate_secret=true creates a new signing secret, returns it once and cancels pending deliveries. The same URL without rotate_secret returns the webhook without a secret.
|
|
2815
|
+
* Set the email webhook
|
|
2816
|
+
*/
|
|
2817
|
+
setEmailWebhook(requestParameters, initOverrides) {
|
|
2818
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2819
|
+
const response = yield this.setEmailWebhookRaw(requestParameters, initOverrides);
|
|
2820
|
+
return yield response.value();
|
|
2821
|
+
});
|
|
2822
|
+
}
|
|
2823
|
+
/**
|
|
2824
|
+
* Creates request options for unarchiveMailbox without sending the request
|
|
2825
|
+
*/
|
|
2826
|
+
unarchiveMailboxRequestOpts(requestParameters) {
|
|
2827
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2828
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2829
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling unarchiveMailbox().');
|
|
2830
|
+
}
|
|
2831
|
+
if (requestParameters['actionRequest'] == null) {
|
|
2832
|
+
throw new runtime.RequiredError('actionRequest', 'Required parameter "actionRequest" was null or undefined when calling unarchiveMailbox().');
|
|
2833
|
+
}
|
|
2834
|
+
const queryParameters = {};
|
|
2835
|
+
const headerParameters = {};
|
|
2836
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2837
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2838
|
+
const token = this.configuration.accessToken;
|
|
2839
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2840
|
+
if (tokenString) {
|
|
2841
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/unarchive`;
|
|
2845
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2846
|
+
return {
|
|
2847
|
+
path: urlPath,
|
|
2848
|
+
method: 'POST',
|
|
2849
|
+
headers: headerParameters,
|
|
2850
|
+
query: queryParameters,
|
|
2851
|
+
body: (0, ActionRequest_1.ActionRequestToJSON)(requestParameters['actionRequest']),
|
|
2852
|
+
};
|
|
2853
|
+
});
|
|
2854
|
+
}
|
|
2855
|
+
/**
|
|
2856
|
+
* Requires mailbox-admin permission. The mailbox becomes writable again. If another active mailbox has the same title, the title gets a number suffix. A mailbox that is not archived returns MAILBOX_NOT_ARCHIVED.
|
|
2857
|
+
* Unarchive a mailbox
|
|
2858
|
+
*/
|
|
2859
|
+
unarchiveMailboxRaw(requestParameters, initOverrides) {
|
|
2860
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2861
|
+
const requestOptions = yield this.unarchiveMailboxRequestOpts(requestParameters);
|
|
2862
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2863
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateMailbox201Response_1.CreateMailbox201ResponseFromJSON)(jsonValue));
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
/**
|
|
2867
|
+
* Requires mailbox-admin permission. The mailbox becomes writable again. If another active mailbox has the same title, the title gets a number suffix. A mailbox that is not archived returns MAILBOX_NOT_ARCHIVED.
|
|
2868
|
+
* Unarchive a mailbox
|
|
2869
|
+
*/
|
|
2870
|
+
unarchiveMailbox(requestParameters, initOverrides) {
|
|
2871
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2872
|
+
const response = yield this.unarchiveMailboxRaw(requestParameters, initOverrides);
|
|
2873
|
+
return yield response.value();
|
|
2874
|
+
});
|
|
2875
|
+
}
|
|
2876
|
+
/**
|
|
2877
|
+
* Creates request options for updateEmail without sending the request
|
|
2878
|
+
*/
|
|
2879
|
+
updateEmailRequestOpts(requestParameters) {
|
|
2880
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2881
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2882
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling updateEmail().');
|
|
2883
|
+
}
|
|
2884
|
+
if (requestParameters['emailId'] == null) {
|
|
2885
|
+
throw new runtime.RequiredError('emailId', 'Required parameter "emailId" was null or undefined when calling updateEmail().');
|
|
2886
|
+
}
|
|
2887
|
+
if (requestParameters['updateEmailRequest'] == null) {
|
|
2888
|
+
throw new runtime.RequiredError('updateEmailRequest', 'Required parameter "updateEmailRequest" was null or undefined when calling updateEmail().');
|
|
2889
|
+
}
|
|
2890
|
+
const queryParameters = {};
|
|
2891
|
+
if (requestParameters['includeStorage'] != null) {
|
|
2892
|
+
queryParameters['include_storage'] = requestParameters['includeStorage'];
|
|
2893
|
+
}
|
|
2894
|
+
const headerParameters = {};
|
|
2895
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2896
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2897
|
+
const token = this.configuration.accessToken;
|
|
2898
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2899
|
+
if (tokenString) {
|
|
2900
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/emails/{email_id}`;
|
|
2904
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2905
|
+
urlPath = urlPath.replace('{email_id}', encodeURIComponent(String(requestParameters['emailId'])));
|
|
2906
|
+
return {
|
|
2907
|
+
path: urlPath,
|
|
2908
|
+
method: 'PATCH',
|
|
2909
|
+
headers: headerParameters,
|
|
2910
|
+
query: queryParameters,
|
|
2911
|
+
body: (0, UpdateEmailRequest_1.UpdateEmailRequestToJSON)(requestParameters['updateEmailRequest']),
|
|
2912
|
+
};
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
* Changes read status and custom labels. Send at least one of read, add_labels and remove_labels. Labels need write access. A new label name creates the label. Built-in labels such as Junk change only in the dashboard.
|
|
2917
|
+
* Update an email\'s read status or labels
|
|
2918
|
+
*/
|
|
2919
|
+
updateEmailRaw(requestParameters, initOverrides) {
|
|
2920
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2921
|
+
const requestOptions = yield this.updateEmailRequestOpts(requestParameters);
|
|
2922
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2923
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, SendEmail202Response_1.SendEmail202ResponseFromJSON)(jsonValue));
|
|
2924
|
+
});
|
|
2925
|
+
}
|
|
2926
|
+
/**
|
|
2927
|
+
* Changes read status and custom labels. Send at least one of read, add_labels and remove_labels. Labels need write access. A new label name creates the label. Built-in labels such as Junk change only in the dashboard.
|
|
2928
|
+
* Update an email\'s read status or labels
|
|
2929
|
+
*/
|
|
2930
|
+
updateEmail(requestParameters, initOverrides) {
|
|
2931
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2932
|
+
const response = yield this.updateEmailRaw(requestParameters, initOverrides);
|
|
2933
|
+
return yield response.value();
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* Creates request options for updateEmailAllowlist without sending the request
|
|
2938
|
+
*/
|
|
2939
|
+
updateEmailAllowlistRequestOpts(requestParameters) {
|
|
2940
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2941
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2942
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling updateEmailAllowlist().');
|
|
2943
|
+
}
|
|
2944
|
+
if (requestParameters['updateEmailAllowlistRequest'] == null) {
|
|
2945
|
+
throw new runtime.RequiredError('updateEmailAllowlistRequest', 'Required parameter "updateEmailAllowlistRequest" was null or undefined when calling updateEmailAllowlist().');
|
|
2946
|
+
}
|
|
2947
|
+
const queryParameters = {};
|
|
2948
|
+
const headerParameters = {};
|
|
2949
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2950
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2951
|
+
const token = this.configuration.accessToken;
|
|
2952
|
+
const tokenString = yield token("bearerAuth", []);
|
|
2953
|
+
if (tokenString) {
|
|
2954
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}/email/allowlist`;
|
|
2958
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
2959
|
+
return {
|
|
2960
|
+
path: urlPath,
|
|
2961
|
+
method: 'PATCH',
|
|
2962
|
+
headers: headerParameters,
|
|
2963
|
+
query: queryParameters,
|
|
2964
|
+
body: (0, UpdateEmailAllowlistRequest_1.UpdateEmailAllowlistRequestToJSON)(requestParameters['updateEmailAllowlistRequest']),
|
|
2965
|
+
};
|
|
2966
|
+
});
|
|
2967
|
+
}
|
|
2968
|
+
/**
|
|
2969
|
+
* Requires an account owner or administrator with mailbox-admin permission. Send sender_allowlist.version from the settings read as expected_version.
|
|
2970
|
+
* Replace the allowed senders
|
|
2971
|
+
*/
|
|
2972
|
+
updateEmailAllowlistRaw(requestParameters, initOverrides) {
|
|
2973
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2974
|
+
const requestOptions = yield this.updateEmailAllowlistRequestOpts(requestParameters);
|
|
2975
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
2976
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, UpdateEmailAllowlist200Response_1.UpdateEmailAllowlist200ResponseFromJSON)(jsonValue));
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2979
|
+
/**
|
|
2980
|
+
* Requires an account owner or administrator with mailbox-admin permission. Send sender_allowlist.version from the settings read as expected_version.
|
|
2981
|
+
* Replace the allowed senders
|
|
2982
|
+
*/
|
|
2983
|
+
updateEmailAllowlist(requestParameters, initOverrides) {
|
|
2984
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2985
|
+
const response = yield this.updateEmailAllowlistRaw(requestParameters, initOverrides);
|
|
2986
|
+
return yield response.value();
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
/**
|
|
2990
|
+
* Creates request options for updateMailbox without sending the request
|
|
2991
|
+
*/
|
|
2992
|
+
updateMailboxRequestOpts(requestParameters) {
|
|
2993
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2994
|
+
if (requestParameters['mailboxId'] == null) {
|
|
2995
|
+
throw new runtime.RequiredError('mailboxId', 'Required parameter "mailboxId" was null or undefined when calling updateMailbox().');
|
|
2996
|
+
}
|
|
2997
|
+
if (requestParameters['updateMailboxRequest'] == null) {
|
|
2998
|
+
throw new runtime.RequiredError('updateMailboxRequest', 'Required parameter "updateMailboxRequest" was null or undefined when calling updateMailbox().');
|
|
2999
|
+
}
|
|
3000
|
+
const queryParameters = {};
|
|
3001
|
+
const headerParameters = {};
|
|
3002
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
3003
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
3004
|
+
const token = this.configuration.accessToken;
|
|
3005
|
+
const tokenString = yield token("bearerAuth", []);
|
|
3006
|
+
if (tokenString) {
|
|
3007
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
let urlPath = `/v1/mailboxes/{mailbox_id}`;
|
|
3011
|
+
urlPath = urlPath.replace('{mailbox_id}', encodeURIComponent(String(requestParameters['mailboxId'])));
|
|
3012
|
+
return {
|
|
3013
|
+
path: urlPath,
|
|
3014
|
+
method: 'PATCH',
|
|
3015
|
+
headers: headerParameters,
|
|
3016
|
+
query: queryParameters,
|
|
3017
|
+
body: (0, UpdateMailboxRequest_1.UpdateMailboxRequestToJSON)(requestParameters['updateMailboxRequest']),
|
|
3018
|
+
};
|
|
3019
|
+
});
|
|
3020
|
+
}
|
|
3021
|
+
/**
|
|
3022
|
+
* metadata must be a JSON object. It replaces the stored object; {} clears it. Send expected_metadata_version from your last read; a stale value changes nothing and returns MAILBOX_METADATA_CONFLICT. Titles are unique among active mailboxes; a used title returns 409 MAILBOX_TITLE_TAKEN.
|
|
3023
|
+
* Update a mailbox title, description or metadata
|
|
3024
|
+
*/
|
|
3025
|
+
updateMailboxRaw(requestParameters, initOverrides) {
|
|
3026
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3027
|
+
const requestOptions = yield this.updateMailboxRequestOpts(requestParameters);
|
|
3028
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
3029
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateMailbox201Response_1.CreateMailbox201ResponseFromJSON)(jsonValue));
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* metadata must be a JSON object. It replaces the stored object; {} clears it. Send expected_metadata_version from your last read; a stale value changes nothing and returns MAILBOX_METADATA_CONFLICT. Titles are unique among active mailboxes; a used title returns 409 MAILBOX_TITLE_TAKEN.
|
|
3034
|
+
* Update a mailbox title, description or metadata
|
|
3035
|
+
*/
|
|
3036
|
+
updateMailbox(requestParameters, initOverrides) {
|
|
3037
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3038
|
+
const response = yield this.updateMailboxRaw(requestParameters, initOverrides);
|
|
3039
|
+
return yield response.value();
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
/**
|
|
3043
|
+
* Creates request options for verifyEmailDomain without sending the request
|
|
3044
|
+
*/
|
|
3045
|
+
verifyEmailDomainRequestOpts(requestParameters) {
|
|
3046
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3047
|
+
if (requestParameters['domainId'] == null) {
|
|
3048
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling verifyEmailDomain().');
|
|
3049
|
+
}
|
|
3050
|
+
if (requestParameters['verifyEmailDomainRequest'] == null) {
|
|
3051
|
+
throw new runtime.RequiredError('verifyEmailDomainRequest', 'Required parameter "verifyEmailDomainRequest" was null or undefined when calling verifyEmailDomain().');
|
|
3052
|
+
}
|
|
3053
|
+
const queryParameters = {};
|
|
3054
|
+
const headerParameters = {};
|
|
3055
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
3056
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
3057
|
+
const token = this.configuration.accessToken;
|
|
3058
|
+
const tokenString = yield token("bearerAuth", []);
|
|
3059
|
+
if (tokenString) {
|
|
3060
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
let urlPath = `/v1/account/email_domains/{domain_id}/verify`;
|
|
3064
|
+
urlPath = urlPath.replace('{domain_id}', encodeURIComponent(String(requestParameters['domainId'])));
|
|
3065
|
+
return {
|
|
3066
|
+
path: urlPath,
|
|
3067
|
+
method: 'POST',
|
|
3068
|
+
headers: headerParameters,
|
|
3069
|
+
query: queryParameters,
|
|
3070
|
+
body: (0, VerifyEmailDomainRequest_1.VerifyEmailDomainRequestToJSON)(requestParameters['verifyEmailDomainRequest']),
|
|
3071
|
+
};
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
/**
|
|
3075
|
+
* Queues the check and returns the current state. Read the domain again to see the result.
|
|
3076
|
+
* Check DNS and provider setup again
|
|
3077
|
+
*/
|
|
3078
|
+
verifyEmailDomainRaw(requestParameters, initOverrides) {
|
|
3079
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3080
|
+
const requestOptions = yield this.verifyEmailDomainRequestOpts(requestParameters);
|
|
3081
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
3082
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateEmailDomain201Response_1.CreateEmailDomain201ResponseFromJSON)(jsonValue));
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Queues the check and returns the current state. Read the domain again to see the result.
|
|
3087
|
+
* Check DNS and provider setup again
|
|
3088
|
+
*/
|
|
3089
|
+
verifyEmailDomain(requestParameters, initOverrides) {
|
|
3090
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3091
|
+
const response = yield this.verifyEmailDomainRaw(requestParameters, initOverrides);
|
|
3092
|
+
return yield response.value();
|
|
3093
|
+
});
|
|
3094
|
+
}
|
|
3095
|
+
/**
|
|
3096
|
+
* Creates request options for verifySignInCode without sending the request
|
|
3097
|
+
*/
|
|
3098
|
+
verifySignInCodeRequestOpts(requestParameters) {
|
|
3099
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3100
|
+
if (requestParameters['verifySignInCodeRequest'] == null) {
|
|
3101
|
+
throw new runtime.RequiredError('verifySignInCodeRequest', 'Required parameter "verifySignInCodeRequest" was null or undefined when calling verifySignInCode().');
|
|
3102
|
+
}
|
|
3103
|
+
const queryParameters = {};
|
|
3104
|
+
const headerParameters = {};
|
|
3105
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
3106
|
+
let urlPath = `/v1/agent_auth/verify_code`;
|
|
3107
|
+
return {
|
|
3108
|
+
path: urlPath,
|
|
3109
|
+
method: 'POST',
|
|
3110
|
+
headers: headerParameters,
|
|
3111
|
+
query: queryParameters,
|
|
3112
|
+
body: (0, VerifySignInCodeRequest_1.VerifySignInCodeRequestToJSON)(requestParameters['verifySignInCodeRequest']),
|
|
3113
|
+
};
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
/**
|
|
3117
|
+
* Creates an AI agent connection for an account owner or administrator. Accounts with two-factor authentication must use browser sign-in.
|
|
3118
|
+
* Exchange a sign-in code for an API key
|
|
3119
|
+
*/
|
|
3120
|
+
verifySignInCodeRaw(requestParameters, initOverrides) {
|
|
3121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3122
|
+
const requestOptions = yield this.verifySignInCodeRequestOpts(requestParameters);
|
|
3123
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
3124
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, VerifySignInCode201Response_1.VerifySignInCode201ResponseFromJSON)(jsonValue));
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3127
|
+
/**
|
|
3128
|
+
* Creates an AI agent connection for an account owner or administrator. Accounts with two-factor authentication must use browser sign-in.
|
|
3129
|
+
* Exchange a sign-in code for an API key
|
|
3130
|
+
*/
|
|
3131
|
+
verifySignInCode(requestParameters, initOverrides) {
|
|
3132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3133
|
+
const response = yield this.verifySignInCodeRaw(requestParameters, initOverrides);
|
|
3134
|
+
return yield response.value();
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
exports.DefaultApi = DefaultApi;
|
|
3139
|
+
/**
|
|
3140
|
+
* @export
|
|
3141
|
+
*/
|
|
3142
|
+
exports.ListEmailsOrderEnum = {
|
|
3143
|
+
Asc: 'asc',
|
|
3144
|
+
Desc: 'desc',
|
|
3145
|
+
};
|
|
3146
|
+
/**
|
|
3147
|
+
* @export
|
|
3148
|
+
*/
|
|
3149
|
+
exports.ListEmailsDirectionEnum = {
|
|
3150
|
+
Received: 'received',
|
|
3151
|
+
Sent: 'sent',
|
|
3152
|
+
All: 'all',
|
|
3153
|
+
};
|
|
3154
|
+
/**
|
|
3155
|
+
* @export
|
|
3156
|
+
*/
|
|
3157
|
+
exports.ListMailboxesStatusEnum = {
|
|
3158
|
+
Active: 'active',
|
|
3159
|
+
Archived: 'archived',
|
|
3160
|
+
All: 'all',
|
|
3161
|
+
};
|