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