postboost 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +72 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/api/accountsApi.ts +247 -0
- package/api/apis.ts +28 -0
- package/api/mediaApi.ts +1007 -0
- package/api/postsApi.ts +827 -0
- package/api/receiptsApi.ts +541 -0
- package/api/subscriptionsApi.ts +856 -0
- package/api/tagsApi.ts +492 -0
- package/api/usersApi.ts +537 -0
- package/api/workspacesApi.ts +784 -0
- package/api.ts +3 -0
- package/git_push.sh +57 -0
- package/model/account.ts +94 -0
- package/model/addGenericSubscriptionRequest.ts +43 -0
- package/model/changeSubscriptionPlanRequest.ts +55 -0
- package/model/checkoutSubscription200Response.ts +31 -0
- package/model/checkoutSubscriptionRequest.ts +49 -0
- package/model/deleteMediaBulkRequest.ts +34 -0
- package/model/deleteMode.ts +22 -0
- package/model/deletePostRequest.ts +40 -0
- package/model/deletePostsBulkRequest.ts +52 -0
- package/model/deleteReceiptsBulkRequest.ts +31 -0
- package/model/deleteResult.ts +43 -0
- package/model/deleteUser400Response.ts +37 -0
- package/model/deleteUsersBulkRequest.ts +31 -0
- package/model/deleteWorkspacesBulkRequest.ts +31 -0
- package/model/getRemoteUploadStatus200Response.ts +49 -0
- package/model/initiateChunkedUpload200Response.ts +43 -0
- package/model/initiateChunkedUploadRequest.ts +46 -0
- package/model/initiateRemoteUpload200Response.ts +94 -0
- package/model/initiateRemoteUpload200ResponseOneOf.ts +31 -0
- package/model/initiateRemoteUploadRequest.ts +40 -0
- package/model/listAccounts200Response.ts +32 -0
- package/model/listMedia200Response.ts +46 -0
- package/model/listPosts200Response.ts +46 -0
- package/model/listReceipts200Response.ts +46 -0
- package/model/listTags200Response.ts +32 -0
- package/model/listUsers200Response.ts +46 -0
- package/model/listWorkspaces200Response.ts +46 -0
- package/model/media.ts +86 -0
- package/model/models.ts +443 -0
- package/model/paginationMeta.ts +39 -0
- package/model/paginationMetaLinks.ts +49 -0
- package/model/paginationMetaMeta.ts +61 -0
- package/model/post.ts +91 -0
- package/model/postContent.ts +55 -0
- package/model/postInput.ts +98 -0
- package/model/postStatus.ts +19 -0
- package/model/postVersion.ts +59 -0
- package/model/receipt.ts +85 -0
- package/model/receiptInput.ts +79 -0
- package/model/receiptUpdateInput.ts +73 -0
- package/model/removeUserFromWorkspaceRequest.ts +31 -0
- package/model/schedulePostRequest.ts +31 -0
- package/model/scheduleResult.ts +37 -0
- package/model/subscription.ts +76 -0
- package/model/subscriptionInput.ts +55 -0
- package/model/subscriptionStatus.ts +22 -0
- package/model/subscriptionUpdateInput.ts +58 -0
- package/model/tag.ts +49 -0
- package/model/tagInput.ts +37 -0
- package/model/updateMediaRequest.ts +34 -0
- package/model/uploadChunk200Response.ts +34 -0
- package/model/user.ts +61 -0
- package/model/userInput.ts +55 -0
- package/model/userUpdateInput.ts +58 -0
- package/model/workspace.ts +69 -0
- package/model/workspaceInput.ts +56 -0
- package/model/workspaceUserInput.ts +56 -0
- package/package.json +28 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostBoost API
|
|
3
|
+
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 8+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: hi@postboost.co
|
|
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
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AddGenericSubscriptionRequest } from '../model/addGenericSubscriptionRequest';
|
|
19
|
+
import { ChangeSubscriptionPlanRequest } from '../model/changeSubscriptionPlanRequest';
|
|
20
|
+
import { CheckoutSubscription200Response } from '../model/checkoutSubscription200Response';
|
|
21
|
+
import { CheckoutSubscriptionRequest } from '../model/checkoutSubscriptionRequest';
|
|
22
|
+
import { Subscription } from '../model/subscription';
|
|
23
|
+
import { SubscriptionInput } from '../model/subscriptionInput';
|
|
24
|
+
import { SubscriptionUpdateInput } from '../model/subscriptionUpdateInput';
|
|
25
|
+
|
|
26
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
27
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
28
|
+
|
|
29
|
+
import { HttpError, RequestFile } from './apis';
|
|
30
|
+
|
|
31
|
+
let defaultBasePath = 'https://postboost.co/app/api';
|
|
32
|
+
|
|
33
|
+
// ===============================================
|
|
34
|
+
// This file is autogenerated - Please do not edit
|
|
35
|
+
// ===============================================
|
|
36
|
+
|
|
37
|
+
export enum SubscriptionsApiApiKeys {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class SubscriptionsApi {
|
|
41
|
+
protected _basePath = defaultBasePath;
|
|
42
|
+
protected _defaultHeaders : any = {};
|
|
43
|
+
protected _useQuerystring : boolean = false;
|
|
44
|
+
|
|
45
|
+
protected authentications = {
|
|
46
|
+
'default': <Authentication>new VoidAuth(),
|
|
47
|
+
'bearerAuth': new HttpBearerAuth(),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected interceptors: Interceptor[] = [];
|
|
51
|
+
|
|
52
|
+
constructor(basePath?: string);
|
|
53
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
54
|
+
if (password) {
|
|
55
|
+
if (basePath) {
|
|
56
|
+
this.basePath = basePath;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
if (basePathOrUsername) {
|
|
60
|
+
this.basePath = basePathOrUsername
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
set useQuerystring(value: boolean) {
|
|
66
|
+
this._useQuerystring = value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set basePath(basePath: string) {
|
|
70
|
+
this._basePath = basePath;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
74
|
+
this._defaultHeaders = defaultHeaders;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get defaultHeaders() {
|
|
78
|
+
return this._defaultHeaders;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get basePath() {
|
|
82
|
+
return this._basePath;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
86
|
+
this.authentications.default = auth;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public setApiKey(key: SubscriptionsApiApiKeys, value: string) {
|
|
90
|
+
(this.authentications as any)[SubscriptionsApiApiKeys[key]].apiKey = value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
94
|
+
this.authentications.bearerAuth.accessToken = accessToken;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
98
|
+
this.interceptors.push(interceptor);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @summary Add generic subscription
|
|
104
|
+
* @param workspaceUuid UUID of the workspace.
|
|
105
|
+
* @param addGenericSubscriptionRequest
|
|
106
|
+
*/
|
|
107
|
+
public async addGenericSubscription (workspaceUuid: string, addGenericSubscriptionRequest: AddGenericSubscriptionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
108
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/generic'
|
|
109
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
110
|
+
let localVarQueryParameters: any = {};
|
|
111
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
112
|
+
const produces = ['application/json'];
|
|
113
|
+
// give precedence to 'application/json'
|
|
114
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
115
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
116
|
+
} else {
|
|
117
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
118
|
+
}
|
|
119
|
+
let localVarFormParams: any = {};
|
|
120
|
+
|
|
121
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
122
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
123
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling addGenericSubscription.');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// verify required parameter 'addGenericSubscriptionRequest' is not null or undefined
|
|
127
|
+
if (addGenericSubscriptionRequest === null || addGenericSubscriptionRequest === undefined) {
|
|
128
|
+
throw new Error('Required parameter addGenericSubscriptionRequest was null or undefined when calling addGenericSubscription.');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
132
|
+
|
|
133
|
+
let localVarUseFormData = false;
|
|
134
|
+
|
|
135
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
qs: localVarQueryParameters,
|
|
138
|
+
headers: localVarHeaderParams,
|
|
139
|
+
uri: localVarPath,
|
|
140
|
+
useQuerystring: this._useQuerystring,
|
|
141
|
+
json: true,
|
|
142
|
+
body: ObjectSerializer.serialize(addGenericSubscriptionRequest, "AddGenericSubscriptionRequest")
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
let authenticationPromise = Promise.resolve();
|
|
146
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
147
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
148
|
+
}
|
|
149
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
150
|
+
|
|
151
|
+
let interceptorPromise = authenticationPromise;
|
|
152
|
+
for (const interceptor of this.interceptors) {
|
|
153
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return interceptorPromise.then(() => {
|
|
157
|
+
if (Object.keys(localVarFormParams).length) {
|
|
158
|
+
if (localVarUseFormData) {
|
|
159
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
160
|
+
} else {
|
|
161
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
165
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
166
|
+
if (error) {
|
|
167
|
+
reject(error);
|
|
168
|
+
} else {
|
|
169
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
170
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
171
|
+
resolve({ response: response, body: body });
|
|
172
|
+
} else {
|
|
173
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
*
|
|
182
|
+
* @summary Cancel subscription
|
|
183
|
+
* @param workspaceUuid UUID of the workspace.
|
|
184
|
+
*/
|
|
185
|
+
public async cancelSubscription (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
186
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/cancel'
|
|
187
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
188
|
+
let localVarQueryParameters: any = {};
|
|
189
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
190
|
+
const produces = ['application/json'];
|
|
191
|
+
// give precedence to 'application/json'
|
|
192
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
193
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
194
|
+
} else {
|
|
195
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
196
|
+
}
|
|
197
|
+
let localVarFormParams: any = {};
|
|
198
|
+
|
|
199
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
200
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
201
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling cancelSubscription.');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
205
|
+
|
|
206
|
+
let localVarUseFormData = false;
|
|
207
|
+
|
|
208
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
209
|
+
method: 'POST',
|
|
210
|
+
qs: localVarQueryParameters,
|
|
211
|
+
headers: localVarHeaderParams,
|
|
212
|
+
uri: localVarPath,
|
|
213
|
+
useQuerystring: this._useQuerystring,
|
|
214
|
+
json: true,
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
let authenticationPromise = Promise.resolve();
|
|
218
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
219
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
220
|
+
}
|
|
221
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
222
|
+
|
|
223
|
+
let interceptorPromise = authenticationPromise;
|
|
224
|
+
for (const interceptor of this.interceptors) {
|
|
225
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return interceptorPromise.then(() => {
|
|
229
|
+
if (Object.keys(localVarFormParams).length) {
|
|
230
|
+
if (localVarUseFormData) {
|
|
231
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
232
|
+
} else {
|
|
233
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
237
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
238
|
+
if (error) {
|
|
239
|
+
reject(error);
|
|
240
|
+
} else {
|
|
241
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
242
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
243
|
+
resolve({ response: response, body: body });
|
|
244
|
+
} else {
|
|
245
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
* @summary Change subscription plan
|
|
255
|
+
* @param workspaceUuid UUID of the workspace.
|
|
256
|
+
* @param changeSubscriptionPlanRequest
|
|
257
|
+
*/
|
|
258
|
+
public async changeSubscriptionPlan (workspaceUuid: string, changeSubscriptionPlanRequest: ChangeSubscriptionPlanRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
259
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/change-plan'
|
|
260
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
261
|
+
let localVarQueryParameters: any = {};
|
|
262
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
263
|
+
const produces = ['application/json'];
|
|
264
|
+
// give precedence to 'application/json'
|
|
265
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
266
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
267
|
+
} else {
|
|
268
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
269
|
+
}
|
|
270
|
+
let localVarFormParams: any = {};
|
|
271
|
+
|
|
272
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
273
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
274
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling changeSubscriptionPlan.');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// verify required parameter 'changeSubscriptionPlanRequest' is not null or undefined
|
|
278
|
+
if (changeSubscriptionPlanRequest === null || changeSubscriptionPlanRequest === undefined) {
|
|
279
|
+
throw new Error('Required parameter changeSubscriptionPlanRequest was null or undefined when calling changeSubscriptionPlan.');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
283
|
+
|
|
284
|
+
let localVarUseFormData = false;
|
|
285
|
+
|
|
286
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
287
|
+
method: 'PUT',
|
|
288
|
+
qs: localVarQueryParameters,
|
|
289
|
+
headers: localVarHeaderParams,
|
|
290
|
+
uri: localVarPath,
|
|
291
|
+
useQuerystring: this._useQuerystring,
|
|
292
|
+
json: true,
|
|
293
|
+
body: ObjectSerializer.serialize(changeSubscriptionPlanRequest, "ChangeSubscriptionPlanRequest")
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
let authenticationPromise = Promise.resolve();
|
|
297
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
298
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
299
|
+
}
|
|
300
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
301
|
+
|
|
302
|
+
let interceptorPromise = authenticationPromise;
|
|
303
|
+
for (const interceptor of this.interceptors) {
|
|
304
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return interceptorPromise.then(() => {
|
|
308
|
+
if (Object.keys(localVarFormParams).length) {
|
|
309
|
+
if (localVarUseFormData) {
|
|
310
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
311
|
+
} else {
|
|
312
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
316
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
317
|
+
if (error) {
|
|
318
|
+
reject(error);
|
|
319
|
+
} else {
|
|
320
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
321
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
322
|
+
resolve({ response: response, body: body });
|
|
323
|
+
} else {
|
|
324
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Returns a Stripe Checkout URL for a new subscription.
|
|
333
|
+
* @summary New subscription checkout
|
|
334
|
+
* @param workspaceUuid UUID of the workspace.
|
|
335
|
+
* @param checkoutSubscriptionRequest
|
|
336
|
+
*/
|
|
337
|
+
public async checkoutSubscription (workspaceUuid: string, checkoutSubscriptionRequest: CheckoutSubscriptionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CheckoutSubscription200Response; }> {
|
|
338
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/new'
|
|
339
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
340
|
+
let localVarQueryParameters: any = {};
|
|
341
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
342
|
+
const produces = ['application/json'];
|
|
343
|
+
// give precedence to 'application/json'
|
|
344
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
345
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
346
|
+
} else {
|
|
347
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
348
|
+
}
|
|
349
|
+
let localVarFormParams: any = {};
|
|
350
|
+
|
|
351
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
352
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
353
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling checkoutSubscription.');
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// verify required parameter 'checkoutSubscriptionRequest' is not null or undefined
|
|
357
|
+
if (checkoutSubscriptionRequest === null || checkoutSubscriptionRequest === undefined) {
|
|
358
|
+
throw new Error('Required parameter checkoutSubscriptionRequest was null or undefined when calling checkoutSubscription.');
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
362
|
+
|
|
363
|
+
let localVarUseFormData = false;
|
|
364
|
+
|
|
365
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
366
|
+
method: 'POST',
|
|
367
|
+
qs: localVarQueryParameters,
|
|
368
|
+
headers: localVarHeaderParams,
|
|
369
|
+
uri: localVarPath,
|
|
370
|
+
useQuerystring: this._useQuerystring,
|
|
371
|
+
json: true,
|
|
372
|
+
body: ObjectSerializer.serialize(checkoutSubscriptionRequest, "CheckoutSubscriptionRequest")
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
let authenticationPromise = Promise.resolve();
|
|
376
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
377
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
378
|
+
}
|
|
379
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
380
|
+
|
|
381
|
+
let interceptorPromise = authenticationPromise;
|
|
382
|
+
for (const interceptor of this.interceptors) {
|
|
383
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return interceptorPromise.then(() => {
|
|
387
|
+
if (Object.keys(localVarFormParams).length) {
|
|
388
|
+
if (localVarUseFormData) {
|
|
389
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
390
|
+
} else {
|
|
391
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return new Promise<{ response: http.IncomingMessage; body: CheckoutSubscription200Response; }>((resolve, reject) => {
|
|
395
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
396
|
+
if (error) {
|
|
397
|
+
reject(error);
|
|
398
|
+
} else {
|
|
399
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
400
|
+
body = ObjectSerializer.deserialize(body, "CheckoutSubscription200Response");
|
|
401
|
+
resolve({ response: response, body: body });
|
|
402
|
+
} else {
|
|
403
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
*
|
|
412
|
+
* @summary Create subscription
|
|
413
|
+
* @param workspaceUuid UUID of the workspace.
|
|
414
|
+
* @param subscriptionInput
|
|
415
|
+
*/
|
|
416
|
+
public async createSubscription (workspaceUuid: string, subscriptionInput: SubscriptionInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
417
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription'
|
|
418
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
419
|
+
let localVarQueryParameters: any = {};
|
|
420
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
421
|
+
const produces = ['application/json'];
|
|
422
|
+
// give precedence to 'application/json'
|
|
423
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
424
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
425
|
+
} else {
|
|
426
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
427
|
+
}
|
|
428
|
+
let localVarFormParams: any = {};
|
|
429
|
+
|
|
430
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
431
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
432
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createSubscription.');
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// verify required parameter 'subscriptionInput' is not null or undefined
|
|
436
|
+
if (subscriptionInput === null || subscriptionInput === undefined) {
|
|
437
|
+
throw new Error('Required parameter subscriptionInput was null or undefined when calling createSubscription.');
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
441
|
+
|
|
442
|
+
let localVarUseFormData = false;
|
|
443
|
+
|
|
444
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
445
|
+
method: 'POST',
|
|
446
|
+
qs: localVarQueryParameters,
|
|
447
|
+
headers: localVarHeaderParams,
|
|
448
|
+
uri: localVarPath,
|
|
449
|
+
useQuerystring: this._useQuerystring,
|
|
450
|
+
json: true,
|
|
451
|
+
body: ObjectSerializer.serialize(subscriptionInput, "SubscriptionInput")
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
let authenticationPromise = Promise.resolve();
|
|
455
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
456
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
457
|
+
}
|
|
458
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
459
|
+
|
|
460
|
+
let interceptorPromise = authenticationPromise;
|
|
461
|
+
for (const interceptor of this.interceptors) {
|
|
462
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return interceptorPromise.then(() => {
|
|
466
|
+
if (Object.keys(localVarFormParams).length) {
|
|
467
|
+
if (localVarUseFormData) {
|
|
468
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
469
|
+
} else {
|
|
470
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
474
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
475
|
+
if (error) {
|
|
476
|
+
reject(error);
|
|
477
|
+
} else {
|
|
478
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
479
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
480
|
+
resolve({ response: response, body: body });
|
|
481
|
+
} else {
|
|
482
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
*
|
|
491
|
+
* @summary Delete subscription
|
|
492
|
+
* @param workspaceUuid UUID of the workspace.
|
|
493
|
+
*/
|
|
494
|
+
public async deleteSubscription (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
495
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription'
|
|
496
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
497
|
+
let localVarQueryParameters: any = {};
|
|
498
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
499
|
+
const produces = ['application/json'];
|
|
500
|
+
// give precedence to 'application/json'
|
|
501
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
502
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
503
|
+
} else {
|
|
504
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
505
|
+
}
|
|
506
|
+
let localVarFormParams: any = {};
|
|
507
|
+
|
|
508
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
509
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
510
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteSubscription.');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
514
|
+
|
|
515
|
+
let localVarUseFormData = false;
|
|
516
|
+
|
|
517
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
518
|
+
method: 'DELETE',
|
|
519
|
+
qs: localVarQueryParameters,
|
|
520
|
+
headers: localVarHeaderParams,
|
|
521
|
+
uri: localVarPath,
|
|
522
|
+
useQuerystring: this._useQuerystring,
|
|
523
|
+
json: true,
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
let authenticationPromise = Promise.resolve();
|
|
527
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
528
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
529
|
+
}
|
|
530
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
531
|
+
|
|
532
|
+
let interceptorPromise = authenticationPromise;
|
|
533
|
+
for (const interceptor of this.interceptors) {
|
|
534
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return interceptorPromise.then(() => {
|
|
538
|
+
if (Object.keys(localVarFormParams).length) {
|
|
539
|
+
if (localVarUseFormData) {
|
|
540
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
541
|
+
} else {
|
|
542
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
546
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
547
|
+
if (error) {
|
|
548
|
+
reject(error);
|
|
549
|
+
} else {
|
|
550
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
551
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
552
|
+
resolve({ response: response, body: body });
|
|
553
|
+
} else {
|
|
554
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
*
|
|
563
|
+
* @summary Get subscription
|
|
564
|
+
* @param workspaceUuid UUID of the workspace.
|
|
565
|
+
*/
|
|
566
|
+
public async getSubscription (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Subscription; }> {
|
|
567
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription'
|
|
568
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
569
|
+
let localVarQueryParameters: any = {};
|
|
570
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
571
|
+
const produces = ['application/json'];
|
|
572
|
+
// give precedence to 'application/json'
|
|
573
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
574
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
575
|
+
} else {
|
|
576
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
577
|
+
}
|
|
578
|
+
let localVarFormParams: any = {};
|
|
579
|
+
|
|
580
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
581
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
582
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getSubscription.');
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
586
|
+
|
|
587
|
+
let localVarUseFormData = false;
|
|
588
|
+
|
|
589
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
590
|
+
method: 'GET',
|
|
591
|
+
qs: localVarQueryParameters,
|
|
592
|
+
headers: localVarHeaderParams,
|
|
593
|
+
uri: localVarPath,
|
|
594
|
+
useQuerystring: this._useQuerystring,
|
|
595
|
+
json: true,
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
let authenticationPromise = Promise.resolve();
|
|
599
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
600
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
601
|
+
}
|
|
602
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
603
|
+
|
|
604
|
+
let interceptorPromise = authenticationPromise;
|
|
605
|
+
for (const interceptor of this.interceptors) {
|
|
606
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return interceptorPromise.then(() => {
|
|
610
|
+
if (Object.keys(localVarFormParams).length) {
|
|
611
|
+
if (localVarUseFormData) {
|
|
612
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
613
|
+
} else {
|
|
614
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return new Promise<{ response: http.IncomingMessage; body: Subscription; }>((resolve, reject) => {
|
|
618
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
619
|
+
if (error) {
|
|
620
|
+
reject(error);
|
|
621
|
+
} else {
|
|
622
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
623
|
+
body = ObjectSerializer.deserialize(body, "Subscription");
|
|
624
|
+
resolve({ response: response, body: body });
|
|
625
|
+
} else {
|
|
626
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
*
|
|
635
|
+
* @summary Remove generic subscription
|
|
636
|
+
* @param workspaceUuid UUID of the workspace.
|
|
637
|
+
*/
|
|
638
|
+
public async removeGenericSubscription (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
639
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/generic'
|
|
640
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
641
|
+
let localVarQueryParameters: any = {};
|
|
642
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
643
|
+
const produces = ['application/json'];
|
|
644
|
+
// give precedence to 'application/json'
|
|
645
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
646
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
647
|
+
} else {
|
|
648
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
649
|
+
}
|
|
650
|
+
let localVarFormParams: any = {};
|
|
651
|
+
|
|
652
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
653
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
654
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling removeGenericSubscription.');
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
658
|
+
|
|
659
|
+
let localVarUseFormData = false;
|
|
660
|
+
|
|
661
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
662
|
+
method: 'DELETE',
|
|
663
|
+
qs: localVarQueryParameters,
|
|
664
|
+
headers: localVarHeaderParams,
|
|
665
|
+
uri: localVarPath,
|
|
666
|
+
useQuerystring: this._useQuerystring,
|
|
667
|
+
json: true,
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
let authenticationPromise = Promise.resolve();
|
|
671
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
672
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
673
|
+
}
|
|
674
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
675
|
+
|
|
676
|
+
let interceptorPromise = authenticationPromise;
|
|
677
|
+
for (const interceptor of this.interceptors) {
|
|
678
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return interceptorPromise.then(() => {
|
|
682
|
+
if (Object.keys(localVarFormParams).length) {
|
|
683
|
+
if (localVarUseFormData) {
|
|
684
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
685
|
+
} else {
|
|
686
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
690
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
691
|
+
if (error) {
|
|
692
|
+
reject(error);
|
|
693
|
+
} else {
|
|
694
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
695
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
696
|
+
resolve({ response: response, body: body });
|
|
697
|
+
} else {
|
|
698
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
});
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
*
|
|
707
|
+
* @summary Resume subscription
|
|
708
|
+
* @param workspaceUuid UUID of the workspace.
|
|
709
|
+
*/
|
|
710
|
+
public async resumeSubscription (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
711
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription/resume'
|
|
712
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
713
|
+
let localVarQueryParameters: any = {};
|
|
714
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
715
|
+
const produces = ['application/json'];
|
|
716
|
+
// give precedence to 'application/json'
|
|
717
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
718
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
719
|
+
} else {
|
|
720
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
721
|
+
}
|
|
722
|
+
let localVarFormParams: any = {};
|
|
723
|
+
|
|
724
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
725
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
726
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling resumeSubscription.');
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
730
|
+
|
|
731
|
+
let localVarUseFormData = false;
|
|
732
|
+
|
|
733
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
734
|
+
method: 'POST',
|
|
735
|
+
qs: localVarQueryParameters,
|
|
736
|
+
headers: localVarHeaderParams,
|
|
737
|
+
uri: localVarPath,
|
|
738
|
+
useQuerystring: this._useQuerystring,
|
|
739
|
+
json: true,
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
let authenticationPromise = Promise.resolve();
|
|
743
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
744
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
745
|
+
}
|
|
746
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
747
|
+
|
|
748
|
+
let interceptorPromise = authenticationPromise;
|
|
749
|
+
for (const interceptor of this.interceptors) {
|
|
750
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return interceptorPromise.then(() => {
|
|
754
|
+
if (Object.keys(localVarFormParams).length) {
|
|
755
|
+
if (localVarUseFormData) {
|
|
756
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
757
|
+
} else {
|
|
758
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
762
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
763
|
+
if (error) {
|
|
764
|
+
reject(error);
|
|
765
|
+
} else {
|
|
766
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
767
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
768
|
+
resolve({ response: response, body: body });
|
|
769
|
+
} else {
|
|
770
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
});
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
*
|
|
779
|
+
* @summary Update subscription
|
|
780
|
+
* @param workspaceUuid UUID of the workspace.
|
|
781
|
+
* @param subscriptionUpdateInput
|
|
782
|
+
*/
|
|
783
|
+
public async updateSubscription (workspaceUuid: string, subscriptionUpdateInput: SubscriptionUpdateInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
784
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/subscription'
|
|
785
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
786
|
+
let localVarQueryParameters: any = {};
|
|
787
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
788
|
+
const produces = ['application/json'];
|
|
789
|
+
// give precedence to 'application/json'
|
|
790
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
791
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
792
|
+
} else {
|
|
793
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
794
|
+
}
|
|
795
|
+
let localVarFormParams: any = {};
|
|
796
|
+
|
|
797
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
798
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
799
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling updateSubscription.');
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// verify required parameter 'subscriptionUpdateInput' is not null or undefined
|
|
803
|
+
if (subscriptionUpdateInput === null || subscriptionUpdateInput === undefined) {
|
|
804
|
+
throw new Error('Required parameter subscriptionUpdateInput was null or undefined when calling updateSubscription.');
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
808
|
+
|
|
809
|
+
let localVarUseFormData = false;
|
|
810
|
+
|
|
811
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
812
|
+
method: 'PUT',
|
|
813
|
+
qs: localVarQueryParameters,
|
|
814
|
+
headers: localVarHeaderParams,
|
|
815
|
+
uri: localVarPath,
|
|
816
|
+
useQuerystring: this._useQuerystring,
|
|
817
|
+
json: true,
|
|
818
|
+
body: ObjectSerializer.serialize(subscriptionUpdateInput, "SubscriptionUpdateInput")
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
let authenticationPromise = Promise.resolve();
|
|
822
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
823
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
824
|
+
}
|
|
825
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
826
|
+
|
|
827
|
+
let interceptorPromise = authenticationPromise;
|
|
828
|
+
for (const interceptor of this.interceptors) {
|
|
829
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
return interceptorPromise.then(() => {
|
|
833
|
+
if (Object.keys(localVarFormParams).length) {
|
|
834
|
+
if (localVarUseFormData) {
|
|
835
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
836
|
+
} else {
|
|
837
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
841
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
842
|
+
if (error) {
|
|
843
|
+
reject(error);
|
|
844
|
+
} else {
|
|
845
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
846
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
847
|
+
resolve({ response: response, body: body });
|
|
848
|
+
} else {
|
|
849
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
});
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
}
|