hostinger-mail-api-sdk 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-release.yaml +91 -0
- package/CODEOWNERS +1 -0
- package/README.md +9 -0
- package/api.ts +3760 -0
- package/base.ts +83 -0
- package/common.ts +111 -0
- package/configuration.ts +72 -0
- package/dist/api.d.ts +2426 -0
- package/dist/api.js +2484 -0
- package/dist/base.d.ts +63 -0
- package/dist/base.js +62 -0
- package/dist/common.d.ts +47 -0
- package/dist/common.js +118 -0
- package/dist/configuration.d.ts +51 -0
- package/dist/configuration.js +37 -0
- package/dist/esm/api.d.ts +2426 -0
- package/dist/esm/api.js +2457 -0
- package/dist/esm/base.d.ts +63 -0
- package/dist/esm/base.js +57 -0
- package/dist/esm/common.d.ts +47 -0
- package/dist/esm/common.js +109 -0
- package/dist/esm/configuration.d.ts +51 -0
- package/dist/esm/configuration.js +33 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +12 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +28 -0
- package/docs/AccountApi.md +55 -0
- package/docs/Error.md +25 -0
- package/docs/FoldersApi.md +259 -0
- package/docs/MessagesApi.md +860 -0
- package/docs/Pagination.md +27 -0
- package/docs/QuotaApi.md +63 -0
- package/docs/SendApi.md +68 -0
- package/docs/V1FolderMessagesCollection.md +23 -0
- package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
- package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
- package/docs/V1FolderMessagesFlagsRequest.md +23 -0
- package/docs/V1FolderMessagesMessage.md +47 -0
- package/docs/V1FolderMessagesMessageAddress.md +23 -0
- package/docs/V1FolderMessagesMessageAttachment.md +31 -0
- package/docs/V1FolderMessagesMessageText.md +23 -0
- package/docs/V1FolderMessagesMessageTextResource.md +21 -0
- package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
- package/docs/V1FolderMessagesMoveRequest.md +21 -0
- package/docs/V1FolderMessagesResource.md +21 -0
- package/docs/V1FolderMessagesSearchRequest.md +45 -0
- package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
- package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
- package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
- package/docs/V1FoldersCollection.md +23 -0
- package/docs/V1FoldersCreateRequest.md +21 -0
- package/docs/V1FoldersFolder.md +31 -0
- package/docs/V1FoldersResource.md +21 -0
- package/docs/V1FoldersUpdateRequest.md +21 -0
- package/docs/V1MeMailbox.md +23 -0
- package/docs/V1MeResource.md +21 -0
- package/docs/V1MeResourceData.md +22 -0
- package/docs/V1QuotaQuota.md +29 -0
- package/docs/V1QuotaQuotaResource.md +27 -0
- package/docs/V1QuotaResource.md +21 -0
- package/docs/V1SendAttachment.md +29 -0
- package/docs/V1SendRequest.md +35 -0
- package/docs/V1WebhooksCollection.md +23 -0
- package/docs/V1WebhooksCreateRequest.md +29 -0
- package/docs/V1WebhooksResource.md +21 -0
- package/docs/V1WebhooksResourceWithSecret.md +21 -0
- package/docs/V1WebhooksTestResult.md +21 -0
- package/docs/V1WebhooksTestResultData.md +24 -0
- package/docs/V1WebhooksUpdateRequest.md +29 -0
- package/docs/V1WebhooksWebhook.md +39 -0
- package/docs/V1WebhooksWebhookWithSecret.md +41 -0
- package/docs/WebhooksApi.md +439 -0
- package/index.ts +15 -0
- package/package.json +34 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
package/dist/esm/api.js
ADDED
|
@@ -0,0 +1,2457 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hostinger Email API
|
|
5
|
+
*
|
|
6
|
+
* API Version: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
import globalAxios from 'axios';
|
|
21
|
+
// Some imports not used depending on template conditions
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
import { BASE_PATH, BaseAPI, operationServerMap } from './base';
|
|
26
|
+
export const V1WebhooksCreateRequestEventsEnum = {
|
|
27
|
+
MessageReceived: 'message.received'
|
|
28
|
+
};
|
|
29
|
+
export const V1WebhooksCreateRequestStatusEnum = {
|
|
30
|
+
Active: 'active',
|
|
31
|
+
Paused: 'paused',
|
|
32
|
+
Disabled: 'disabled'
|
|
33
|
+
};
|
|
34
|
+
export const V1WebhooksUpdateRequestEventsEnum = {
|
|
35
|
+
MessageReceived: 'message.received'
|
|
36
|
+
};
|
|
37
|
+
export const V1WebhooksUpdateRequestStatusEnum = {
|
|
38
|
+
Active: 'active',
|
|
39
|
+
Paused: 'paused',
|
|
40
|
+
Disabled: 'disabled'
|
|
41
|
+
};
|
|
42
|
+
export const V1WebhooksWebhookEventsEnum = {
|
|
43
|
+
MessageReceived: 'message.received'
|
|
44
|
+
};
|
|
45
|
+
export const V1WebhooksWebhookStatusEnum = {
|
|
46
|
+
Active: 'active',
|
|
47
|
+
Paused: 'paused',
|
|
48
|
+
Disabled: 'disabled'
|
|
49
|
+
};
|
|
50
|
+
export const V1WebhooksWebhookWithSecretEventsEnum = {
|
|
51
|
+
MessageReceived: 'message.received'
|
|
52
|
+
};
|
|
53
|
+
export const V1WebhooksWebhookWithSecretStatusEnum = {
|
|
54
|
+
Active: 'active',
|
|
55
|
+
Paused: 'paused',
|
|
56
|
+
Disabled: 'disabled'
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* AccountApi - axios parameter creator
|
|
60
|
+
* @export
|
|
61
|
+
*/
|
|
62
|
+
export const AccountApiAxiosParamCreator = function (configuration) {
|
|
63
|
+
return {
|
|
64
|
+
/**
|
|
65
|
+
* Returns the authenticated account and the mailboxes it can manage.
|
|
66
|
+
* @summary Get the authenticated account
|
|
67
|
+
* @param {*} [options] Override http request option.
|
|
68
|
+
* @throws {RequiredError}
|
|
69
|
+
*/
|
|
70
|
+
getCurrentAccount: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
|
|
71
|
+
const localVarPath = `/api/v1/me`;
|
|
72
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
73
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
74
|
+
let baseOptions;
|
|
75
|
+
if (configuration) {
|
|
76
|
+
baseOptions = configuration.baseOptions;
|
|
77
|
+
}
|
|
78
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
79
|
+
const localVarHeaderParameter = {};
|
|
80
|
+
const localVarQueryParameter = {};
|
|
81
|
+
// authentication BearerAuth required
|
|
82
|
+
// http bearer authentication required
|
|
83
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
84
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
85
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
86
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
87
|
+
return {
|
|
88
|
+
url: toPathString(localVarUrlObj),
|
|
89
|
+
options: localVarRequestOptions,
|
|
90
|
+
};
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* AccountApi - functional programming interface
|
|
96
|
+
* @export
|
|
97
|
+
*/
|
|
98
|
+
export const AccountApiFp = function (configuration) {
|
|
99
|
+
const localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
|
|
100
|
+
return {
|
|
101
|
+
/**
|
|
102
|
+
* Returns the authenticated account and the mailboxes it can manage.
|
|
103
|
+
* @summary Get the authenticated account
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
getCurrentAccount(options) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCurrentAccount(options);
|
|
111
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['AccountApi.getCurrentAccount']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
112
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* AccountApi - factory interface
|
|
119
|
+
* @export
|
|
120
|
+
*/
|
|
121
|
+
export const AccountApiFactory = function (configuration, basePath, axios) {
|
|
122
|
+
const localVarFp = AccountApiFp(configuration);
|
|
123
|
+
return {
|
|
124
|
+
/**
|
|
125
|
+
* Returns the authenticated account and the mailboxes it can manage.
|
|
126
|
+
* @summary Get the authenticated account
|
|
127
|
+
* @param {*} [options] Override http request option.
|
|
128
|
+
* @throws {RequiredError}
|
|
129
|
+
*/
|
|
130
|
+
getCurrentAccount(options) {
|
|
131
|
+
return localVarFp.getCurrentAccount(options).then((request) => request(axios, basePath));
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* AccountApi - object-oriented interface
|
|
137
|
+
* @export
|
|
138
|
+
* @class AccountApi
|
|
139
|
+
* @extends {BaseAPI}
|
|
140
|
+
*/
|
|
141
|
+
export class AccountApi extends BaseAPI {
|
|
142
|
+
/**
|
|
143
|
+
* Returns the authenticated account and the mailboxes it can manage.
|
|
144
|
+
* @summary Get the authenticated account
|
|
145
|
+
* @param {*} [options] Override http request option.
|
|
146
|
+
* @throws {RequiredError}
|
|
147
|
+
* @memberof AccountApi
|
|
148
|
+
*/
|
|
149
|
+
getCurrentAccount(options) {
|
|
150
|
+
return AccountApiFp(this.configuration).getCurrentAccount(options).then((request) => request(this.axios, this.basePath));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* FoldersApi - axios parameter creator
|
|
155
|
+
* @export
|
|
156
|
+
*/
|
|
157
|
+
export const FoldersApiAxiosParamCreator = function (configuration) {
|
|
158
|
+
return {
|
|
159
|
+
/**
|
|
160
|
+
* Create a new folder in the managed mailbox.
|
|
161
|
+
* @summary Create folder
|
|
162
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
163
|
+
* @param {V1FoldersCreateRequest} v1FoldersCreateRequest
|
|
164
|
+
* @param {*} [options] Override http request option.
|
|
165
|
+
* @throws {RequiredError}
|
|
166
|
+
*/
|
|
167
|
+
createFolder: (mailboxResourceId_1, v1FoldersCreateRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, v1FoldersCreateRequest_1, ...args_1], void 0, function* (mailboxResourceId, v1FoldersCreateRequest, options = {}) {
|
|
168
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
169
|
+
assertParamExists('createFolder', 'mailboxResourceId', mailboxResourceId);
|
|
170
|
+
// verify required parameter 'v1FoldersCreateRequest' is not null or undefined
|
|
171
|
+
assertParamExists('createFolder', 'v1FoldersCreateRequest', v1FoldersCreateRequest);
|
|
172
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders`
|
|
173
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
174
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
175
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
176
|
+
let baseOptions;
|
|
177
|
+
if (configuration) {
|
|
178
|
+
baseOptions = configuration.baseOptions;
|
|
179
|
+
}
|
|
180
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
181
|
+
const localVarHeaderParameter = {};
|
|
182
|
+
const localVarQueryParameter = {};
|
|
183
|
+
// authentication BearerAuth required
|
|
184
|
+
// http bearer authentication required
|
|
185
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
186
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
187
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
188
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
189
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
190
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FoldersCreateRequest, localVarRequestOptions, configuration);
|
|
191
|
+
return {
|
|
192
|
+
url: toPathString(localVarUrlObj),
|
|
193
|
+
options: localVarRequestOptions,
|
|
194
|
+
};
|
|
195
|
+
}),
|
|
196
|
+
/**
|
|
197
|
+
* Delete a folder and all of its subfolders.
|
|
198
|
+
* @summary Delete folder
|
|
199
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
200
|
+
* @param {string} folder Folder path to delete (URL-encoded).
|
|
201
|
+
* @param {*} [options] Override http request option.
|
|
202
|
+
* @throws {RequiredError}
|
|
203
|
+
*/
|
|
204
|
+
deleteFolder: (mailboxResourceId_1, folder_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, ...args_1], void 0, function* (mailboxResourceId, folder, options = {}) {
|
|
205
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
206
|
+
assertParamExists('deleteFolder', 'mailboxResourceId', mailboxResourceId);
|
|
207
|
+
// verify required parameter 'folder' is not null or undefined
|
|
208
|
+
assertParamExists('deleteFolder', 'folder', folder);
|
|
209
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}`
|
|
210
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
211
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
212
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
213
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
214
|
+
let baseOptions;
|
|
215
|
+
if (configuration) {
|
|
216
|
+
baseOptions = configuration.baseOptions;
|
|
217
|
+
}
|
|
218
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
219
|
+
const localVarHeaderParameter = {};
|
|
220
|
+
const localVarQueryParameter = {};
|
|
221
|
+
// authentication BearerAuth required
|
|
222
|
+
// http bearer authentication required
|
|
223
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
224
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
225
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
226
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
227
|
+
return {
|
|
228
|
+
url: toPathString(localVarUrlObj),
|
|
229
|
+
options: localVarRequestOptions,
|
|
230
|
+
};
|
|
231
|
+
}),
|
|
232
|
+
/**
|
|
233
|
+
* Retrieve a paginated list of folders in the managed mailbox.
|
|
234
|
+
* @summary List folders
|
|
235
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
236
|
+
* @param {number} [page] Page number (1-based).
|
|
237
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
238
|
+
* @param {*} [options] Override http request option.
|
|
239
|
+
* @throws {RequiredError}
|
|
240
|
+
*/
|
|
241
|
+
listFolders: (mailboxResourceId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, page_1, perPage_1, ...args_1], void 0, function* (mailboxResourceId, page, perPage, options = {}) {
|
|
242
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
243
|
+
assertParamExists('listFolders', 'mailboxResourceId', mailboxResourceId);
|
|
244
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders`
|
|
245
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
246
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
247
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
248
|
+
let baseOptions;
|
|
249
|
+
if (configuration) {
|
|
250
|
+
baseOptions = configuration.baseOptions;
|
|
251
|
+
}
|
|
252
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
253
|
+
const localVarHeaderParameter = {};
|
|
254
|
+
const localVarQueryParameter = {};
|
|
255
|
+
// authentication BearerAuth required
|
|
256
|
+
// http bearer authentication required
|
|
257
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
258
|
+
if (page !== undefined) {
|
|
259
|
+
localVarQueryParameter['page'] = page;
|
|
260
|
+
}
|
|
261
|
+
if (perPage !== undefined) {
|
|
262
|
+
localVarQueryParameter['perPage'] = perPage;
|
|
263
|
+
}
|
|
264
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
265
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
266
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
267
|
+
return {
|
|
268
|
+
url: toPathString(localVarUrlObj),
|
|
269
|
+
options: localVarRequestOptions,
|
|
270
|
+
};
|
|
271
|
+
}),
|
|
272
|
+
/**
|
|
273
|
+
* Rename an existing folder.
|
|
274
|
+
* @summary Update folder
|
|
275
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
276
|
+
* @param {string} folder Current folder path (URL-encoded).
|
|
277
|
+
* @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
|
|
278
|
+
* @param {*} [options] Override http request option.
|
|
279
|
+
* @throws {RequiredError}
|
|
280
|
+
*/
|
|
281
|
+
updateFolder: (mailboxResourceId_1, folder_1, v1FoldersUpdateRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, v1FoldersUpdateRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, v1FoldersUpdateRequest, options = {}) {
|
|
282
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
283
|
+
assertParamExists('updateFolder', 'mailboxResourceId', mailboxResourceId);
|
|
284
|
+
// verify required parameter 'folder' is not null or undefined
|
|
285
|
+
assertParamExists('updateFolder', 'folder', folder);
|
|
286
|
+
// verify required parameter 'v1FoldersUpdateRequest' is not null or undefined
|
|
287
|
+
assertParamExists('updateFolder', 'v1FoldersUpdateRequest', v1FoldersUpdateRequest);
|
|
288
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}`
|
|
289
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
290
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
291
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
292
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
293
|
+
let baseOptions;
|
|
294
|
+
if (configuration) {
|
|
295
|
+
baseOptions = configuration.baseOptions;
|
|
296
|
+
}
|
|
297
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
298
|
+
const localVarHeaderParameter = {};
|
|
299
|
+
const localVarQueryParameter = {};
|
|
300
|
+
// authentication BearerAuth required
|
|
301
|
+
// http bearer authentication required
|
|
302
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
303
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
304
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
305
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
306
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
307
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FoldersUpdateRequest, localVarRequestOptions, configuration);
|
|
308
|
+
return {
|
|
309
|
+
url: toPathString(localVarUrlObj),
|
|
310
|
+
options: localVarRequestOptions,
|
|
311
|
+
};
|
|
312
|
+
}),
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* FoldersApi - functional programming interface
|
|
317
|
+
* @export
|
|
318
|
+
*/
|
|
319
|
+
export const FoldersApiFp = function (configuration) {
|
|
320
|
+
const localVarAxiosParamCreator = FoldersApiAxiosParamCreator(configuration);
|
|
321
|
+
return {
|
|
322
|
+
/**
|
|
323
|
+
* Create a new folder in the managed mailbox.
|
|
324
|
+
* @summary Create folder
|
|
325
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
326
|
+
* @param {V1FoldersCreateRequest} v1FoldersCreateRequest
|
|
327
|
+
* @param {*} [options] Override http request option.
|
|
328
|
+
* @throws {RequiredError}
|
|
329
|
+
*/
|
|
330
|
+
createFolder(mailboxResourceId, v1FoldersCreateRequest, options) {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
var _a, _b;
|
|
333
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createFolder(mailboxResourceId, v1FoldersCreateRequest, options);
|
|
334
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['FoldersApi.createFolder']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
335
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
336
|
+
});
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* Delete a folder and all of its subfolders.
|
|
340
|
+
* @summary Delete folder
|
|
341
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
342
|
+
* @param {string} folder Folder path to delete (URL-encoded).
|
|
343
|
+
* @param {*} [options] Override http request option.
|
|
344
|
+
* @throws {RequiredError}
|
|
345
|
+
*/
|
|
346
|
+
deleteFolder(mailboxResourceId, folder, options) {
|
|
347
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
+
var _a, _b;
|
|
349
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteFolder(mailboxResourceId, folder, options);
|
|
350
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['FoldersApi.deleteFolder']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
351
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
/**
|
|
355
|
+
* Retrieve a paginated list of folders in the managed mailbox.
|
|
356
|
+
* @summary List folders
|
|
357
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
358
|
+
* @param {number} [page] Page number (1-based).
|
|
359
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
360
|
+
* @param {*} [options] Override http request option.
|
|
361
|
+
* @throws {RequiredError}
|
|
362
|
+
*/
|
|
363
|
+
listFolders(mailboxResourceId, page, perPage, options) {
|
|
364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
var _a, _b;
|
|
366
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listFolders(mailboxResourceId, page, perPage, options);
|
|
367
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['FoldersApi.listFolders']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
368
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
/**
|
|
372
|
+
* Rename an existing folder.
|
|
373
|
+
* @summary Update folder
|
|
374
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
375
|
+
* @param {string} folder Current folder path (URL-encoded).
|
|
376
|
+
* @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
|
|
377
|
+
* @param {*} [options] Override http request option.
|
|
378
|
+
* @throws {RequiredError}
|
|
379
|
+
*/
|
|
380
|
+
updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options) {
|
|
381
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
382
|
+
var _a, _b;
|
|
383
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options);
|
|
384
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['FoldersApi.updateFolder']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
385
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
386
|
+
});
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* FoldersApi - factory interface
|
|
392
|
+
* @export
|
|
393
|
+
*/
|
|
394
|
+
export const FoldersApiFactory = function (configuration, basePath, axios) {
|
|
395
|
+
const localVarFp = FoldersApiFp(configuration);
|
|
396
|
+
return {
|
|
397
|
+
/**
|
|
398
|
+
* Create a new folder in the managed mailbox.
|
|
399
|
+
* @summary Create folder
|
|
400
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
401
|
+
* @param {V1FoldersCreateRequest} v1FoldersCreateRequest
|
|
402
|
+
* @param {*} [options] Override http request option.
|
|
403
|
+
* @throws {RequiredError}
|
|
404
|
+
*/
|
|
405
|
+
createFolder(mailboxResourceId, v1FoldersCreateRequest, options) {
|
|
406
|
+
return localVarFp.createFolder(mailboxResourceId, v1FoldersCreateRequest, options).then((request) => request(axios, basePath));
|
|
407
|
+
},
|
|
408
|
+
/**
|
|
409
|
+
* Delete a folder and all of its subfolders.
|
|
410
|
+
* @summary Delete folder
|
|
411
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
412
|
+
* @param {string} folder Folder path to delete (URL-encoded).
|
|
413
|
+
* @param {*} [options] Override http request option.
|
|
414
|
+
* @throws {RequiredError}
|
|
415
|
+
*/
|
|
416
|
+
deleteFolder(mailboxResourceId, folder, options) {
|
|
417
|
+
return localVarFp.deleteFolder(mailboxResourceId, folder, options).then((request) => request(axios, basePath));
|
|
418
|
+
},
|
|
419
|
+
/**
|
|
420
|
+
* Retrieve a paginated list of folders in the managed mailbox.
|
|
421
|
+
* @summary List folders
|
|
422
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
423
|
+
* @param {number} [page] Page number (1-based).
|
|
424
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
425
|
+
* @param {*} [options] Override http request option.
|
|
426
|
+
* @throws {RequiredError}
|
|
427
|
+
*/
|
|
428
|
+
listFolders(mailboxResourceId, page, perPage, options) {
|
|
429
|
+
return localVarFp.listFolders(mailboxResourceId, page, perPage, options).then((request) => request(axios, basePath));
|
|
430
|
+
},
|
|
431
|
+
/**
|
|
432
|
+
* Rename an existing folder.
|
|
433
|
+
* @summary Update folder
|
|
434
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
435
|
+
* @param {string} folder Current folder path (URL-encoded).
|
|
436
|
+
* @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
|
|
437
|
+
* @param {*} [options] Override http request option.
|
|
438
|
+
* @throws {RequiredError}
|
|
439
|
+
*/
|
|
440
|
+
updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options) {
|
|
441
|
+
return localVarFp.updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options).then((request) => request(axios, basePath));
|
|
442
|
+
},
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* FoldersApi - object-oriented interface
|
|
447
|
+
* @export
|
|
448
|
+
* @class FoldersApi
|
|
449
|
+
* @extends {BaseAPI}
|
|
450
|
+
*/
|
|
451
|
+
export class FoldersApi extends BaseAPI {
|
|
452
|
+
/**
|
|
453
|
+
* Create a new folder in the managed mailbox.
|
|
454
|
+
* @summary Create folder
|
|
455
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
456
|
+
* @param {V1FoldersCreateRequest} v1FoldersCreateRequest
|
|
457
|
+
* @param {*} [options] Override http request option.
|
|
458
|
+
* @throws {RequiredError}
|
|
459
|
+
* @memberof FoldersApi
|
|
460
|
+
*/
|
|
461
|
+
createFolder(mailboxResourceId, v1FoldersCreateRequest, options) {
|
|
462
|
+
return FoldersApiFp(this.configuration).createFolder(mailboxResourceId, v1FoldersCreateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Delete a folder and all of its subfolders.
|
|
466
|
+
* @summary Delete folder
|
|
467
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
468
|
+
* @param {string} folder Folder path to delete (URL-encoded).
|
|
469
|
+
* @param {*} [options] Override http request option.
|
|
470
|
+
* @throws {RequiredError}
|
|
471
|
+
* @memberof FoldersApi
|
|
472
|
+
*/
|
|
473
|
+
deleteFolder(mailboxResourceId, folder, options) {
|
|
474
|
+
return FoldersApiFp(this.configuration).deleteFolder(mailboxResourceId, folder, options).then((request) => request(this.axios, this.basePath));
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Retrieve a paginated list of folders in the managed mailbox.
|
|
478
|
+
* @summary List folders
|
|
479
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
480
|
+
* @param {number} [page] Page number (1-based).
|
|
481
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
482
|
+
* @param {*} [options] Override http request option.
|
|
483
|
+
* @throws {RequiredError}
|
|
484
|
+
* @memberof FoldersApi
|
|
485
|
+
*/
|
|
486
|
+
listFolders(mailboxResourceId, page, perPage, options) {
|
|
487
|
+
return FoldersApiFp(this.configuration).listFolders(mailboxResourceId, page, perPage, options).then((request) => request(this.axios, this.basePath));
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Rename an existing folder.
|
|
491
|
+
* @summary Update folder
|
|
492
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
493
|
+
* @param {string} folder Current folder path (URL-encoded).
|
|
494
|
+
* @param {V1FoldersUpdateRequest} v1FoldersUpdateRequest
|
|
495
|
+
* @param {*} [options] Override http request option.
|
|
496
|
+
* @throws {RequiredError}
|
|
497
|
+
* @memberof FoldersApi
|
|
498
|
+
*/
|
|
499
|
+
updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options) {
|
|
500
|
+
return FoldersApiFp(this.configuration).updateFolder(mailboxResourceId, folder, v1FoldersUpdateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* MessagesApi - axios parameter creator
|
|
505
|
+
* @export
|
|
506
|
+
*/
|
|
507
|
+
export const MessagesApiAxiosParamCreator = function (configuration) {
|
|
508
|
+
return {
|
|
509
|
+
/**
|
|
510
|
+
* Permanently delete every message in a folder (empty the folder).
|
|
511
|
+
* @summary Delete all messages
|
|
512
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
513
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
514
|
+
* @param {*} [options] Override http request option.
|
|
515
|
+
* @throws {RequiredError}
|
|
516
|
+
*/
|
|
517
|
+
deleteAllMessages: (mailboxResourceId_1, folder_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, ...args_1], void 0, function* (mailboxResourceId, folder, options = {}) {
|
|
518
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
519
|
+
assertParamExists('deleteAllMessages', 'mailboxResourceId', mailboxResourceId);
|
|
520
|
+
// verify required parameter 'folder' is not null or undefined
|
|
521
|
+
assertParamExists('deleteAllMessages', 'folder', folder);
|
|
522
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages`
|
|
523
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
524
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
525
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
526
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
527
|
+
let baseOptions;
|
|
528
|
+
if (configuration) {
|
|
529
|
+
baseOptions = configuration.baseOptions;
|
|
530
|
+
}
|
|
531
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
532
|
+
const localVarHeaderParameter = {};
|
|
533
|
+
const localVarQueryParameter = {};
|
|
534
|
+
// authentication BearerAuth required
|
|
535
|
+
// http bearer authentication required
|
|
536
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
537
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
538
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
539
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
540
|
+
return {
|
|
541
|
+
url: toPathString(localVarUrlObj),
|
|
542
|
+
options: localVarRequestOptions,
|
|
543
|
+
};
|
|
544
|
+
}),
|
|
545
|
+
/**
|
|
546
|
+
* Permanently delete a single message.
|
|
547
|
+
* @summary Delete message
|
|
548
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
549
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
550
|
+
* @param {number} uid Message UID.
|
|
551
|
+
* @param {*} [options] Override http request option.
|
|
552
|
+
* @throws {RequiredError}
|
|
553
|
+
*/
|
|
554
|
+
deleteMessage: (mailboxResourceId_1, folder_1, uid_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, options = {}) {
|
|
555
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
556
|
+
assertParamExists('deleteMessage', 'mailboxResourceId', mailboxResourceId);
|
|
557
|
+
// verify required parameter 'folder' is not null or undefined
|
|
558
|
+
assertParamExists('deleteMessage', 'folder', folder);
|
|
559
|
+
// verify required parameter 'uid' is not null or undefined
|
|
560
|
+
assertParamExists('deleteMessage', 'uid', uid);
|
|
561
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
|
|
562
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
563
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
564
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
565
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
566
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
567
|
+
let baseOptions;
|
|
568
|
+
if (configuration) {
|
|
569
|
+
baseOptions = configuration.baseOptions;
|
|
570
|
+
}
|
|
571
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
572
|
+
const localVarHeaderParameter = {};
|
|
573
|
+
const localVarQueryParameter = {};
|
|
574
|
+
// authentication BearerAuth required
|
|
575
|
+
// http bearer authentication required
|
|
576
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
577
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
578
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
579
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
580
|
+
return {
|
|
581
|
+
url: toPathString(localVarUrlObj),
|
|
582
|
+
options: localVarRequestOptions,
|
|
583
|
+
};
|
|
584
|
+
}),
|
|
585
|
+
/**
|
|
586
|
+
* Permanently delete multiple messages from a folder.
|
|
587
|
+
* @summary Delete messages
|
|
588
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
589
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
590
|
+
* @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
|
|
591
|
+
* @param {*} [options] Override http request option.
|
|
592
|
+
* @throws {RequiredError}
|
|
593
|
+
*/
|
|
594
|
+
deleteMessages: (mailboxResourceId_1, folder_1, v1FolderMessagesDeleteBulkRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, v1FolderMessagesDeleteBulkRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options = {}) {
|
|
595
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
596
|
+
assertParamExists('deleteMessages', 'mailboxResourceId', mailboxResourceId);
|
|
597
|
+
// verify required parameter 'folder' is not null or undefined
|
|
598
|
+
assertParamExists('deleteMessages', 'folder', folder);
|
|
599
|
+
// verify required parameter 'v1FolderMessagesDeleteBulkRequest' is not null or undefined
|
|
600
|
+
assertParamExists('deleteMessages', 'v1FolderMessagesDeleteBulkRequest', v1FolderMessagesDeleteBulkRequest);
|
|
601
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete`
|
|
602
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
603
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
604
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
605
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
606
|
+
let baseOptions;
|
|
607
|
+
if (configuration) {
|
|
608
|
+
baseOptions = configuration.baseOptions;
|
|
609
|
+
}
|
|
610
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
611
|
+
const localVarHeaderParameter = {};
|
|
612
|
+
const localVarQueryParameter = {};
|
|
613
|
+
// authentication BearerAuth required
|
|
614
|
+
// http bearer authentication required
|
|
615
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
616
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
617
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
618
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
619
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
620
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesDeleteBulkRequest, localVarRequestOptions, configuration);
|
|
621
|
+
return {
|
|
622
|
+
url: toPathString(localVarUrlObj),
|
|
623
|
+
options: localVarRequestOptions,
|
|
624
|
+
};
|
|
625
|
+
}),
|
|
626
|
+
/**
|
|
627
|
+
* Retrieve a single message by UID.
|
|
628
|
+
* @summary Get message
|
|
629
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
630
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
631
|
+
* @param {number} uid Message UID.
|
|
632
|
+
* @param {*} [options] Override http request option.
|
|
633
|
+
* @throws {RequiredError}
|
|
634
|
+
*/
|
|
635
|
+
getMessage: (mailboxResourceId_1, folder_1, uid_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, options = {}) {
|
|
636
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
637
|
+
assertParamExists('getMessage', 'mailboxResourceId', mailboxResourceId);
|
|
638
|
+
// verify required parameter 'folder' is not null or undefined
|
|
639
|
+
assertParamExists('getMessage', 'folder', folder);
|
|
640
|
+
// verify required parameter 'uid' is not null or undefined
|
|
641
|
+
assertParamExists('getMessage', 'uid', uid);
|
|
642
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
|
|
643
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
644
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
645
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
646
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
647
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
648
|
+
let baseOptions;
|
|
649
|
+
if (configuration) {
|
|
650
|
+
baseOptions = configuration.baseOptions;
|
|
651
|
+
}
|
|
652
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
653
|
+
const localVarHeaderParameter = {};
|
|
654
|
+
const localVarQueryParameter = {};
|
|
655
|
+
// authentication BearerAuth required
|
|
656
|
+
// http bearer authentication required
|
|
657
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
658
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
659
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
660
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
661
|
+
return {
|
|
662
|
+
url: toPathString(localVarUrlObj),
|
|
663
|
+
options: localVarRequestOptions,
|
|
664
|
+
};
|
|
665
|
+
}),
|
|
666
|
+
/**
|
|
667
|
+
* Download a message attachment as `application/octet-stream`.
|
|
668
|
+
* @summary Download message attachment
|
|
669
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
670
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
671
|
+
* @param {number} uid Message UID.
|
|
672
|
+
* @param {string} attachmentId Attachment ID (opaque, returned by GET message).
|
|
673
|
+
* @param {*} [options] Override http request option.
|
|
674
|
+
* @throws {RequiredError}
|
|
675
|
+
*/
|
|
676
|
+
getMessageAttachment: (mailboxResourceId_1, folder_1, uid_1, attachmentId_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, attachmentId_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, attachmentId, options = {}) {
|
|
677
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
678
|
+
assertParamExists('getMessageAttachment', 'mailboxResourceId', mailboxResourceId);
|
|
679
|
+
// verify required parameter 'folder' is not null or undefined
|
|
680
|
+
assertParamExists('getMessageAttachment', 'folder', folder);
|
|
681
|
+
// verify required parameter 'uid' is not null or undefined
|
|
682
|
+
assertParamExists('getMessageAttachment', 'uid', uid);
|
|
683
|
+
// verify required parameter 'attachmentId' is not null or undefined
|
|
684
|
+
assertParamExists('getMessageAttachment', 'attachmentId', attachmentId);
|
|
685
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId}`
|
|
686
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
687
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
688
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)))
|
|
689
|
+
.replace(`{${"attachmentId"}}`, encodeURIComponent(String(attachmentId)));
|
|
690
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
691
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
692
|
+
let baseOptions;
|
|
693
|
+
if (configuration) {
|
|
694
|
+
baseOptions = configuration.baseOptions;
|
|
695
|
+
}
|
|
696
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
697
|
+
const localVarHeaderParameter = {};
|
|
698
|
+
const localVarQueryParameter = {};
|
|
699
|
+
// authentication BearerAuth required
|
|
700
|
+
// http bearer authentication required
|
|
701
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
702
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
703
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
704
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
705
|
+
return {
|
|
706
|
+
url: toPathString(localVarUrlObj),
|
|
707
|
+
options: localVarRequestOptions,
|
|
708
|
+
};
|
|
709
|
+
}),
|
|
710
|
+
/**
|
|
711
|
+
* Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
|
|
712
|
+
* @summary Get message source
|
|
713
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
714
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
715
|
+
* @param {number} uid Message UID.
|
|
716
|
+
* @param {*} [options] Override http request option.
|
|
717
|
+
* @throws {RequiredError}
|
|
718
|
+
*/
|
|
719
|
+
getMessageSource: (mailboxResourceId_1, folder_1, uid_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, options = {}) {
|
|
720
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
721
|
+
assertParamExists('getMessageSource', 'mailboxResourceId', mailboxResourceId);
|
|
722
|
+
// verify required parameter 'folder' is not null or undefined
|
|
723
|
+
assertParamExists('getMessageSource', 'folder', folder);
|
|
724
|
+
// verify required parameter 'uid' is not null or undefined
|
|
725
|
+
assertParamExists('getMessageSource', 'uid', uid);
|
|
726
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source`
|
|
727
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
728
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
729
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
730
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
731
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
732
|
+
let baseOptions;
|
|
733
|
+
if (configuration) {
|
|
734
|
+
baseOptions = configuration.baseOptions;
|
|
735
|
+
}
|
|
736
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
737
|
+
const localVarHeaderParameter = {};
|
|
738
|
+
const localVarQueryParameter = {};
|
|
739
|
+
// authentication BearerAuth required
|
|
740
|
+
// http bearer authentication required
|
|
741
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
742
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
743
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
744
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
745
|
+
return {
|
|
746
|
+
url: toPathString(localVarUrlObj),
|
|
747
|
+
options: localVarRequestOptions,
|
|
748
|
+
};
|
|
749
|
+
}),
|
|
750
|
+
/**
|
|
751
|
+
* Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
|
|
752
|
+
* @summary Get message text content
|
|
753
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
754
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
755
|
+
* @param {number} uid Message UID.
|
|
756
|
+
* @param {*} [options] Override http request option.
|
|
757
|
+
* @throws {RequiredError}
|
|
758
|
+
*/
|
|
759
|
+
getMessageText: (mailboxResourceId_1, folder_1, uid_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, options = {}) {
|
|
760
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
761
|
+
assertParamExists('getMessageText', 'mailboxResourceId', mailboxResourceId);
|
|
762
|
+
// verify required parameter 'folder' is not null or undefined
|
|
763
|
+
assertParamExists('getMessageText', 'folder', folder);
|
|
764
|
+
// verify required parameter 'uid' is not null or undefined
|
|
765
|
+
assertParamExists('getMessageText', 'uid', uid);
|
|
766
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text`
|
|
767
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
768
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
769
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
770
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
771
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
772
|
+
let baseOptions;
|
|
773
|
+
if (configuration) {
|
|
774
|
+
baseOptions = configuration.baseOptions;
|
|
775
|
+
}
|
|
776
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
777
|
+
const localVarHeaderParameter = {};
|
|
778
|
+
const localVarQueryParameter = {};
|
|
779
|
+
// authentication BearerAuth required
|
|
780
|
+
// http bearer authentication required
|
|
781
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
782
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
783
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
784
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
785
|
+
return {
|
|
786
|
+
url: toPathString(localVarUrlObj),
|
|
787
|
+
options: localVarRequestOptions,
|
|
788
|
+
};
|
|
789
|
+
}),
|
|
790
|
+
/**
|
|
791
|
+
* List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
|
|
792
|
+
* @summary List messages
|
|
793
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
794
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
795
|
+
* @param {number} [page] Page number (1-based).
|
|
796
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
797
|
+
* @param {string} [sort] Sort field with optional `-` prefix for descending. Allowed: uid, date, size.
|
|
798
|
+
* @param {*} [options] Override http request option.
|
|
799
|
+
* @throws {RequiredError}
|
|
800
|
+
*/
|
|
801
|
+
listMessages: (mailboxResourceId_1, folder_1, page_1, perPage_1, sort_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, page_1, perPage_1, sort_1, ...args_1], void 0, function* (mailboxResourceId, folder, page, perPage, sort, options = {}) {
|
|
802
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
803
|
+
assertParamExists('listMessages', 'mailboxResourceId', mailboxResourceId);
|
|
804
|
+
// verify required parameter 'folder' is not null or undefined
|
|
805
|
+
assertParamExists('listMessages', 'folder', folder);
|
|
806
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages`
|
|
807
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
808
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
809
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
810
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
811
|
+
let baseOptions;
|
|
812
|
+
if (configuration) {
|
|
813
|
+
baseOptions = configuration.baseOptions;
|
|
814
|
+
}
|
|
815
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
816
|
+
const localVarHeaderParameter = {};
|
|
817
|
+
const localVarQueryParameter = {};
|
|
818
|
+
// authentication BearerAuth required
|
|
819
|
+
// http bearer authentication required
|
|
820
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
821
|
+
if (page !== undefined) {
|
|
822
|
+
localVarQueryParameter['page'] = page;
|
|
823
|
+
}
|
|
824
|
+
if (perPage !== undefined) {
|
|
825
|
+
localVarQueryParameter['perPage'] = perPage;
|
|
826
|
+
}
|
|
827
|
+
if (sort !== undefined) {
|
|
828
|
+
localVarQueryParameter['sort'] = sort;
|
|
829
|
+
}
|
|
830
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
831
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
832
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
833
|
+
return {
|
|
834
|
+
url: toPathString(localVarUrlObj),
|
|
835
|
+
options: localVarRequestOptions,
|
|
836
|
+
};
|
|
837
|
+
}),
|
|
838
|
+
/**
|
|
839
|
+
* Move a single message to a target folder.
|
|
840
|
+
* @summary Move message
|
|
841
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
842
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
843
|
+
* @param {number} uid Message UID.
|
|
844
|
+
* @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
|
|
845
|
+
* @param {*} [options] Override http request option.
|
|
846
|
+
* @throws {RequiredError}
|
|
847
|
+
*/
|
|
848
|
+
moveMessage: (mailboxResourceId_1, folder_1, uid_1, v1FolderMessagesMoveRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, v1FolderMessagesMoveRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options = {}) {
|
|
849
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
850
|
+
assertParamExists('moveMessage', 'mailboxResourceId', mailboxResourceId);
|
|
851
|
+
// verify required parameter 'folder' is not null or undefined
|
|
852
|
+
assertParamExists('moveMessage', 'folder', folder);
|
|
853
|
+
// verify required parameter 'uid' is not null or undefined
|
|
854
|
+
assertParamExists('moveMessage', 'uid', uid);
|
|
855
|
+
// verify required parameter 'v1FolderMessagesMoveRequest' is not null or undefined
|
|
856
|
+
assertParamExists('moveMessage', 'v1FolderMessagesMoveRequest', v1FolderMessagesMoveRequest);
|
|
857
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move`
|
|
858
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
859
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
860
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
861
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
862
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
863
|
+
let baseOptions;
|
|
864
|
+
if (configuration) {
|
|
865
|
+
baseOptions = configuration.baseOptions;
|
|
866
|
+
}
|
|
867
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
868
|
+
const localVarHeaderParameter = {};
|
|
869
|
+
const localVarQueryParameter = {};
|
|
870
|
+
// authentication BearerAuth required
|
|
871
|
+
// http bearer authentication required
|
|
872
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
873
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
874
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
875
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
876
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
877
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesMoveRequest, localVarRequestOptions, configuration);
|
|
878
|
+
return {
|
|
879
|
+
url: toPathString(localVarUrlObj),
|
|
880
|
+
options: localVarRequestOptions,
|
|
881
|
+
};
|
|
882
|
+
}),
|
|
883
|
+
/**
|
|
884
|
+
* Move multiple messages from a source folder to a target folder.
|
|
885
|
+
* @summary Move messages
|
|
886
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
887
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
888
|
+
* @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
|
|
889
|
+
* @param {*} [options] Override http request option.
|
|
890
|
+
* @throws {RequiredError}
|
|
891
|
+
*/
|
|
892
|
+
moveMessages: (mailboxResourceId_1, folder_1, v1FolderMessagesMoveBulkRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, v1FolderMessagesMoveBulkRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options = {}) {
|
|
893
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
894
|
+
assertParamExists('moveMessages', 'mailboxResourceId', mailboxResourceId);
|
|
895
|
+
// verify required parameter 'folder' is not null or undefined
|
|
896
|
+
assertParamExists('moveMessages', 'folder', folder);
|
|
897
|
+
// verify required parameter 'v1FolderMessagesMoveBulkRequest' is not null or undefined
|
|
898
|
+
assertParamExists('moveMessages', 'v1FolderMessagesMoveBulkRequest', v1FolderMessagesMoveBulkRequest);
|
|
899
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move`
|
|
900
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
901
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
902
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
903
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
904
|
+
let baseOptions;
|
|
905
|
+
if (configuration) {
|
|
906
|
+
baseOptions = configuration.baseOptions;
|
|
907
|
+
}
|
|
908
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
909
|
+
const localVarHeaderParameter = {};
|
|
910
|
+
const localVarQueryParameter = {};
|
|
911
|
+
// authentication BearerAuth required
|
|
912
|
+
// http bearer authentication required
|
|
913
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
914
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
915
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
916
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
917
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
918
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesMoveBulkRequest, localVarRequestOptions, configuration);
|
|
919
|
+
return {
|
|
920
|
+
url: toPathString(localVarUrlObj),
|
|
921
|
+
options: localVarRequestOptions,
|
|
922
|
+
};
|
|
923
|
+
}),
|
|
924
|
+
/**
|
|
925
|
+
* Add and/or remove flags on a single message. Returns the updated message.
|
|
926
|
+
* @summary Update message flags
|
|
927
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
928
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
929
|
+
* @param {number} uid Message UID.
|
|
930
|
+
* @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
|
|
931
|
+
* @param {*} [options] Override http request option.
|
|
932
|
+
* @throws {RequiredError}
|
|
933
|
+
*/
|
|
934
|
+
patchMessage: (mailboxResourceId_1, folder_1, uid_1, v1FolderMessagesFlagsRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, uid_1, v1FolderMessagesFlagsRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options = {}) {
|
|
935
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
936
|
+
assertParamExists('patchMessage', 'mailboxResourceId', mailboxResourceId);
|
|
937
|
+
// verify required parameter 'folder' is not null or undefined
|
|
938
|
+
assertParamExists('patchMessage', 'folder', folder);
|
|
939
|
+
// verify required parameter 'uid' is not null or undefined
|
|
940
|
+
assertParamExists('patchMessage', 'uid', uid);
|
|
941
|
+
// verify required parameter 'v1FolderMessagesFlagsRequest' is not null or undefined
|
|
942
|
+
assertParamExists('patchMessage', 'v1FolderMessagesFlagsRequest', v1FolderMessagesFlagsRequest);
|
|
943
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}`
|
|
944
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
945
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)))
|
|
946
|
+
.replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
|
|
947
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
948
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
949
|
+
let baseOptions;
|
|
950
|
+
if (configuration) {
|
|
951
|
+
baseOptions = configuration.baseOptions;
|
|
952
|
+
}
|
|
953
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
954
|
+
const localVarHeaderParameter = {};
|
|
955
|
+
const localVarQueryParameter = {};
|
|
956
|
+
// authentication BearerAuth required
|
|
957
|
+
// http bearer authentication required
|
|
958
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
959
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
960
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
961
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
962
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
963
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesFlagsRequest, localVarRequestOptions, configuration);
|
|
964
|
+
return {
|
|
965
|
+
url: toPathString(localVarUrlObj),
|
|
966
|
+
options: localVarRequestOptions,
|
|
967
|
+
};
|
|
968
|
+
}),
|
|
969
|
+
/**
|
|
970
|
+
* Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
|
|
971
|
+
* @summary Search messages
|
|
972
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
973
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
974
|
+
* @param {number} [page]
|
|
975
|
+
* @param {number} [perPage]
|
|
976
|
+
* @param {string} [sort]
|
|
977
|
+
* @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
|
|
978
|
+
* @param {*} [options] Override http request option.
|
|
979
|
+
* @throws {RequiredError}
|
|
980
|
+
*/
|
|
981
|
+
searchMessages: (mailboxResourceId_1, folder_1, page_1, perPage_1, sort_1, v1FolderMessagesSearchRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, page_1, perPage_1, sort_1, v1FolderMessagesSearchRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options = {}) {
|
|
982
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
983
|
+
assertParamExists('searchMessages', 'mailboxResourceId', mailboxResourceId);
|
|
984
|
+
// verify required parameter 'folder' is not null or undefined
|
|
985
|
+
assertParamExists('searchMessages', 'folder', folder);
|
|
986
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search`
|
|
987
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
988
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
989
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
990
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
991
|
+
let baseOptions;
|
|
992
|
+
if (configuration) {
|
|
993
|
+
baseOptions = configuration.baseOptions;
|
|
994
|
+
}
|
|
995
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
996
|
+
const localVarHeaderParameter = {};
|
|
997
|
+
const localVarQueryParameter = {};
|
|
998
|
+
// authentication BearerAuth required
|
|
999
|
+
// http bearer authentication required
|
|
1000
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1001
|
+
if (page !== undefined) {
|
|
1002
|
+
localVarQueryParameter['page'] = page;
|
|
1003
|
+
}
|
|
1004
|
+
if (perPage !== undefined) {
|
|
1005
|
+
localVarQueryParameter['perPage'] = perPage;
|
|
1006
|
+
}
|
|
1007
|
+
if (sort !== undefined) {
|
|
1008
|
+
localVarQueryParameter['sort'] = sort;
|
|
1009
|
+
}
|
|
1010
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1011
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1012
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1013
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1014
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesSearchRequest, localVarRequestOptions, configuration);
|
|
1015
|
+
return {
|
|
1016
|
+
url: toPathString(localVarUrlObj),
|
|
1017
|
+
options: localVarRequestOptions,
|
|
1018
|
+
};
|
|
1019
|
+
}),
|
|
1020
|
+
/**
|
|
1021
|
+
* Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
|
|
1022
|
+
* @summary Update message flags
|
|
1023
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1024
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1025
|
+
* @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
|
|
1026
|
+
* @param {*} [options] Override http request option.
|
|
1027
|
+
* @throws {RequiredError}
|
|
1028
|
+
*/
|
|
1029
|
+
updateMessageFlags: (mailboxResourceId_1, folder_1, v1FolderMessagesFlagsBulkRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, folder_1, v1FolderMessagesFlagsBulkRequest_1, ...args_1], void 0, function* (mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options = {}) {
|
|
1030
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1031
|
+
assertParamExists('updateMessageFlags', 'mailboxResourceId', mailboxResourceId);
|
|
1032
|
+
// verify required parameter 'folder' is not null or undefined
|
|
1033
|
+
assertParamExists('updateMessageFlags', 'folder', folder);
|
|
1034
|
+
// verify required parameter 'v1FolderMessagesFlagsBulkRequest' is not null or undefined
|
|
1035
|
+
assertParamExists('updateMessageFlags', 'v1FolderMessagesFlagsBulkRequest', v1FolderMessagesFlagsBulkRequest);
|
|
1036
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags`
|
|
1037
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
1038
|
+
.replace(`{${"folder"}}`, encodeURIComponent(String(folder)));
|
|
1039
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1040
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1041
|
+
let baseOptions;
|
|
1042
|
+
if (configuration) {
|
|
1043
|
+
baseOptions = configuration.baseOptions;
|
|
1044
|
+
}
|
|
1045
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
1046
|
+
const localVarHeaderParameter = {};
|
|
1047
|
+
const localVarQueryParameter = {};
|
|
1048
|
+
// authentication BearerAuth required
|
|
1049
|
+
// http bearer authentication required
|
|
1050
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1051
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1052
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1053
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1054
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1055
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1FolderMessagesFlagsBulkRequest, localVarRequestOptions, configuration);
|
|
1056
|
+
return {
|
|
1057
|
+
url: toPathString(localVarUrlObj),
|
|
1058
|
+
options: localVarRequestOptions,
|
|
1059
|
+
};
|
|
1060
|
+
}),
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
/**
|
|
1064
|
+
* MessagesApi - functional programming interface
|
|
1065
|
+
* @export
|
|
1066
|
+
*/
|
|
1067
|
+
export const MessagesApiFp = function (configuration) {
|
|
1068
|
+
const localVarAxiosParamCreator = MessagesApiAxiosParamCreator(configuration);
|
|
1069
|
+
return {
|
|
1070
|
+
/**
|
|
1071
|
+
* Permanently delete every message in a folder (empty the folder).
|
|
1072
|
+
* @summary Delete all messages
|
|
1073
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1074
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1075
|
+
* @param {*} [options] Override http request option.
|
|
1076
|
+
* @throws {RequiredError}
|
|
1077
|
+
*/
|
|
1078
|
+
deleteAllMessages(mailboxResourceId, folder, options) {
|
|
1079
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1080
|
+
var _a, _b;
|
|
1081
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAllMessages(mailboxResourceId, folder, options);
|
|
1082
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.deleteAllMessages']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1083
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1084
|
+
});
|
|
1085
|
+
},
|
|
1086
|
+
/**
|
|
1087
|
+
* Permanently delete a single message.
|
|
1088
|
+
* @summary Delete message
|
|
1089
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1090
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1091
|
+
* @param {number} uid Message UID.
|
|
1092
|
+
* @param {*} [options] Override http request option.
|
|
1093
|
+
* @throws {RequiredError}
|
|
1094
|
+
*/
|
|
1095
|
+
deleteMessage(mailboxResourceId, folder, uid, options) {
|
|
1096
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1097
|
+
var _a, _b;
|
|
1098
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteMessage(mailboxResourceId, folder, uid, options);
|
|
1099
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.deleteMessage']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1100
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1101
|
+
});
|
|
1102
|
+
},
|
|
1103
|
+
/**
|
|
1104
|
+
* Permanently delete multiple messages from a folder.
|
|
1105
|
+
* @summary Delete messages
|
|
1106
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1107
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1108
|
+
* @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
|
|
1109
|
+
* @param {*} [options] Override http request option.
|
|
1110
|
+
* @throws {RequiredError}
|
|
1111
|
+
*/
|
|
1112
|
+
deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options) {
|
|
1113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1114
|
+
var _a, _b;
|
|
1115
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options);
|
|
1116
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.deleteMessages']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1117
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1118
|
+
});
|
|
1119
|
+
},
|
|
1120
|
+
/**
|
|
1121
|
+
* Retrieve a single message by UID.
|
|
1122
|
+
* @summary Get message
|
|
1123
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1124
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1125
|
+
* @param {number} uid Message UID.
|
|
1126
|
+
* @param {*} [options] Override http request option.
|
|
1127
|
+
* @throws {RequiredError}
|
|
1128
|
+
*/
|
|
1129
|
+
getMessage(mailboxResourceId, folder, uid, options) {
|
|
1130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1131
|
+
var _a, _b;
|
|
1132
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getMessage(mailboxResourceId, folder, uid, options);
|
|
1133
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.getMessage']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1134
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1135
|
+
});
|
|
1136
|
+
},
|
|
1137
|
+
/**
|
|
1138
|
+
* Download a message attachment as `application/octet-stream`.
|
|
1139
|
+
* @summary Download message attachment
|
|
1140
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1141
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1142
|
+
* @param {number} uid Message UID.
|
|
1143
|
+
* @param {string} attachmentId Attachment ID (opaque, returned by GET message).
|
|
1144
|
+
* @param {*} [options] Override http request option.
|
|
1145
|
+
* @throws {RequiredError}
|
|
1146
|
+
*/
|
|
1147
|
+
getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options) {
|
|
1148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1149
|
+
var _a, _b;
|
|
1150
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options);
|
|
1151
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.getMessageAttachment']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1152
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1153
|
+
});
|
|
1154
|
+
},
|
|
1155
|
+
/**
|
|
1156
|
+
* Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
|
|
1157
|
+
* @summary Get message source
|
|
1158
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1159
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1160
|
+
* @param {number} uid Message UID.
|
|
1161
|
+
* @param {*} [options] Override http request option.
|
|
1162
|
+
* @throws {RequiredError}
|
|
1163
|
+
*/
|
|
1164
|
+
getMessageSource(mailboxResourceId, folder, uid, options) {
|
|
1165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1166
|
+
var _a, _b;
|
|
1167
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getMessageSource(mailboxResourceId, folder, uid, options);
|
|
1168
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.getMessageSource']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1169
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1170
|
+
});
|
|
1171
|
+
},
|
|
1172
|
+
/**
|
|
1173
|
+
* Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
|
|
1174
|
+
* @summary Get message text content
|
|
1175
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1176
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1177
|
+
* @param {number} uid Message UID.
|
|
1178
|
+
* @param {*} [options] Override http request option.
|
|
1179
|
+
* @throws {RequiredError}
|
|
1180
|
+
*/
|
|
1181
|
+
getMessageText(mailboxResourceId, folder, uid, options) {
|
|
1182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1183
|
+
var _a, _b;
|
|
1184
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getMessageText(mailboxResourceId, folder, uid, options);
|
|
1185
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.getMessageText']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1186
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1187
|
+
});
|
|
1188
|
+
},
|
|
1189
|
+
/**
|
|
1190
|
+
* List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
|
|
1191
|
+
* @summary List messages
|
|
1192
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1193
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1194
|
+
* @param {number} [page] Page number (1-based).
|
|
1195
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
1196
|
+
* @param {string} [sort] Sort field with optional `-` prefix for descending. Allowed: uid, date, size.
|
|
1197
|
+
* @param {*} [options] Override http request option.
|
|
1198
|
+
* @throws {RequiredError}
|
|
1199
|
+
*/
|
|
1200
|
+
listMessages(mailboxResourceId, folder, page, perPage, sort, options) {
|
|
1201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1202
|
+
var _a, _b;
|
|
1203
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listMessages(mailboxResourceId, folder, page, perPage, sort, options);
|
|
1204
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.listMessages']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1205
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1206
|
+
});
|
|
1207
|
+
},
|
|
1208
|
+
/**
|
|
1209
|
+
* Move a single message to a target folder.
|
|
1210
|
+
* @summary Move message
|
|
1211
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1212
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1213
|
+
* @param {number} uid Message UID.
|
|
1214
|
+
* @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
|
|
1215
|
+
* @param {*} [options] Override http request option.
|
|
1216
|
+
* @throws {RequiredError}
|
|
1217
|
+
*/
|
|
1218
|
+
moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options) {
|
|
1219
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1220
|
+
var _a, _b;
|
|
1221
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options);
|
|
1222
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.moveMessage']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1223
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1224
|
+
});
|
|
1225
|
+
},
|
|
1226
|
+
/**
|
|
1227
|
+
* Move multiple messages from a source folder to a target folder.
|
|
1228
|
+
* @summary Move messages
|
|
1229
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1230
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1231
|
+
* @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
|
|
1232
|
+
* @param {*} [options] Override http request option.
|
|
1233
|
+
* @throws {RequiredError}
|
|
1234
|
+
*/
|
|
1235
|
+
moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options) {
|
|
1236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1237
|
+
var _a, _b;
|
|
1238
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options);
|
|
1239
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.moveMessages']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1240
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1241
|
+
});
|
|
1242
|
+
},
|
|
1243
|
+
/**
|
|
1244
|
+
* Add and/or remove flags on a single message. Returns the updated message.
|
|
1245
|
+
* @summary Update message flags
|
|
1246
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1247
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1248
|
+
* @param {number} uid Message UID.
|
|
1249
|
+
* @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
|
|
1250
|
+
* @param {*} [options] Override http request option.
|
|
1251
|
+
* @throws {RequiredError}
|
|
1252
|
+
*/
|
|
1253
|
+
patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options) {
|
|
1254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1255
|
+
var _a, _b;
|
|
1256
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options);
|
|
1257
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.patchMessage']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1258
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1259
|
+
});
|
|
1260
|
+
},
|
|
1261
|
+
/**
|
|
1262
|
+
* Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
|
|
1263
|
+
* @summary Search messages
|
|
1264
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1265
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1266
|
+
* @param {number} [page]
|
|
1267
|
+
* @param {number} [perPage]
|
|
1268
|
+
* @param {string} [sort]
|
|
1269
|
+
* @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
|
|
1270
|
+
* @param {*} [options] Override http request option.
|
|
1271
|
+
* @throws {RequiredError}
|
|
1272
|
+
*/
|
|
1273
|
+
searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options) {
|
|
1274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1275
|
+
var _a, _b;
|
|
1276
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options);
|
|
1277
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.searchMessages']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1278
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1279
|
+
});
|
|
1280
|
+
},
|
|
1281
|
+
/**
|
|
1282
|
+
* Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
|
|
1283
|
+
* @summary Update message flags
|
|
1284
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1285
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1286
|
+
* @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
|
|
1287
|
+
* @param {*} [options] Override http request option.
|
|
1288
|
+
* @throws {RequiredError}
|
|
1289
|
+
*/
|
|
1290
|
+
updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options) {
|
|
1291
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1292
|
+
var _a, _b;
|
|
1293
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options);
|
|
1294
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['MessagesApi.updateMessageFlags']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1295
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
/**
|
|
1301
|
+
* MessagesApi - factory interface
|
|
1302
|
+
* @export
|
|
1303
|
+
*/
|
|
1304
|
+
export const MessagesApiFactory = function (configuration, basePath, axios) {
|
|
1305
|
+
const localVarFp = MessagesApiFp(configuration);
|
|
1306
|
+
return {
|
|
1307
|
+
/**
|
|
1308
|
+
* Permanently delete every message in a folder (empty the folder).
|
|
1309
|
+
* @summary Delete all messages
|
|
1310
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1311
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1312
|
+
* @param {*} [options] Override http request option.
|
|
1313
|
+
* @throws {RequiredError}
|
|
1314
|
+
*/
|
|
1315
|
+
deleteAllMessages(mailboxResourceId, folder, options) {
|
|
1316
|
+
return localVarFp.deleteAllMessages(mailboxResourceId, folder, options).then((request) => request(axios, basePath));
|
|
1317
|
+
},
|
|
1318
|
+
/**
|
|
1319
|
+
* Permanently delete a single message.
|
|
1320
|
+
* @summary Delete message
|
|
1321
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1322
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1323
|
+
* @param {number} uid Message UID.
|
|
1324
|
+
* @param {*} [options] Override http request option.
|
|
1325
|
+
* @throws {RequiredError}
|
|
1326
|
+
*/
|
|
1327
|
+
deleteMessage(mailboxResourceId, folder, uid, options) {
|
|
1328
|
+
return localVarFp.deleteMessage(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
|
|
1329
|
+
},
|
|
1330
|
+
/**
|
|
1331
|
+
* Permanently delete multiple messages from a folder.
|
|
1332
|
+
* @summary Delete messages
|
|
1333
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1334
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1335
|
+
* @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
|
|
1336
|
+
* @param {*} [options] Override http request option.
|
|
1337
|
+
* @throws {RequiredError}
|
|
1338
|
+
*/
|
|
1339
|
+
deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options) {
|
|
1340
|
+
return localVarFp.deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options).then((request) => request(axios, basePath));
|
|
1341
|
+
},
|
|
1342
|
+
/**
|
|
1343
|
+
* Retrieve a single message by UID.
|
|
1344
|
+
* @summary Get message
|
|
1345
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1346
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1347
|
+
* @param {number} uid Message UID.
|
|
1348
|
+
* @param {*} [options] Override http request option.
|
|
1349
|
+
* @throws {RequiredError}
|
|
1350
|
+
*/
|
|
1351
|
+
getMessage(mailboxResourceId, folder, uid, options) {
|
|
1352
|
+
return localVarFp.getMessage(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
|
|
1353
|
+
},
|
|
1354
|
+
/**
|
|
1355
|
+
* Download a message attachment as `application/octet-stream`.
|
|
1356
|
+
* @summary Download message attachment
|
|
1357
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1358
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1359
|
+
* @param {number} uid Message UID.
|
|
1360
|
+
* @param {string} attachmentId Attachment ID (opaque, returned by GET message).
|
|
1361
|
+
* @param {*} [options] Override http request option.
|
|
1362
|
+
* @throws {RequiredError}
|
|
1363
|
+
*/
|
|
1364
|
+
getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options) {
|
|
1365
|
+
return localVarFp.getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options).then((request) => request(axios, basePath));
|
|
1366
|
+
},
|
|
1367
|
+
/**
|
|
1368
|
+
* Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
|
|
1369
|
+
* @summary Get message source
|
|
1370
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1371
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1372
|
+
* @param {number} uid Message UID.
|
|
1373
|
+
* @param {*} [options] Override http request option.
|
|
1374
|
+
* @throws {RequiredError}
|
|
1375
|
+
*/
|
|
1376
|
+
getMessageSource(mailboxResourceId, folder, uid, options) {
|
|
1377
|
+
return localVarFp.getMessageSource(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
|
|
1378
|
+
},
|
|
1379
|
+
/**
|
|
1380
|
+
* Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
|
|
1381
|
+
* @summary Get message text content
|
|
1382
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1383
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1384
|
+
* @param {number} uid Message UID.
|
|
1385
|
+
* @param {*} [options] Override http request option.
|
|
1386
|
+
* @throws {RequiredError}
|
|
1387
|
+
*/
|
|
1388
|
+
getMessageText(mailboxResourceId, folder, uid, options) {
|
|
1389
|
+
return localVarFp.getMessageText(mailboxResourceId, folder, uid, options).then((request) => request(axios, basePath));
|
|
1390
|
+
},
|
|
1391
|
+
/**
|
|
1392
|
+
* List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
|
|
1393
|
+
* @summary List messages
|
|
1394
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1395
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1396
|
+
* @param {number} [page] Page number (1-based).
|
|
1397
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
1398
|
+
* @param {string} [sort] Sort field with optional `-` prefix for descending. Allowed: uid, date, size.
|
|
1399
|
+
* @param {*} [options] Override http request option.
|
|
1400
|
+
* @throws {RequiredError}
|
|
1401
|
+
*/
|
|
1402
|
+
listMessages(mailboxResourceId, folder, page, perPage, sort, options) {
|
|
1403
|
+
return localVarFp.listMessages(mailboxResourceId, folder, page, perPage, sort, options).then((request) => request(axios, basePath));
|
|
1404
|
+
},
|
|
1405
|
+
/**
|
|
1406
|
+
* Move a single message to a target folder.
|
|
1407
|
+
* @summary Move message
|
|
1408
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1409
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1410
|
+
* @param {number} uid Message UID.
|
|
1411
|
+
* @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
|
|
1412
|
+
* @param {*} [options] Override http request option.
|
|
1413
|
+
* @throws {RequiredError}
|
|
1414
|
+
*/
|
|
1415
|
+
moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options) {
|
|
1416
|
+
return localVarFp.moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options).then((request) => request(axios, basePath));
|
|
1417
|
+
},
|
|
1418
|
+
/**
|
|
1419
|
+
* Move multiple messages from a source folder to a target folder.
|
|
1420
|
+
* @summary Move messages
|
|
1421
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1422
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1423
|
+
* @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
|
|
1424
|
+
* @param {*} [options] Override http request option.
|
|
1425
|
+
* @throws {RequiredError}
|
|
1426
|
+
*/
|
|
1427
|
+
moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options) {
|
|
1428
|
+
return localVarFp.moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options).then((request) => request(axios, basePath));
|
|
1429
|
+
},
|
|
1430
|
+
/**
|
|
1431
|
+
* Add and/or remove flags on a single message. Returns the updated message.
|
|
1432
|
+
* @summary Update message flags
|
|
1433
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1434
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1435
|
+
* @param {number} uid Message UID.
|
|
1436
|
+
* @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
|
|
1437
|
+
* @param {*} [options] Override http request option.
|
|
1438
|
+
* @throws {RequiredError}
|
|
1439
|
+
*/
|
|
1440
|
+
patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options) {
|
|
1441
|
+
return localVarFp.patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options).then((request) => request(axios, basePath));
|
|
1442
|
+
},
|
|
1443
|
+
/**
|
|
1444
|
+
* Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
|
|
1445
|
+
* @summary Search messages
|
|
1446
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1447
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1448
|
+
* @param {number} [page]
|
|
1449
|
+
* @param {number} [perPage]
|
|
1450
|
+
* @param {string} [sort]
|
|
1451
|
+
* @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
|
|
1452
|
+
* @param {*} [options] Override http request option.
|
|
1453
|
+
* @throws {RequiredError}
|
|
1454
|
+
*/
|
|
1455
|
+
searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options) {
|
|
1456
|
+
return localVarFp.searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options).then((request) => request(axios, basePath));
|
|
1457
|
+
},
|
|
1458
|
+
/**
|
|
1459
|
+
* Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
|
|
1460
|
+
* @summary Update message flags
|
|
1461
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1462
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1463
|
+
* @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
|
|
1464
|
+
* @param {*} [options] Override http request option.
|
|
1465
|
+
* @throws {RequiredError}
|
|
1466
|
+
*/
|
|
1467
|
+
updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options) {
|
|
1468
|
+
return localVarFp.updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options).then((request) => request(axios, basePath));
|
|
1469
|
+
},
|
|
1470
|
+
};
|
|
1471
|
+
};
|
|
1472
|
+
/**
|
|
1473
|
+
* MessagesApi - object-oriented interface
|
|
1474
|
+
* @export
|
|
1475
|
+
* @class MessagesApi
|
|
1476
|
+
* @extends {BaseAPI}
|
|
1477
|
+
*/
|
|
1478
|
+
export class MessagesApi extends BaseAPI {
|
|
1479
|
+
/**
|
|
1480
|
+
* Permanently delete every message in a folder (empty the folder).
|
|
1481
|
+
* @summary Delete all messages
|
|
1482
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1483
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1484
|
+
* @param {*} [options] Override http request option.
|
|
1485
|
+
* @throws {RequiredError}
|
|
1486
|
+
* @memberof MessagesApi
|
|
1487
|
+
*/
|
|
1488
|
+
deleteAllMessages(mailboxResourceId, folder, options) {
|
|
1489
|
+
return MessagesApiFp(this.configuration).deleteAllMessages(mailboxResourceId, folder, options).then((request) => request(this.axios, this.basePath));
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Permanently delete a single message.
|
|
1493
|
+
* @summary Delete message
|
|
1494
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1495
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1496
|
+
* @param {number} uid Message UID.
|
|
1497
|
+
* @param {*} [options] Override http request option.
|
|
1498
|
+
* @throws {RequiredError}
|
|
1499
|
+
* @memberof MessagesApi
|
|
1500
|
+
*/
|
|
1501
|
+
deleteMessage(mailboxResourceId, folder, uid, options) {
|
|
1502
|
+
return MessagesApiFp(this.configuration).deleteMessage(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Permanently delete multiple messages from a folder.
|
|
1506
|
+
* @summary Delete messages
|
|
1507
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1508
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1509
|
+
* @param {V1FolderMessagesDeleteBulkRequest} v1FolderMessagesDeleteBulkRequest
|
|
1510
|
+
* @param {*} [options] Override http request option.
|
|
1511
|
+
* @throws {RequiredError}
|
|
1512
|
+
* @memberof MessagesApi
|
|
1513
|
+
*/
|
|
1514
|
+
deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options) {
|
|
1515
|
+
return MessagesApiFp(this.configuration).deleteMessages(mailboxResourceId, folder, v1FolderMessagesDeleteBulkRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Retrieve a single message by UID.
|
|
1519
|
+
* @summary Get message
|
|
1520
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1521
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1522
|
+
* @param {number} uid Message UID.
|
|
1523
|
+
* @param {*} [options] Override http request option.
|
|
1524
|
+
* @throws {RequiredError}
|
|
1525
|
+
* @memberof MessagesApi
|
|
1526
|
+
*/
|
|
1527
|
+
getMessage(mailboxResourceId, folder, uid, options) {
|
|
1528
|
+
return MessagesApiFp(this.configuration).getMessage(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Download a message attachment as `application/octet-stream`.
|
|
1532
|
+
* @summary Download message attachment
|
|
1533
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1534
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1535
|
+
* @param {number} uid Message UID.
|
|
1536
|
+
* @param {string} attachmentId Attachment ID (opaque, returned by GET message).
|
|
1537
|
+
* @param {*} [options] Override http request option.
|
|
1538
|
+
* @throws {RequiredError}
|
|
1539
|
+
* @memberof MessagesApi
|
|
1540
|
+
*/
|
|
1541
|
+
getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options) {
|
|
1542
|
+
return MessagesApiFp(this.configuration).getMessageAttachment(mailboxResourceId, folder, uid, attachmentId, options).then((request) => request(this.axios, this.basePath));
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
|
|
1546
|
+
* @summary Get message source
|
|
1547
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1548
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1549
|
+
* @param {number} uid Message UID.
|
|
1550
|
+
* @param {*} [options] Override http request option.
|
|
1551
|
+
* @throws {RequiredError}
|
|
1552
|
+
* @memberof MessagesApi
|
|
1553
|
+
*/
|
|
1554
|
+
getMessageSource(mailboxResourceId, folder, uid, options) {
|
|
1555
|
+
return MessagesApiFp(this.configuration).getMessageSource(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
|
|
1559
|
+
* @summary Get message text content
|
|
1560
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1561
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1562
|
+
* @param {number} uid Message UID.
|
|
1563
|
+
* @param {*} [options] Override http request option.
|
|
1564
|
+
* @throws {RequiredError}
|
|
1565
|
+
* @memberof MessagesApi
|
|
1566
|
+
*/
|
|
1567
|
+
getMessageText(mailboxResourceId, folder, uid, options) {
|
|
1568
|
+
return MessagesApiFp(this.configuration).getMessageText(mailboxResourceId, folder, uid, options).then((request) => request(this.axios, this.basePath));
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
|
|
1572
|
+
* @summary List messages
|
|
1573
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1574
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1575
|
+
* @param {number} [page] Page number (1-based).
|
|
1576
|
+
* @param {number} [perPage] Items per page (max 100).
|
|
1577
|
+
* @param {string} [sort] Sort field with optional `-` prefix for descending. Allowed: uid, date, size.
|
|
1578
|
+
* @param {*} [options] Override http request option.
|
|
1579
|
+
* @throws {RequiredError}
|
|
1580
|
+
* @memberof MessagesApi
|
|
1581
|
+
*/
|
|
1582
|
+
listMessages(mailboxResourceId, folder, page, perPage, sort, options) {
|
|
1583
|
+
return MessagesApiFp(this.configuration).listMessages(mailboxResourceId, folder, page, perPage, sort, options).then((request) => request(this.axios, this.basePath));
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Move a single message to a target folder.
|
|
1587
|
+
* @summary Move message
|
|
1588
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1589
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1590
|
+
* @param {number} uid Message UID.
|
|
1591
|
+
* @param {V1FolderMessagesMoveRequest} v1FolderMessagesMoveRequest
|
|
1592
|
+
* @param {*} [options] Override http request option.
|
|
1593
|
+
* @throws {RequiredError}
|
|
1594
|
+
* @memberof MessagesApi
|
|
1595
|
+
*/
|
|
1596
|
+
moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options) {
|
|
1597
|
+
return MessagesApiFp(this.configuration).moveMessage(mailboxResourceId, folder, uid, v1FolderMessagesMoveRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Move multiple messages from a source folder to a target folder.
|
|
1601
|
+
* @summary Move messages
|
|
1602
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1603
|
+
* @param {string} folder Source folder path (URL-encoded).
|
|
1604
|
+
* @param {V1FolderMessagesMoveBulkRequest} v1FolderMessagesMoveBulkRequest
|
|
1605
|
+
* @param {*} [options] Override http request option.
|
|
1606
|
+
* @throws {RequiredError}
|
|
1607
|
+
* @memberof MessagesApi
|
|
1608
|
+
*/
|
|
1609
|
+
moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options) {
|
|
1610
|
+
return MessagesApiFp(this.configuration).moveMessages(mailboxResourceId, folder, v1FolderMessagesMoveBulkRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Add and/or remove flags on a single message. Returns the updated message.
|
|
1614
|
+
* @summary Update message flags
|
|
1615
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1616
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1617
|
+
* @param {number} uid Message UID.
|
|
1618
|
+
* @param {V1FolderMessagesFlagsRequest} v1FolderMessagesFlagsRequest
|
|
1619
|
+
* @param {*} [options] Override http request option.
|
|
1620
|
+
* @throws {RequiredError}
|
|
1621
|
+
* @memberof MessagesApi
|
|
1622
|
+
*/
|
|
1623
|
+
patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options) {
|
|
1624
|
+
return MessagesApiFp(this.configuration).patchMessage(mailboxResourceId, folder, uid, v1FolderMessagesFlagsRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
|
|
1628
|
+
* @summary Search messages
|
|
1629
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1630
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1631
|
+
* @param {number} [page]
|
|
1632
|
+
* @param {number} [perPage]
|
|
1633
|
+
* @param {string} [sort]
|
|
1634
|
+
* @param {V1FolderMessagesSearchRequest} [v1FolderMessagesSearchRequest]
|
|
1635
|
+
* @param {*} [options] Override http request option.
|
|
1636
|
+
* @throws {RequiredError}
|
|
1637
|
+
* @memberof MessagesApi
|
|
1638
|
+
*/
|
|
1639
|
+
searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options) {
|
|
1640
|
+
return MessagesApiFp(this.configuration).searchMessages(mailboxResourceId, folder, page, perPage, sort, v1FolderMessagesSearchRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
|
|
1644
|
+
* @summary Update message flags
|
|
1645
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1646
|
+
* @param {string} folder Folder path (URL-encoded).
|
|
1647
|
+
* @param {V1FolderMessagesFlagsBulkRequest} v1FolderMessagesFlagsBulkRequest
|
|
1648
|
+
* @param {*} [options] Override http request option.
|
|
1649
|
+
* @throws {RequiredError}
|
|
1650
|
+
* @memberof MessagesApi
|
|
1651
|
+
*/
|
|
1652
|
+
updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options) {
|
|
1653
|
+
return MessagesApiFp(this.configuration).updateMessageFlags(mailboxResourceId, folder, v1FolderMessagesFlagsBulkRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* QuotaApi - axios parameter creator
|
|
1658
|
+
* @export
|
|
1659
|
+
*/
|
|
1660
|
+
export const QuotaApiAxiosParamCreator = function (configuration) {
|
|
1661
|
+
return {
|
|
1662
|
+
/**
|
|
1663
|
+
* Retrieve storage and message quota usage for the managed mailbox.
|
|
1664
|
+
* @summary Get mailbox quota
|
|
1665
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1666
|
+
* @param {*} [options] Override http request option.
|
|
1667
|
+
* @throws {RequiredError}
|
|
1668
|
+
*/
|
|
1669
|
+
getQuota: (mailboxResourceId_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, ...args_1], void 0, function* (mailboxResourceId, options = {}) {
|
|
1670
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1671
|
+
assertParamExists('getQuota', 'mailboxResourceId', mailboxResourceId);
|
|
1672
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/quota`
|
|
1673
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
1674
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1675
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1676
|
+
let baseOptions;
|
|
1677
|
+
if (configuration) {
|
|
1678
|
+
baseOptions = configuration.baseOptions;
|
|
1679
|
+
}
|
|
1680
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1681
|
+
const localVarHeaderParameter = {};
|
|
1682
|
+
const localVarQueryParameter = {};
|
|
1683
|
+
// authentication BearerAuth required
|
|
1684
|
+
// http bearer authentication required
|
|
1685
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1686
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1687
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1688
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1689
|
+
return {
|
|
1690
|
+
url: toPathString(localVarUrlObj),
|
|
1691
|
+
options: localVarRequestOptions,
|
|
1692
|
+
};
|
|
1693
|
+
}),
|
|
1694
|
+
};
|
|
1695
|
+
};
|
|
1696
|
+
/**
|
|
1697
|
+
* QuotaApi - functional programming interface
|
|
1698
|
+
* @export
|
|
1699
|
+
*/
|
|
1700
|
+
export const QuotaApiFp = function (configuration) {
|
|
1701
|
+
const localVarAxiosParamCreator = QuotaApiAxiosParamCreator(configuration);
|
|
1702
|
+
return {
|
|
1703
|
+
/**
|
|
1704
|
+
* Retrieve storage and message quota usage for the managed mailbox.
|
|
1705
|
+
* @summary Get mailbox quota
|
|
1706
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1707
|
+
* @param {*} [options] Override http request option.
|
|
1708
|
+
* @throws {RequiredError}
|
|
1709
|
+
*/
|
|
1710
|
+
getQuota(mailboxResourceId, options) {
|
|
1711
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1712
|
+
var _a, _b;
|
|
1713
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getQuota(mailboxResourceId, options);
|
|
1714
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['QuotaApi.getQuota']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1715
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1716
|
+
});
|
|
1717
|
+
},
|
|
1718
|
+
};
|
|
1719
|
+
};
|
|
1720
|
+
/**
|
|
1721
|
+
* QuotaApi - factory interface
|
|
1722
|
+
* @export
|
|
1723
|
+
*/
|
|
1724
|
+
export const QuotaApiFactory = function (configuration, basePath, axios) {
|
|
1725
|
+
const localVarFp = QuotaApiFp(configuration);
|
|
1726
|
+
return {
|
|
1727
|
+
/**
|
|
1728
|
+
* Retrieve storage and message quota usage for the managed mailbox.
|
|
1729
|
+
* @summary Get mailbox quota
|
|
1730
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1731
|
+
* @param {*} [options] Override http request option.
|
|
1732
|
+
* @throws {RequiredError}
|
|
1733
|
+
*/
|
|
1734
|
+
getQuota(mailboxResourceId, options) {
|
|
1735
|
+
return localVarFp.getQuota(mailboxResourceId, options).then((request) => request(axios, basePath));
|
|
1736
|
+
},
|
|
1737
|
+
};
|
|
1738
|
+
};
|
|
1739
|
+
/**
|
|
1740
|
+
* QuotaApi - object-oriented interface
|
|
1741
|
+
* @export
|
|
1742
|
+
* @class QuotaApi
|
|
1743
|
+
* @extends {BaseAPI}
|
|
1744
|
+
*/
|
|
1745
|
+
export class QuotaApi extends BaseAPI {
|
|
1746
|
+
/**
|
|
1747
|
+
* Retrieve storage and message quota usage for the managed mailbox.
|
|
1748
|
+
* @summary Get mailbox quota
|
|
1749
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1750
|
+
* @param {*} [options] Override http request option.
|
|
1751
|
+
* @throws {RequiredError}
|
|
1752
|
+
* @memberof QuotaApi
|
|
1753
|
+
*/
|
|
1754
|
+
getQuota(mailboxResourceId, options) {
|
|
1755
|
+
return QuotaApiFp(this.configuration).getQuota(mailboxResourceId, options).then((request) => request(this.axios, this.basePath));
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* SendApi - axios parameter creator
|
|
1760
|
+
* @export
|
|
1761
|
+
*/
|
|
1762
|
+
export const SendApiAxiosParamCreator = function (configuration) {
|
|
1763
|
+
return {
|
|
1764
|
+
/**
|
|
1765
|
+
* Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
1766
|
+
* @summary Send email
|
|
1767
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1768
|
+
* @param {V1SendRequest | null} v1SendRequest
|
|
1769
|
+
* @param {*} [options] Override http request option.
|
|
1770
|
+
* @throws {RequiredError}
|
|
1771
|
+
*/
|
|
1772
|
+
sendEmail: (mailboxResourceId_1, v1SendRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, v1SendRequest_1, ...args_1], void 0, function* (mailboxResourceId, v1SendRequest, options = {}) {
|
|
1773
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1774
|
+
assertParamExists('sendEmail', 'mailboxResourceId', mailboxResourceId);
|
|
1775
|
+
// verify required parameter 'v1SendRequest' is not null or undefined
|
|
1776
|
+
assertParamExists('sendEmail', 'v1SendRequest', v1SendRequest);
|
|
1777
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/send`
|
|
1778
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
1779
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1780
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1781
|
+
let baseOptions;
|
|
1782
|
+
if (configuration) {
|
|
1783
|
+
baseOptions = configuration.baseOptions;
|
|
1784
|
+
}
|
|
1785
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
1786
|
+
const localVarHeaderParameter = {};
|
|
1787
|
+
const localVarQueryParameter = {};
|
|
1788
|
+
// authentication BearerAuth required
|
|
1789
|
+
// http bearer authentication required
|
|
1790
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1791
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1792
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1793
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1794
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1795
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1SendRequest, localVarRequestOptions, configuration);
|
|
1796
|
+
return {
|
|
1797
|
+
url: toPathString(localVarUrlObj),
|
|
1798
|
+
options: localVarRequestOptions,
|
|
1799
|
+
};
|
|
1800
|
+
}),
|
|
1801
|
+
};
|
|
1802
|
+
};
|
|
1803
|
+
/**
|
|
1804
|
+
* SendApi - functional programming interface
|
|
1805
|
+
* @export
|
|
1806
|
+
*/
|
|
1807
|
+
export const SendApiFp = function (configuration) {
|
|
1808
|
+
const localVarAxiosParamCreator = SendApiAxiosParamCreator(configuration);
|
|
1809
|
+
return {
|
|
1810
|
+
/**
|
|
1811
|
+
* Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
1812
|
+
* @summary Send email
|
|
1813
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1814
|
+
* @param {V1SendRequest | null} v1SendRequest
|
|
1815
|
+
* @param {*} [options] Override http request option.
|
|
1816
|
+
* @throws {RequiredError}
|
|
1817
|
+
*/
|
|
1818
|
+
sendEmail(mailboxResourceId, v1SendRequest, options) {
|
|
1819
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1820
|
+
var _a, _b;
|
|
1821
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendEmail(mailboxResourceId, v1SendRequest, options);
|
|
1822
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['SendApi.sendEmail']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
1823
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1824
|
+
});
|
|
1825
|
+
},
|
|
1826
|
+
};
|
|
1827
|
+
};
|
|
1828
|
+
/**
|
|
1829
|
+
* SendApi - factory interface
|
|
1830
|
+
* @export
|
|
1831
|
+
*/
|
|
1832
|
+
export const SendApiFactory = function (configuration, basePath, axios) {
|
|
1833
|
+
const localVarFp = SendApiFp(configuration);
|
|
1834
|
+
return {
|
|
1835
|
+
/**
|
|
1836
|
+
* Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
1837
|
+
* @summary Send email
|
|
1838
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1839
|
+
* @param {V1SendRequest | null} v1SendRequest
|
|
1840
|
+
* @param {*} [options] Override http request option.
|
|
1841
|
+
* @throws {RequiredError}
|
|
1842
|
+
*/
|
|
1843
|
+
sendEmail(mailboxResourceId, v1SendRequest, options) {
|
|
1844
|
+
return localVarFp.sendEmail(mailboxResourceId, v1SendRequest, options).then((request) => request(axios, basePath));
|
|
1845
|
+
},
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
/**
|
|
1849
|
+
* SendApi - object-oriented interface
|
|
1850
|
+
* @export
|
|
1851
|
+
* @class SendApi
|
|
1852
|
+
* @extends {BaseAPI}
|
|
1853
|
+
*/
|
|
1854
|
+
export class SendApi extends BaseAPI {
|
|
1855
|
+
/**
|
|
1856
|
+
* Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
1857
|
+
* @summary Send email
|
|
1858
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1859
|
+
* @param {V1SendRequest | null} v1SendRequest
|
|
1860
|
+
* @param {*} [options] Override http request option.
|
|
1861
|
+
* @throws {RequiredError}
|
|
1862
|
+
* @memberof SendApi
|
|
1863
|
+
*/
|
|
1864
|
+
sendEmail(mailboxResourceId, v1SendRequest, options) {
|
|
1865
|
+
return SendApiFp(this.configuration).sendEmail(mailboxResourceId, v1SendRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* WebhooksApi - axios parameter creator
|
|
1870
|
+
* @export
|
|
1871
|
+
*/
|
|
1872
|
+
export const WebhooksApiAxiosParamCreator = function (configuration) {
|
|
1873
|
+
return {
|
|
1874
|
+
/**
|
|
1875
|
+
* Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
|
|
1876
|
+
* @summary Create webhook
|
|
1877
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1878
|
+
* @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
|
|
1879
|
+
* @param {*} [options] Override http request option.
|
|
1880
|
+
* @throws {RequiredError}
|
|
1881
|
+
*/
|
|
1882
|
+
createWebhook: (mailboxResourceId_1, v1WebhooksCreateRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, v1WebhooksCreateRequest_1, ...args_1], void 0, function* (mailboxResourceId, v1WebhooksCreateRequest, options = {}) {
|
|
1883
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1884
|
+
assertParamExists('createWebhook', 'mailboxResourceId', mailboxResourceId);
|
|
1885
|
+
// verify required parameter 'v1WebhooksCreateRequest' is not null or undefined
|
|
1886
|
+
assertParamExists('createWebhook', 'v1WebhooksCreateRequest', v1WebhooksCreateRequest);
|
|
1887
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks`
|
|
1888
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
1889
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1890
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1891
|
+
let baseOptions;
|
|
1892
|
+
if (configuration) {
|
|
1893
|
+
baseOptions = configuration.baseOptions;
|
|
1894
|
+
}
|
|
1895
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
1896
|
+
const localVarHeaderParameter = {};
|
|
1897
|
+
const localVarQueryParameter = {};
|
|
1898
|
+
// authentication BearerAuth required
|
|
1899
|
+
// http bearer authentication required
|
|
1900
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1901
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1902
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1903
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1904
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1905
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1WebhooksCreateRequest, localVarRequestOptions, configuration);
|
|
1906
|
+
return {
|
|
1907
|
+
url: toPathString(localVarUrlObj),
|
|
1908
|
+
options: localVarRequestOptions,
|
|
1909
|
+
};
|
|
1910
|
+
}),
|
|
1911
|
+
/**
|
|
1912
|
+
* Delete a webhook.
|
|
1913
|
+
* @summary Delete webhook
|
|
1914
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
1915
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
1916
|
+
* @param {*} [options] Override http request option.
|
|
1917
|
+
* @throws {RequiredError}
|
|
1918
|
+
*/
|
|
1919
|
+
deleteWebhook: (mailboxResourceId_1, webhook_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, webhook_1, ...args_1], void 0, function* (mailboxResourceId, webhook, options = {}) {
|
|
1920
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1921
|
+
assertParamExists('deleteWebhook', 'mailboxResourceId', mailboxResourceId);
|
|
1922
|
+
// verify required parameter 'webhook' is not null or undefined
|
|
1923
|
+
assertParamExists('deleteWebhook', 'webhook', webhook);
|
|
1924
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
|
|
1925
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
1926
|
+
.replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
|
|
1927
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1928
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1929
|
+
let baseOptions;
|
|
1930
|
+
if (configuration) {
|
|
1931
|
+
baseOptions = configuration.baseOptions;
|
|
1932
|
+
}
|
|
1933
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
1934
|
+
const localVarHeaderParameter = {};
|
|
1935
|
+
const localVarQueryParameter = {};
|
|
1936
|
+
// authentication BearerAuth required
|
|
1937
|
+
// http bearer authentication required
|
|
1938
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1939
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1940
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1941
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1942
|
+
return {
|
|
1943
|
+
url: toPathString(localVarUrlObj),
|
|
1944
|
+
options: localVarRequestOptions,
|
|
1945
|
+
};
|
|
1946
|
+
}),
|
|
1947
|
+
/**
|
|
1948
|
+
* Retrieve a single webhook by id.
|
|
1949
|
+
* @summary Get webhook
|
|
1950
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
1951
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
1952
|
+
* @param {*} [options] Override http request option.
|
|
1953
|
+
* @throws {RequiredError}
|
|
1954
|
+
*/
|
|
1955
|
+
getWebhook: (mailboxResourceId_1, webhook_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, webhook_1, ...args_1], void 0, function* (mailboxResourceId, webhook, options = {}) {
|
|
1956
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1957
|
+
assertParamExists('getWebhook', 'mailboxResourceId', mailboxResourceId);
|
|
1958
|
+
// verify required parameter 'webhook' is not null or undefined
|
|
1959
|
+
assertParamExists('getWebhook', 'webhook', webhook);
|
|
1960
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
|
|
1961
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
1962
|
+
.replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
|
|
1963
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1964
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1965
|
+
let baseOptions;
|
|
1966
|
+
if (configuration) {
|
|
1967
|
+
baseOptions = configuration.baseOptions;
|
|
1968
|
+
}
|
|
1969
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1970
|
+
const localVarHeaderParameter = {};
|
|
1971
|
+
const localVarQueryParameter = {};
|
|
1972
|
+
// authentication BearerAuth required
|
|
1973
|
+
// http bearer authentication required
|
|
1974
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1975
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1976
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1977
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1978
|
+
return {
|
|
1979
|
+
url: toPathString(localVarUrlObj),
|
|
1980
|
+
options: localVarRequestOptions,
|
|
1981
|
+
};
|
|
1982
|
+
}),
|
|
1983
|
+
/**
|
|
1984
|
+
* List webhooks for a mailbox.
|
|
1985
|
+
* @summary List webhooks
|
|
1986
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
1987
|
+
* @param {ListWebhooksStatusEnum} [status]
|
|
1988
|
+
* @param {number} [page]
|
|
1989
|
+
* @param {number} [perPage]
|
|
1990
|
+
* @param {*} [options] Override http request option.
|
|
1991
|
+
* @throws {RequiredError}
|
|
1992
|
+
*/
|
|
1993
|
+
listWebhooks: (mailboxResourceId_1, status_1, page_1, perPage_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, status_1, page_1, perPage_1, ...args_1], void 0, function* (mailboxResourceId, status, page, perPage, options = {}) {
|
|
1994
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
1995
|
+
assertParamExists('listWebhooks', 'mailboxResourceId', mailboxResourceId);
|
|
1996
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks`
|
|
1997
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)));
|
|
1998
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1999
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2000
|
+
let baseOptions;
|
|
2001
|
+
if (configuration) {
|
|
2002
|
+
baseOptions = configuration.baseOptions;
|
|
2003
|
+
}
|
|
2004
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
2005
|
+
const localVarHeaderParameter = {};
|
|
2006
|
+
const localVarQueryParameter = {};
|
|
2007
|
+
// authentication BearerAuth required
|
|
2008
|
+
// http bearer authentication required
|
|
2009
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2010
|
+
if (status !== undefined) {
|
|
2011
|
+
localVarQueryParameter['status'] = status;
|
|
2012
|
+
}
|
|
2013
|
+
if (page !== undefined) {
|
|
2014
|
+
localVarQueryParameter['page'] = page;
|
|
2015
|
+
}
|
|
2016
|
+
if (perPage !== undefined) {
|
|
2017
|
+
localVarQueryParameter['perPage'] = perPage;
|
|
2018
|
+
}
|
|
2019
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2020
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2021
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2022
|
+
return {
|
|
2023
|
+
url: toPathString(localVarUrlObj),
|
|
2024
|
+
options: localVarRequestOptions,
|
|
2025
|
+
};
|
|
2026
|
+
}),
|
|
2027
|
+
/**
|
|
2028
|
+
* Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
|
|
2029
|
+
* @summary Regenerate webhook secret
|
|
2030
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2031
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2032
|
+
* @param {*} [options] Override http request option.
|
|
2033
|
+
* @throws {RequiredError}
|
|
2034
|
+
*/
|
|
2035
|
+
regenerateWebhookSecret: (mailboxResourceId_1, webhook_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, webhook_1, ...args_1], void 0, function* (mailboxResourceId, webhook, options = {}) {
|
|
2036
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
2037
|
+
assertParamExists('regenerateWebhookSecret', 'mailboxResourceId', mailboxResourceId);
|
|
2038
|
+
// verify required parameter 'webhook' is not null or undefined
|
|
2039
|
+
assertParamExists('regenerateWebhookSecret', 'webhook', webhook);
|
|
2040
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/regenerate-secret`
|
|
2041
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
2042
|
+
.replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
|
|
2043
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2044
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2045
|
+
let baseOptions;
|
|
2046
|
+
if (configuration) {
|
|
2047
|
+
baseOptions = configuration.baseOptions;
|
|
2048
|
+
}
|
|
2049
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2050
|
+
const localVarHeaderParameter = {};
|
|
2051
|
+
const localVarQueryParameter = {};
|
|
2052
|
+
// authentication BearerAuth required
|
|
2053
|
+
// http bearer authentication required
|
|
2054
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2055
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2056
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2057
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2058
|
+
return {
|
|
2059
|
+
url: toPathString(localVarUrlObj),
|
|
2060
|
+
options: localVarRequestOptions,
|
|
2061
|
+
};
|
|
2062
|
+
}),
|
|
2063
|
+
/**
|
|
2064
|
+
* Send a test delivery to the webhook URL and return the upstream response.
|
|
2065
|
+
* @summary Test webhook
|
|
2066
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2067
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2068
|
+
* @param {*} [options] Override http request option.
|
|
2069
|
+
* @throws {RequiredError}
|
|
2070
|
+
*/
|
|
2071
|
+
testWebhook: (mailboxResourceId_1, webhook_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, webhook_1, ...args_1], void 0, function* (mailboxResourceId, webhook, options = {}) {
|
|
2072
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
2073
|
+
assertParamExists('testWebhook', 'mailboxResourceId', mailboxResourceId);
|
|
2074
|
+
// verify required parameter 'webhook' is not null or undefined
|
|
2075
|
+
assertParamExists('testWebhook', 'webhook', webhook);
|
|
2076
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/test`
|
|
2077
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
2078
|
+
.replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
|
|
2079
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2080
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2081
|
+
let baseOptions;
|
|
2082
|
+
if (configuration) {
|
|
2083
|
+
baseOptions = configuration.baseOptions;
|
|
2084
|
+
}
|
|
2085
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
2086
|
+
const localVarHeaderParameter = {};
|
|
2087
|
+
const localVarQueryParameter = {};
|
|
2088
|
+
// authentication BearerAuth required
|
|
2089
|
+
// http bearer authentication required
|
|
2090
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2091
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2092
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2093
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2094
|
+
return {
|
|
2095
|
+
url: toPathString(localVarUrlObj),
|
|
2096
|
+
options: localVarRequestOptions,
|
|
2097
|
+
};
|
|
2098
|
+
}),
|
|
2099
|
+
/**
|
|
2100
|
+
* Partially update a webhook.
|
|
2101
|
+
* @summary Update webhook
|
|
2102
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2103
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2104
|
+
* @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
|
|
2105
|
+
* @param {*} [options] Override http request option.
|
|
2106
|
+
* @throws {RequiredError}
|
|
2107
|
+
*/
|
|
2108
|
+
updateWebhook: (mailboxResourceId_1, webhook_1, v1WebhooksUpdateRequest_1, ...args_1) => __awaiter(this, [mailboxResourceId_1, webhook_1, v1WebhooksUpdateRequest_1, ...args_1], void 0, function* (mailboxResourceId, webhook, v1WebhooksUpdateRequest, options = {}) {
|
|
2109
|
+
// verify required parameter 'mailboxResourceId' is not null or undefined
|
|
2110
|
+
assertParamExists('updateWebhook', 'mailboxResourceId', mailboxResourceId);
|
|
2111
|
+
// verify required parameter 'webhook' is not null or undefined
|
|
2112
|
+
assertParamExists('updateWebhook', 'webhook', webhook);
|
|
2113
|
+
// verify required parameter 'v1WebhooksUpdateRequest' is not null or undefined
|
|
2114
|
+
assertParamExists('updateWebhook', 'v1WebhooksUpdateRequest', v1WebhooksUpdateRequest);
|
|
2115
|
+
const localVarPath = `/api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}`
|
|
2116
|
+
.replace(`{${"mailboxResourceId"}}`, encodeURIComponent(String(mailboxResourceId)))
|
|
2117
|
+
.replace(`{${"webhook"}}`, encodeURIComponent(String(webhook)));
|
|
2118
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2119
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2120
|
+
let baseOptions;
|
|
2121
|
+
if (configuration) {
|
|
2122
|
+
baseOptions = configuration.baseOptions;
|
|
2123
|
+
}
|
|
2124
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
2125
|
+
const localVarHeaderParameter = {};
|
|
2126
|
+
const localVarQueryParameter = {};
|
|
2127
|
+
// authentication BearerAuth required
|
|
2128
|
+
// http bearer authentication required
|
|
2129
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2130
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2131
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2132
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2133
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
2134
|
+
localVarRequestOptions.data = serializeDataIfNeeded(v1WebhooksUpdateRequest, localVarRequestOptions, configuration);
|
|
2135
|
+
return {
|
|
2136
|
+
url: toPathString(localVarUrlObj),
|
|
2137
|
+
options: localVarRequestOptions,
|
|
2138
|
+
};
|
|
2139
|
+
}),
|
|
2140
|
+
};
|
|
2141
|
+
};
|
|
2142
|
+
/**
|
|
2143
|
+
* WebhooksApi - functional programming interface
|
|
2144
|
+
* @export
|
|
2145
|
+
*/
|
|
2146
|
+
export const WebhooksApiFp = function (configuration) {
|
|
2147
|
+
const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration);
|
|
2148
|
+
return {
|
|
2149
|
+
/**
|
|
2150
|
+
* Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
|
|
2151
|
+
* @summary Create webhook
|
|
2152
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2153
|
+
* @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
|
|
2154
|
+
* @param {*} [options] Override http request option.
|
|
2155
|
+
* @throws {RequiredError}
|
|
2156
|
+
*/
|
|
2157
|
+
createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options) {
|
|
2158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2159
|
+
var _a, _b;
|
|
2160
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options);
|
|
2161
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.createWebhook']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2162
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2163
|
+
});
|
|
2164
|
+
},
|
|
2165
|
+
/**
|
|
2166
|
+
* Delete a webhook.
|
|
2167
|
+
* @summary Delete webhook
|
|
2168
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2169
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2170
|
+
* @param {*} [options] Override http request option.
|
|
2171
|
+
* @throws {RequiredError}
|
|
2172
|
+
*/
|
|
2173
|
+
deleteWebhook(mailboxResourceId, webhook, options) {
|
|
2174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2175
|
+
var _a, _b;
|
|
2176
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteWebhook(mailboxResourceId, webhook, options);
|
|
2177
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.deleteWebhook']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2178
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2179
|
+
});
|
|
2180
|
+
},
|
|
2181
|
+
/**
|
|
2182
|
+
* Retrieve a single webhook by id.
|
|
2183
|
+
* @summary Get webhook
|
|
2184
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2185
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2186
|
+
* @param {*} [options] Override http request option.
|
|
2187
|
+
* @throws {RequiredError}
|
|
2188
|
+
*/
|
|
2189
|
+
getWebhook(mailboxResourceId, webhook, options) {
|
|
2190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2191
|
+
var _a, _b;
|
|
2192
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getWebhook(mailboxResourceId, webhook, options);
|
|
2193
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.getWebhook']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2194
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2195
|
+
});
|
|
2196
|
+
},
|
|
2197
|
+
/**
|
|
2198
|
+
* List webhooks for a mailbox.
|
|
2199
|
+
* @summary List webhooks
|
|
2200
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2201
|
+
* @param {ListWebhooksStatusEnum} [status]
|
|
2202
|
+
* @param {number} [page]
|
|
2203
|
+
* @param {number} [perPage]
|
|
2204
|
+
* @param {*} [options] Override http request option.
|
|
2205
|
+
* @throws {RequiredError}
|
|
2206
|
+
*/
|
|
2207
|
+
listWebhooks(mailboxResourceId, status, page, perPage, options) {
|
|
2208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2209
|
+
var _a, _b;
|
|
2210
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listWebhooks(mailboxResourceId, status, page, perPage, options);
|
|
2211
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.listWebhooks']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2212
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2213
|
+
});
|
|
2214
|
+
},
|
|
2215
|
+
/**
|
|
2216
|
+
* Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
|
|
2217
|
+
* @summary Regenerate webhook secret
|
|
2218
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2219
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2220
|
+
* @param {*} [options] Override http request option.
|
|
2221
|
+
* @throws {RequiredError}
|
|
2222
|
+
*/
|
|
2223
|
+
regenerateWebhookSecret(mailboxResourceId, webhook, options) {
|
|
2224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2225
|
+
var _a, _b;
|
|
2226
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.regenerateWebhookSecret(mailboxResourceId, webhook, options);
|
|
2227
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.regenerateWebhookSecret']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2228
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2229
|
+
});
|
|
2230
|
+
},
|
|
2231
|
+
/**
|
|
2232
|
+
* Send a test delivery to the webhook URL and return the upstream response.
|
|
2233
|
+
* @summary Test webhook
|
|
2234
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2235
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2236
|
+
* @param {*} [options] Override http request option.
|
|
2237
|
+
* @throws {RequiredError}
|
|
2238
|
+
*/
|
|
2239
|
+
testWebhook(mailboxResourceId, webhook, options) {
|
|
2240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2241
|
+
var _a, _b;
|
|
2242
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.testWebhook(mailboxResourceId, webhook, options);
|
|
2243
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.testWebhook']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2244
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2245
|
+
});
|
|
2246
|
+
},
|
|
2247
|
+
/**
|
|
2248
|
+
* Partially update a webhook.
|
|
2249
|
+
* @summary Update webhook
|
|
2250
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2251
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2252
|
+
* @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
|
|
2253
|
+
* @param {*} [options] Override http request option.
|
|
2254
|
+
* @throws {RequiredError}
|
|
2255
|
+
*/
|
|
2256
|
+
updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options) {
|
|
2257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2258
|
+
var _a, _b;
|
|
2259
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options);
|
|
2260
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WebhooksApi.updateWebhook']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
2261
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2262
|
+
});
|
|
2263
|
+
},
|
|
2264
|
+
};
|
|
2265
|
+
};
|
|
2266
|
+
/**
|
|
2267
|
+
* WebhooksApi - factory interface
|
|
2268
|
+
* @export
|
|
2269
|
+
*/
|
|
2270
|
+
export const WebhooksApiFactory = function (configuration, basePath, axios) {
|
|
2271
|
+
const localVarFp = WebhooksApiFp(configuration);
|
|
2272
|
+
return {
|
|
2273
|
+
/**
|
|
2274
|
+
* Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
|
|
2275
|
+
* @summary Create webhook
|
|
2276
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2277
|
+
* @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
|
|
2278
|
+
* @param {*} [options] Override http request option.
|
|
2279
|
+
* @throws {RequiredError}
|
|
2280
|
+
*/
|
|
2281
|
+
createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options) {
|
|
2282
|
+
return localVarFp.createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options).then((request) => request(axios, basePath));
|
|
2283
|
+
},
|
|
2284
|
+
/**
|
|
2285
|
+
* Delete a webhook.
|
|
2286
|
+
* @summary Delete webhook
|
|
2287
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2288
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2289
|
+
* @param {*} [options] Override http request option.
|
|
2290
|
+
* @throws {RequiredError}
|
|
2291
|
+
*/
|
|
2292
|
+
deleteWebhook(mailboxResourceId, webhook, options) {
|
|
2293
|
+
return localVarFp.deleteWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
|
|
2294
|
+
},
|
|
2295
|
+
/**
|
|
2296
|
+
* Retrieve a single webhook by id.
|
|
2297
|
+
* @summary Get webhook
|
|
2298
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2299
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2300
|
+
* @param {*} [options] Override http request option.
|
|
2301
|
+
* @throws {RequiredError}
|
|
2302
|
+
*/
|
|
2303
|
+
getWebhook(mailboxResourceId, webhook, options) {
|
|
2304
|
+
return localVarFp.getWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
|
|
2305
|
+
},
|
|
2306
|
+
/**
|
|
2307
|
+
* List webhooks for a mailbox.
|
|
2308
|
+
* @summary List webhooks
|
|
2309
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2310
|
+
* @param {ListWebhooksStatusEnum} [status]
|
|
2311
|
+
* @param {number} [page]
|
|
2312
|
+
* @param {number} [perPage]
|
|
2313
|
+
* @param {*} [options] Override http request option.
|
|
2314
|
+
* @throws {RequiredError}
|
|
2315
|
+
*/
|
|
2316
|
+
listWebhooks(mailboxResourceId, status, page, perPage, options) {
|
|
2317
|
+
return localVarFp.listWebhooks(mailboxResourceId, status, page, perPage, options).then((request) => request(axios, basePath));
|
|
2318
|
+
},
|
|
2319
|
+
/**
|
|
2320
|
+
* Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
|
|
2321
|
+
* @summary Regenerate webhook secret
|
|
2322
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2323
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2324
|
+
* @param {*} [options] Override http request option.
|
|
2325
|
+
* @throws {RequiredError}
|
|
2326
|
+
*/
|
|
2327
|
+
regenerateWebhookSecret(mailboxResourceId, webhook, options) {
|
|
2328
|
+
return localVarFp.regenerateWebhookSecret(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
|
|
2329
|
+
},
|
|
2330
|
+
/**
|
|
2331
|
+
* Send a test delivery to the webhook URL and return the upstream response.
|
|
2332
|
+
* @summary Test webhook
|
|
2333
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2334
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2335
|
+
* @param {*} [options] Override http request option.
|
|
2336
|
+
* @throws {RequiredError}
|
|
2337
|
+
*/
|
|
2338
|
+
testWebhook(mailboxResourceId, webhook, options) {
|
|
2339
|
+
return localVarFp.testWebhook(mailboxResourceId, webhook, options).then((request) => request(axios, basePath));
|
|
2340
|
+
},
|
|
2341
|
+
/**
|
|
2342
|
+
* Partially update a webhook.
|
|
2343
|
+
* @summary Update webhook
|
|
2344
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2345
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2346
|
+
* @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
|
|
2347
|
+
* @param {*} [options] Override http request option.
|
|
2348
|
+
* @throws {RequiredError}
|
|
2349
|
+
*/
|
|
2350
|
+
updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options) {
|
|
2351
|
+
return localVarFp.updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options).then((request) => request(axios, basePath));
|
|
2352
|
+
},
|
|
2353
|
+
};
|
|
2354
|
+
};
|
|
2355
|
+
/**
|
|
2356
|
+
* WebhooksApi - object-oriented interface
|
|
2357
|
+
* @export
|
|
2358
|
+
* @class WebhooksApi
|
|
2359
|
+
* @extends {BaseAPI}
|
|
2360
|
+
*/
|
|
2361
|
+
export class WebhooksApi extends BaseAPI {
|
|
2362
|
+
/**
|
|
2363
|
+
* Create a webhook. The response includes the one-time `secret` — store it securely as it is never returned again.
|
|
2364
|
+
* @summary Create webhook
|
|
2365
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2366
|
+
* @param {V1WebhooksCreateRequest} v1WebhooksCreateRequest
|
|
2367
|
+
* @param {*} [options] Override http request option.
|
|
2368
|
+
* @throws {RequiredError}
|
|
2369
|
+
* @memberof WebhooksApi
|
|
2370
|
+
*/
|
|
2371
|
+
createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options) {
|
|
2372
|
+
return WebhooksApiFp(this.configuration).createWebhook(mailboxResourceId, v1WebhooksCreateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* Delete a webhook.
|
|
2376
|
+
* @summary Delete webhook
|
|
2377
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2378
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2379
|
+
* @param {*} [options] Override http request option.
|
|
2380
|
+
* @throws {RequiredError}
|
|
2381
|
+
* @memberof WebhooksApi
|
|
2382
|
+
*/
|
|
2383
|
+
deleteWebhook(mailboxResourceId, webhook, options) {
|
|
2384
|
+
return WebhooksApiFp(this.configuration).deleteWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* Retrieve a single webhook by id.
|
|
2388
|
+
* @summary Get webhook
|
|
2389
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2390
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2391
|
+
* @param {*} [options] Override http request option.
|
|
2392
|
+
* @throws {RequiredError}
|
|
2393
|
+
* @memberof WebhooksApi
|
|
2394
|
+
*/
|
|
2395
|
+
getWebhook(mailboxResourceId, webhook, options) {
|
|
2396
|
+
return WebhooksApiFp(this.configuration).getWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
|
|
2397
|
+
}
|
|
2398
|
+
/**
|
|
2399
|
+
* List webhooks for a mailbox.
|
|
2400
|
+
* @summary List webhooks
|
|
2401
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
|
|
2402
|
+
* @param {ListWebhooksStatusEnum} [status]
|
|
2403
|
+
* @param {number} [page]
|
|
2404
|
+
* @param {number} [perPage]
|
|
2405
|
+
* @param {*} [options] Override http request option.
|
|
2406
|
+
* @throws {RequiredError}
|
|
2407
|
+
* @memberof WebhooksApi
|
|
2408
|
+
*/
|
|
2409
|
+
listWebhooks(mailboxResourceId, status, page, perPage, options) {
|
|
2410
|
+
return WebhooksApiFp(this.configuration).listWebhooks(mailboxResourceId, status, page, perPage, options).then((request) => request(this.axios, this.basePath));
|
|
2411
|
+
}
|
|
2412
|
+
/**
|
|
2413
|
+
* Regenerate the webhook secret. The previous secret is immediately invalidated. The new secret is returned once.
|
|
2414
|
+
* @summary Regenerate webhook secret
|
|
2415
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2416
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2417
|
+
* @param {*} [options] Override http request option.
|
|
2418
|
+
* @throws {RequiredError}
|
|
2419
|
+
* @memberof WebhooksApi
|
|
2420
|
+
*/
|
|
2421
|
+
regenerateWebhookSecret(mailboxResourceId, webhook, options) {
|
|
2422
|
+
return WebhooksApiFp(this.configuration).regenerateWebhookSecret(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
|
|
2423
|
+
}
|
|
2424
|
+
/**
|
|
2425
|
+
* Send a test delivery to the webhook URL and return the upstream response.
|
|
2426
|
+
* @summary Test webhook
|
|
2427
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2428
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2429
|
+
* @param {*} [options] Override http request option.
|
|
2430
|
+
* @throws {RequiredError}
|
|
2431
|
+
* @memberof WebhooksApi
|
|
2432
|
+
*/
|
|
2433
|
+
testWebhook(mailboxResourceId, webhook, options) {
|
|
2434
|
+
return WebhooksApiFp(this.configuration).testWebhook(mailboxResourceId, webhook, options).then((request) => request(this.axios, this.basePath));
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* Partially update a webhook.
|
|
2438
|
+
* @summary Update webhook
|
|
2439
|
+
* @param {string} mailboxResourceId Resource ID of the managed mailbox.
|
|
2440
|
+
* @param {string} webhook Webhook identifier (UUID v7).
|
|
2441
|
+
* @param {V1WebhooksUpdateRequest} v1WebhooksUpdateRequest
|
|
2442
|
+
* @param {*} [options] Override http request option.
|
|
2443
|
+
* @throws {RequiredError}
|
|
2444
|
+
* @memberof WebhooksApi
|
|
2445
|
+
*/
|
|
2446
|
+
updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options) {
|
|
2447
|
+
return WebhooksApiFp(this.configuration).updateWebhook(mailboxResourceId, webhook, v1WebhooksUpdateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* @export
|
|
2452
|
+
*/
|
|
2453
|
+
export const ListWebhooksStatusEnum = {
|
|
2454
|
+
Active: 'active',
|
|
2455
|
+
Paused: 'paused',
|
|
2456
|
+
Disabled: 'disabled'
|
|
2457
|
+
};
|