boldsign 3.1.0 → 3.1.1
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/.openapi-generator/FILES +11 -0
- package/README.md +16 -0
- package/api/apis.ts +1 -1
- package/api/documentApi.ts +146 -1
- package/api/groupContactsApi.ts +779 -0
- package/api/index.ts +3 -1
- package/boldsign-3.1.1.tgz +0 -0
- package/dist/api/apis.d.ts +1 -1
- package/dist/api/apis.js +1 -1
- package/dist/api/documentApi.d.ts +2 -1
- package/dist/api/documentApi.js +90 -0
- package/dist/api/documentApi.js.map +1 -1
- package/dist/api/groupContactsApi.d.ts +28 -0
- package/dist/api/groupContactsApi.js +507 -0
- package/dist/api/groupContactsApi.js.map +1 -0
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +4 -2
- package/dist/api/index.js.map +1 -1
- package/dist/examples/contactGroupDelete.d.ts +1 -0
- package/dist/examples/contactGroupDelete.js +27 -0
- package/dist/examples/contactGroupDelete.js.map +1 -0
- package/dist/examples/contactGroupGet.d.ts +1 -0
- package/dist/examples/contactGroupGet.js +27 -0
- package/dist/examples/contactGroupGet.js.map +1 -0
- package/dist/examples/contactGroupList.d.ts +1 -0
- package/dist/examples/contactGroupList.js +29 -0
- package/dist/examples/contactGroupList.js.map +1 -0
- package/dist/examples/contactGroupUpdate.d.ts +1 -0
- package/dist/examples/contactGroupUpdate.js +34 -0
- package/dist/examples/contactGroupUpdate.js.map +1 -0
- package/dist/examples/contactGroupsCreate.d.ts +1 -0
- package/dist/examples/contactGroupsCreate.js +35 -0
- package/dist/examples/contactGroupsCreate.js.map +1 -0
- package/dist/examples/documentCreateEmbeddedEditUrl.d.ts +1 -0
- package/dist/examples/documentCreateEmbeddedEditUrl.js +32 -0
- package/dist/examples/documentCreateEmbeddedEditUrl.js.map +1 -0
- package/dist/model/createGroupContactResponse.d.ts +15 -0
- package/dist/model/createGroupContactResponse.js +23 -0
- package/dist/model/createGroupContactResponse.js.map +1 -0
- package/dist/model/creators.d.ts +15 -0
- package/dist/model/creators.js +23 -0
- package/dist/model/creators.js.map +1 -0
- package/dist/model/embeddedDocumentEditJsonRequest.d.ts +51 -0
- package/dist/model/embeddedDocumentEditJsonRequest.js +97 -0
- package/dist/model/embeddedDocumentEditJsonRequest.js.map +1 -0
- package/dist/model/embeddedDocumentEdited.d.ts +14 -0
- package/dist/model/embeddedDocumentEdited.js +18 -0
- package/dist/model/embeddedDocumentEdited.js.map +1 -0
- package/dist/model/getGroupContactDetails.d.ts +20 -0
- package/dist/model/getGroupContactDetails.js +38 -0
- package/dist/model/getGroupContactDetails.js.map +1 -0
- package/dist/model/groupContact.d.ts +18 -0
- package/dist/model/groupContact.js +33 -0
- package/dist/model/groupContact.js.map +1 -0
- package/dist/model/groupContactDetails.d.ts +17 -0
- package/dist/model/groupContactDetails.js +28 -0
- package/dist/model/groupContactDetails.js.map +1 -0
- package/dist/model/groupContactsList.d.ts +17 -0
- package/dist/model/groupContactsList.js +23 -0
- package/dist/model/groupContactsList.js.map +1 -0
- package/dist/model/groupUser.d.ts +15 -0
- package/dist/model/groupUser.js +23 -0
- package/dist/model/groupUser.js.map +1 -0
- package/dist/model/index.d.ts +11 -1
- package/dist/model/index.js +36 -4
- package/dist/model/index.js.map +1 -1
- package/dist/model/updateGroupContact.d.ts +17 -0
- package/dist/model/updateGroupContact.js +28 -0
- package/dist/model/updateGroupContact.js.map +1 -0
- package/docs/CreateGroupContactResponse.md +12 -0
- package/docs/Creators.md +12 -0
- package/docs/DocumentApi.md +34 -0
- package/docs/EmbeddedDocumentEditJsonRequest.md +19 -0
- package/docs/EmbeddedDocumentEdited.md +11 -0
- package/docs/GetGroupContactDetails.md +15 -0
- package/docs/GroupContact.md +14 -0
- package/docs/GroupContactDetails.md +13 -0
- package/docs/GroupContactsApi.md +177 -0
- package/docs/GroupContactsList.md +12 -0
- package/docs/GroupUser.md +12 -0
- package/docs/UpdateGroupContact.md +13 -0
- package/examples/contactGroupDelete.ts +14 -0
- package/examples/contactGroupGet.ts +14 -0
- package/examples/contactGroupList.ts +16 -0
- package/examples/contactGroupUpdate.ts +21 -0
- package/examples/contactGroupsCreate.ts +24 -0
- package/examples/documentCreateEmbeddedEditUrl.ts +19 -0
- package/model/createGroupContactResponse.ts +37 -0
- package/model/creators.ts +37 -0
- package/model/embeddedDocumentEditJsonRequest.ts +108 -0
- package/model/embeddedDocumentEdited.ts +31 -0
- package/model/getGroupContactDetails.ts +57 -0
- package/model/groupContact.ts +50 -0
- package/model/groupContactDetails.ts +44 -0
- package/model/groupContactsList.ts +39 -0
- package/model/groupUser.ts +37 -0
- package/model/index.ts +32 -0
- package/model/updateGroupContact.ts +44 -0
- package/package.json +1 -1
- package/boldsign-3.1.0.tgz +0 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BoldSign API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
ObjectSerializer, Authentication, VoidAuth, Interceptor,
|
|
17
|
+
HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, RequestFile,
|
|
18
|
+
CreateGroupContactResponse,ErrorResult,GetGroupContactDetails,GroupContactDetails,GroupContactsList,UpdateGroupContact,
|
|
19
|
+
} from '../model';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
HttpError,
|
|
23
|
+
optionsI,
|
|
24
|
+
returnTypeT,
|
|
25
|
+
returnTypeI,
|
|
26
|
+
generateFormData,
|
|
27
|
+
toFormData,
|
|
28
|
+
queryParamsSerializer,
|
|
29
|
+
USER_AGENT,
|
|
30
|
+
} from './';
|
|
31
|
+
|
|
32
|
+
let defaultBasePath = 'https://api.boldsign.com';
|
|
33
|
+
|
|
34
|
+
// ===============================================
|
|
35
|
+
// This file is autogenerated - Please do not edit
|
|
36
|
+
// ===============================================
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export class GroupContactsApi {
|
|
40
|
+
protected _basePath = defaultBasePath;
|
|
41
|
+
protected _defaultHeaders : any = { 'User-Agent': USER_AGENT };
|
|
42
|
+
protected _useQuerystring : boolean = true;
|
|
43
|
+
|
|
44
|
+
protected authentications = {
|
|
45
|
+
'default': <Authentication>new VoidAuth(),
|
|
46
|
+
'Bearer': new ApiKeyAuth('header', 'Authorization'),
|
|
47
|
+
'X-API-KEY': new ApiKeyAuth('header', 'X-API-KEY'),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected interceptors: Interceptor[] = [];
|
|
51
|
+
|
|
52
|
+
constructor(basePath?: string) {
|
|
53
|
+
if (basePath) {
|
|
54
|
+
this.basePath = basePath;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
set useQuerystring(value: boolean) {
|
|
59
|
+
this._useQuerystring = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set basePath(basePath: string) {
|
|
63
|
+
this._basePath = basePath;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
67
|
+
this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get defaultHeaders() {
|
|
71
|
+
return this._defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get basePath() {
|
|
75
|
+
return this._basePath;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
79
|
+
this.authentications.default = auth;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setApiKey(apikey: string) {
|
|
83
|
+
this.authentications["X-API-KEY"].apiKey = apikey;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public setAccessToken(accessToken: string) {
|
|
87
|
+
this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
91
|
+
this.interceptors.push(interceptor);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @summary Create a new Group Contact.
|
|
97
|
+
* @param groupContactDetails The group contact details.
|
|
98
|
+
* @param options
|
|
99
|
+
*/
|
|
100
|
+
public async createGroupContact (groupContactDetails?: GroupContactDetails, options: optionsI = {headers: {}}) : Promise<CreateGroupContactResponse> {
|
|
101
|
+
groupContactDetails = deserializeIfNeeded(groupContactDetails, "GroupContactDetails");
|
|
102
|
+
const localVarPath = this.basePath + '/v1/contactGroups/create';
|
|
103
|
+
let localVarQueryParameters: any = {};
|
|
104
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
105
|
+
const produces = ['application/json'];
|
|
106
|
+
// give precedence to 'application/json'
|
|
107
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
108
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
109
|
+
} else {
|
|
110
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
111
|
+
}
|
|
112
|
+
let localVarFormParams: any = {};
|
|
113
|
+
let localVarBodyParams: any = undefined;
|
|
114
|
+
|
|
115
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
116
|
+
|
|
117
|
+
let localVarUseFormData = false;
|
|
118
|
+
|
|
119
|
+
const result = generateFormData(groupContactDetails, GroupContactDetails);
|
|
120
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
121
|
+
|
|
122
|
+
let data = {};
|
|
123
|
+
if (localVarUseFormData) {
|
|
124
|
+
const formData = toFormData(result.data);
|
|
125
|
+
data = formData;
|
|
126
|
+
localVarHeaderParams = {
|
|
127
|
+
...localVarHeaderParams,
|
|
128
|
+
...formData.getHeaders(),
|
|
129
|
+
};
|
|
130
|
+
} else {
|
|
131
|
+
data = ObjectSerializer.serialize(
|
|
132
|
+
groupContactDetails,
|
|
133
|
+
"GroupContactDetails"
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
params: localVarQueryParameters,
|
|
140
|
+
headers: localVarHeaderParams,
|
|
141
|
+
url: localVarPath,
|
|
142
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
143
|
+
maxContentLength: Infinity,
|
|
144
|
+
maxBodyLength: Infinity,
|
|
145
|
+
responseType: "json",
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
149
|
+
localVarRequestOptions.data = data;
|
|
150
|
+
}
|
|
151
|
+
let authenticationPromise = Promise.resolve();
|
|
152
|
+
|
|
153
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
154
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
155
|
+
}
|
|
156
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
157
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
158
|
+
}
|
|
159
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
160
|
+
|
|
161
|
+
let interceptorPromise = authenticationPromise;
|
|
162
|
+
for (const interceptor of this.interceptors) {
|
|
163
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return interceptorPromise.then(() => {
|
|
167
|
+
return new Promise<CreateGroupContactResponse>((resolve, reject) => {
|
|
168
|
+
axios.request(localVarRequestOptions)
|
|
169
|
+
.then((response) => {
|
|
170
|
+
handleSuccessfulResponse<CreateGroupContactResponse>(
|
|
171
|
+
resolve,
|
|
172
|
+
reject,
|
|
173
|
+
response,
|
|
174
|
+
"CreateGroupContactResponse",
|
|
175
|
+
);
|
|
176
|
+
}, (error: AxiosError) => {
|
|
177
|
+
if (error.response == null) {
|
|
178
|
+
reject(error);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (handleErrorCodeResponse(
|
|
183
|
+
reject,
|
|
184
|
+
error.response,
|
|
185
|
+
201,
|
|
186
|
+
"CreateGroupContactResponse",
|
|
187
|
+
)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (handleErrorCodeResponse(
|
|
191
|
+
reject,
|
|
192
|
+
error.response,
|
|
193
|
+
401,
|
|
194
|
+
"ErrorResult",
|
|
195
|
+
)) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (handleErrorCodeResponse(
|
|
199
|
+
reject,
|
|
200
|
+
error.response,
|
|
201
|
+
400,
|
|
202
|
+
"ErrorResult",
|
|
203
|
+
)) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
reject(error);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @summary Deletes a Group Contact.
|
|
216
|
+
* @param groupId The group contact id.
|
|
217
|
+
* @param options
|
|
218
|
+
*/
|
|
219
|
+
public async deleteGroupContact (groupId: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
220
|
+
const localVarPath = this.basePath + '/v1/contactGroups/delete';
|
|
221
|
+
let localVarQueryParameters: any = {};
|
|
222
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
223
|
+
const produces = ['application/json'];
|
|
224
|
+
// give precedence to 'application/json'
|
|
225
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
226
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
227
|
+
} else {
|
|
228
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
229
|
+
}
|
|
230
|
+
let localVarFormParams: any = {};
|
|
231
|
+
let localVarBodyParams: any = undefined;
|
|
232
|
+
|
|
233
|
+
// verify required parameter 'groupId' is not null or undefined
|
|
234
|
+
if (groupId === null || groupId === undefined) {
|
|
235
|
+
throw new Error('Required parameter groupId was null or undefined when calling deleteGroupContact.');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (groupId !== undefined) {
|
|
239
|
+
localVarQueryParameters['groupId'] = ObjectSerializer.serialize(groupId, "string");
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
243
|
+
|
|
244
|
+
let localVarUseFormData = false;
|
|
245
|
+
|
|
246
|
+
let data = {};
|
|
247
|
+
if (localVarUseFormData) {
|
|
248
|
+
const formData = toFormData(localVarFormParams);
|
|
249
|
+
data = formData;
|
|
250
|
+
localVarHeaderParams = {
|
|
251
|
+
...localVarHeaderParams,
|
|
252
|
+
...formData.getHeaders(),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
257
|
+
method: 'DELETE',
|
|
258
|
+
params: localVarQueryParameters,
|
|
259
|
+
headers: localVarHeaderParams,
|
|
260
|
+
url: localVarPath,
|
|
261
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
262
|
+
maxContentLength: Infinity,
|
|
263
|
+
maxBodyLength: Infinity,
|
|
264
|
+
responseType: "json",
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
268
|
+
localVarRequestOptions.data = data;
|
|
269
|
+
}
|
|
270
|
+
let authenticationPromise = Promise.resolve();
|
|
271
|
+
|
|
272
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
273
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
274
|
+
}
|
|
275
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
276
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
277
|
+
}
|
|
278
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
279
|
+
|
|
280
|
+
let interceptorPromise = authenticationPromise;
|
|
281
|
+
for (const interceptor of this.interceptors) {
|
|
282
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return interceptorPromise.then(() => {
|
|
286
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
287
|
+
axios.request(localVarRequestOptions)
|
|
288
|
+
.then((response) => {
|
|
289
|
+
handleSuccessfulResponse(
|
|
290
|
+
resolve,
|
|
291
|
+
reject,
|
|
292
|
+
response,
|
|
293
|
+
|
|
294
|
+
);
|
|
295
|
+
}, (error: AxiosError) => {
|
|
296
|
+
if (error.response == null) {
|
|
297
|
+
reject(error);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (handleErrorCodeResponse(
|
|
302
|
+
reject,
|
|
303
|
+
error.response,
|
|
304
|
+
401,
|
|
305
|
+
"ErrorResult",
|
|
306
|
+
)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (handleErrorCodeResponse(
|
|
310
|
+
reject,
|
|
311
|
+
error.response,
|
|
312
|
+
403,
|
|
313
|
+
"ErrorResult",
|
|
314
|
+
)) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
reject(error);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
*
|
|
326
|
+
* @summary Get Summary of the Group Contact.
|
|
327
|
+
* @param groupId Group Contact Id.
|
|
328
|
+
* @param options
|
|
329
|
+
*/
|
|
330
|
+
public async getGroupContact (groupId: string, options: optionsI = {headers: {}}) : Promise<GetGroupContactDetails> {
|
|
331
|
+
const localVarPath = this.basePath + '/v1/contactGroups/get';
|
|
332
|
+
let localVarQueryParameters: any = {};
|
|
333
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
334
|
+
const produces = ['application/json'];
|
|
335
|
+
// give precedence to 'application/json'
|
|
336
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
337
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
338
|
+
} else {
|
|
339
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
340
|
+
}
|
|
341
|
+
let localVarFormParams: any = {};
|
|
342
|
+
let localVarBodyParams: any = undefined;
|
|
343
|
+
|
|
344
|
+
// verify required parameter 'groupId' is not null or undefined
|
|
345
|
+
if (groupId === null || groupId === undefined) {
|
|
346
|
+
throw new Error('Required parameter groupId was null or undefined when calling getGroupContact.');
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (groupId !== undefined) {
|
|
350
|
+
localVarQueryParameters['groupId'] = ObjectSerializer.serialize(groupId, "string");
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
354
|
+
|
|
355
|
+
let localVarUseFormData = false;
|
|
356
|
+
|
|
357
|
+
let data = {};
|
|
358
|
+
if (localVarUseFormData) {
|
|
359
|
+
const formData = toFormData(localVarFormParams);
|
|
360
|
+
data = formData;
|
|
361
|
+
localVarHeaderParams = {
|
|
362
|
+
...localVarHeaderParams,
|
|
363
|
+
...formData.getHeaders(),
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
368
|
+
method: 'GET',
|
|
369
|
+
params: localVarQueryParameters,
|
|
370
|
+
headers: localVarHeaderParams,
|
|
371
|
+
url: localVarPath,
|
|
372
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
373
|
+
maxContentLength: Infinity,
|
|
374
|
+
maxBodyLength: Infinity,
|
|
375
|
+
responseType: "json",
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
379
|
+
localVarRequestOptions.data = data;
|
|
380
|
+
}
|
|
381
|
+
let authenticationPromise = Promise.resolve();
|
|
382
|
+
|
|
383
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
384
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
385
|
+
}
|
|
386
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
387
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
388
|
+
}
|
|
389
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
390
|
+
|
|
391
|
+
let interceptorPromise = authenticationPromise;
|
|
392
|
+
for (const interceptor of this.interceptors) {
|
|
393
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return interceptorPromise.then(() => {
|
|
397
|
+
return new Promise<GetGroupContactDetails>((resolve, reject) => {
|
|
398
|
+
axios.request(localVarRequestOptions)
|
|
399
|
+
.then((response) => {
|
|
400
|
+
handleSuccessfulResponse<GetGroupContactDetails>(
|
|
401
|
+
resolve,
|
|
402
|
+
reject,
|
|
403
|
+
response,
|
|
404
|
+
"GetGroupContactDetails",
|
|
405
|
+
);
|
|
406
|
+
}, (error: AxiosError) => {
|
|
407
|
+
if (error.response == null) {
|
|
408
|
+
reject(error);
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (handleErrorCodeResponse(
|
|
413
|
+
reject,
|
|
414
|
+
error.response,
|
|
415
|
+
200,
|
|
416
|
+
"GetGroupContactDetails",
|
|
417
|
+
)) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (handleErrorCodeResponse(
|
|
421
|
+
reject,
|
|
422
|
+
error.response,
|
|
423
|
+
401,
|
|
424
|
+
"ErrorResult",
|
|
425
|
+
)) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (handleErrorCodeResponse(
|
|
429
|
+
reject,
|
|
430
|
+
error.response,
|
|
431
|
+
403,
|
|
432
|
+
"ErrorResult",
|
|
433
|
+
)) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
reject(error);
|
|
439
|
+
});
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
*
|
|
445
|
+
* @summary List Group Contacts.
|
|
446
|
+
* @param page Page index specified in get user group contact list request. Default value is 1.
|
|
447
|
+
* @param pageSize Page size specified in get user group contact list request. Default value is 10.
|
|
448
|
+
* @param searchKey Group Contacts can be listed by the search based on the Name or Email
|
|
449
|
+
* @param contactType Group Contact type whether the contact is my contacts or all contacts. Default value is AllContacts.
|
|
450
|
+
* @param directories Group Contacts can be listed by the search based on the directories
|
|
451
|
+
* @param options
|
|
452
|
+
*/
|
|
453
|
+
public async groupContactList (page: number, pageSize?: number, searchKey?: string, contactType?: 'MyContacts' | 'AllContacts', directories?: Array<string>, options: optionsI = {headers: {}}) : Promise<GroupContactsList> {
|
|
454
|
+
const localVarPath = this.basePath + '/v1/contactGroups/list';
|
|
455
|
+
let localVarQueryParameters: any = {};
|
|
456
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
457
|
+
const produces = ['application/json'];
|
|
458
|
+
// give precedence to 'application/json'
|
|
459
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
460
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
461
|
+
} else {
|
|
462
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
463
|
+
}
|
|
464
|
+
let localVarFormParams: any = {};
|
|
465
|
+
let localVarBodyParams: any = undefined;
|
|
466
|
+
|
|
467
|
+
// verify required parameter 'page' is not null or undefined
|
|
468
|
+
if (page === null || page === undefined) {
|
|
469
|
+
throw new Error('Required parameter page was null or undefined when calling groupContactList.');
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (pageSize !== undefined) {
|
|
473
|
+
localVarQueryParameters['PageSize'] = ObjectSerializer.serialize(pageSize, "number");
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (page !== undefined) {
|
|
477
|
+
localVarQueryParameters['Page'] = ObjectSerializer.serialize(page, "number");
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (searchKey !== undefined) {
|
|
481
|
+
localVarQueryParameters['SearchKey'] = ObjectSerializer.serialize(searchKey, "string");
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if (contactType !== undefined) {
|
|
485
|
+
localVarQueryParameters['ContactType'] = ObjectSerializer.serialize(contactType, "'MyContacts' | 'AllContacts'");
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (directories !== undefined) {
|
|
489
|
+
localVarQueryParameters['Directories'] = ObjectSerializer.serialize(directories, "Array<string>");
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
493
|
+
|
|
494
|
+
let localVarUseFormData = false;
|
|
495
|
+
|
|
496
|
+
let data = {};
|
|
497
|
+
if (localVarUseFormData) {
|
|
498
|
+
const formData = toFormData(localVarFormParams);
|
|
499
|
+
data = formData;
|
|
500
|
+
localVarHeaderParams = {
|
|
501
|
+
...localVarHeaderParams,
|
|
502
|
+
...formData.getHeaders(),
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
507
|
+
method: 'GET',
|
|
508
|
+
params: localVarQueryParameters,
|
|
509
|
+
headers: localVarHeaderParams,
|
|
510
|
+
url: localVarPath,
|
|
511
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
512
|
+
maxContentLength: Infinity,
|
|
513
|
+
maxBodyLength: Infinity,
|
|
514
|
+
responseType: "json",
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
518
|
+
localVarRequestOptions.data = data;
|
|
519
|
+
}
|
|
520
|
+
let authenticationPromise = Promise.resolve();
|
|
521
|
+
|
|
522
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
523
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
524
|
+
}
|
|
525
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
526
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
527
|
+
}
|
|
528
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
529
|
+
|
|
530
|
+
let interceptorPromise = authenticationPromise;
|
|
531
|
+
for (const interceptor of this.interceptors) {
|
|
532
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
return interceptorPromise.then(() => {
|
|
536
|
+
return new Promise<GroupContactsList>((resolve, reject) => {
|
|
537
|
+
axios.request(localVarRequestOptions)
|
|
538
|
+
.then((response) => {
|
|
539
|
+
handleSuccessfulResponse<GroupContactsList>(
|
|
540
|
+
resolve,
|
|
541
|
+
reject,
|
|
542
|
+
response,
|
|
543
|
+
"GroupContactsList",
|
|
544
|
+
);
|
|
545
|
+
}, (error: AxiosError) => {
|
|
546
|
+
if (error.response == null) {
|
|
547
|
+
reject(error);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (handleErrorCodeResponse(
|
|
552
|
+
reject,
|
|
553
|
+
error.response,
|
|
554
|
+
200,
|
|
555
|
+
"GroupContactsList",
|
|
556
|
+
)) {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if (handleErrorCodeResponse(
|
|
560
|
+
reject,
|
|
561
|
+
error.response,
|
|
562
|
+
401,
|
|
563
|
+
"ErrorResult",
|
|
564
|
+
)) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
reject(error);
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
*
|
|
576
|
+
* @summary Update the Group Contact.
|
|
577
|
+
* @param groupId The group contact ID.
|
|
578
|
+
* @param updateGroupContact The group contact details.
|
|
579
|
+
* @param options
|
|
580
|
+
*/
|
|
581
|
+
public async updateGroupContact (groupId: string, updateGroupContact: UpdateGroupContact, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
582
|
+
updateGroupContact = deserializeIfNeeded(updateGroupContact, "UpdateGroupContact");
|
|
583
|
+
const localVarPath = this.basePath + '/v1/contactGroups/update';
|
|
584
|
+
let localVarQueryParameters: any = {};
|
|
585
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
586
|
+
const produces = ['application/json'];
|
|
587
|
+
// give precedence to 'application/json'
|
|
588
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
589
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
590
|
+
} else {
|
|
591
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
592
|
+
}
|
|
593
|
+
let localVarFormParams: any = {};
|
|
594
|
+
let localVarBodyParams: any = undefined;
|
|
595
|
+
|
|
596
|
+
// verify required parameter 'groupId' is not null or undefined
|
|
597
|
+
if (groupId === null || groupId === undefined) {
|
|
598
|
+
throw new Error('Required parameter groupId was null or undefined when calling updateGroupContact.');
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// verify required parameter 'updateGroupContact' is not null or undefined
|
|
602
|
+
if (updateGroupContact === null || updateGroupContact === undefined) {
|
|
603
|
+
throw new Error('Required parameter updateGroupContact was null or undefined when calling updateGroupContact.');
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
if (groupId !== undefined) {
|
|
607
|
+
localVarQueryParameters['groupId'] = ObjectSerializer.serialize(groupId, "string");
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
611
|
+
|
|
612
|
+
let localVarUseFormData = false;
|
|
613
|
+
|
|
614
|
+
const result = generateFormData(updateGroupContact, UpdateGroupContact);
|
|
615
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
616
|
+
|
|
617
|
+
let data = {};
|
|
618
|
+
if (localVarUseFormData) {
|
|
619
|
+
const formData = toFormData(result.data);
|
|
620
|
+
data = formData;
|
|
621
|
+
localVarHeaderParams = {
|
|
622
|
+
...localVarHeaderParams,
|
|
623
|
+
...formData.getHeaders(),
|
|
624
|
+
};
|
|
625
|
+
} else {
|
|
626
|
+
data = ObjectSerializer.serialize(
|
|
627
|
+
updateGroupContact,
|
|
628
|
+
"UpdateGroupContact"
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
633
|
+
method: 'PUT',
|
|
634
|
+
params: localVarQueryParameters,
|
|
635
|
+
headers: localVarHeaderParams,
|
|
636
|
+
url: localVarPath,
|
|
637
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
638
|
+
maxContentLength: Infinity,
|
|
639
|
+
maxBodyLength: Infinity,
|
|
640
|
+
responseType: "json",
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
644
|
+
localVarRequestOptions.data = data;
|
|
645
|
+
}
|
|
646
|
+
let authenticationPromise = Promise.resolve();
|
|
647
|
+
|
|
648
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
649
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
650
|
+
}
|
|
651
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
652
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
653
|
+
}
|
|
654
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
655
|
+
|
|
656
|
+
let interceptorPromise = authenticationPromise;
|
|
657
|
+
for (const interceptor of this.interceptors) {
|
|
658
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return interceptorPromise.then(() => {
|
|
662
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
663
|
+
axios.request(localVarRequestOptions)
|
|
664
|
+
.then((response) => {
|
|
665
|
+
handleSuccessfulResponse(
|
|
666
|
+
resolve,
|
|
667
|
+
reject,
|
|
668
|
+
response,
|
|
669
|
+
|
|
670
|
+
);
|
|
671
|
+
}, (error: AxiosError) => {
|
|
672
|
+
if (error.response == null) {
|
|
673
|
+
reject(error);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (handleErrorCodeResponse(
|
|
678
|
+
reject,
|
|
679
|
+
error.response,
|
|
680
|
+
401,
|
|
681
|
+
"ErrorResult",
|
|
682
|
+
)) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
if (handleErrorCodeResponse(
|
|
686
|
+
reject,
|
|
687
|
+
error.response,
|
|
688
|
+
400,
|
|
689
|
+
"ErrorResult",
|
|
690
|
+
)) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
reject(error);
|
|
696
|
+
});
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
function deserializeIfNeeded<T> (obj: T, classname: string): T {
|
|
703
|
+
if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
|
|
704
|
+
return ObjectSerializer.deserialize(obj, classname);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
return obj;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
type AxiosResolve<T> = (
|
|
711
|
+
value: (T | PromiseLike<T>),
|
|
712
|
+
) => void
|
|
713
|
+
|
|
714
|
+
type AxiosReject = (reason?: any) => void;
|
|
715
|
+
|
|
716
|
+
function handleSuccessfulResponse<T>(
|
|
717
|
+
resolve: AxiosResolve<T>,
|
|
718
|
+
reject: AxiosReject,
|
|
719
|
+
response: AxiosResponse,
|
|
720
|
+
returnType?: string,
|
|
721
|
+
) {
|
|
722
|
+
let body = response.data;
|
|
723
|
+
|
|
724
|
+
if (
|
|
725
|
+
response.status &&
|
|
726
|
+
response.status >= 200 &&
|
|
727
|
+
response.status <= 299
|
|
728
|
+
) {
|
|
729
|
+
if (returnType) {
|
|
730
|
+
body = ObjectSerializer.deserialize(body, returnType);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
resolve(body);
|
|
734
|
+
} else {
|
|
735
|
+
reject(new HttpError(response, body, response.status));
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function handleErrorCodeResponse(
|
|
740
|
+
reject: AxiosReject,
|
|
741
|
+
response: AxiosResponse,
|
|
742
|
+
code: number,
|
|
743
|
+
returnType: string
|
|
744
|
+
): boolean {
|
|
745
|
+
if (response.status !== code) {
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
let body = response.data;
|
|
750
|
+
if(code === 401) {
|
|
751
|
+
body = "Unauthorized request (401): Invalid authentication.";
|
|
752
|
+
}
|
|
753
|
+
reject(new HttpError(response, body, response.status));
|
|
754
|
+
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
function handleErrorRangeResponse(
|
|
759
|
+
reject: AxiosReject,
|
|
760
|
+
response: AxiosResponse,
|
|
761
|
+
code: string,
|
|
762
|
+
returnType: string
|
|
763
|
+
): boolean {
|
|
764
|
+
let rangeCodeLeft = Number(code[0] + "00");
|
|
765
|
+
let rangeCodeRight = Number(code[0] + "99");
|
|
766
|
+
|
|
767
|
+
if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
|
|
768
|
+
const body = ObjectSerializer.deserialize(
|
|
769
|
+
response.data,
|
|
770
|
+
returnType,
|
|
771
|
+
);
|
|
772
|
+
|
|
773
|
+
reject(new HttpError(response, body, response.status));
|
|
774
|
+
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return false;
|
|
779
|
+
}
|