@onesignal/node-onesignal 5.2.0-beta1 → 5.3.0-beta1
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/DefaultApi.md +1547 -431
- package/apis/DefaultApi.ts +1492 -89
- package/dist/apis/DefaultApi.d.ts +40 -0
- package/dist/apis/DefaultApi.js +1363 -100
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/models/ApiKeyToken.d.ts +23 -0
- package/dist/models/ApiKeyToken.js +52 -0
- package/dist/models/ApiKeyToken.js.map +1 -0
- package/dist/models/ApiKeyTokensListResponse.d.ts +18 -0
- package/dist/models/ApiKeyTokensListResponse.js +22 -0
- package/dist/models/ApiKeyTokensListResponse.js.map +1 -0
- package/dist/models/CopyTemplateRequest.d.ts +17 -0
- package/dist/models/CopyTemplateRequest.js +22 -0
- package/dist/models/CopyTemplateRequest.js.map +1 -0
- package/dist/models/CreateApiKeyRequest.d.ts +20 -0
- package/dist/models/CreateApiKeyRequest.js +34 -0
- package/dist/models/CreateApiKeyRequest.js.map +1 -0
- package/dist/models/CreateApiKeyResponse.d.ts +18 -0
- package/dist/models/CreateApiKeyResponse.js +28 -0
- package/dist/models/CreateApiKeyResponse.js.map +1 -0
- package/dist/models/CreateTemplateRequest.d.ts +25 -0
- package/dist/models/CreateTemplateRequest.js +64 -0
- package/dist/models/CreateTemplateRequest.js.map +1 -0
- package/dist/models/CustomEvent.d.ts +23 -0
- package/dist/models/CustomEvent.js +46 -0
- package/dist/models/CustomEvent.js.map +1 -0
- package/dist/models/CustomEventsRequest.d.ts +18 -0
- package/dist/models/CustomEventsRequest.js +22 -0
- package/dist/models/CustomEventsRequest.js.map +1 -0
- package/dist/models/NotificationWithMeta.d.ts +1 -0
- package/dist/models/NotificationWithMeta.js +6 -0
- package/dist/models/NotificationWithMeta.js.map +1 -1
- package/dist/models/NotificationWithMetaAllOf.d.ts +1 -0
- package/dist/models/NotificationWithMetaAllOf.js +6 -0
- package/dist/models/NotificationWithMetaAllOf.js.map +1 -1
- package/dist/models/ObjectSerializer.d.ts +14 -0
- package/dist/models/ObjectSerializer.js +47 -0
- package/dist/models/ObjectSerializer.js.map +1 -1
- package/dist/models/StartLiveActivityRequest.d.ts +37 -0
- package/dist/models/StartLiveActivityRequest.js +112 -0
- package/dist/models/StartLiveActivityRequest.js.map +1 -0
- package/dist/models/StartLiveActivitySuccessResponse.d.ts +17 -0
- package/dist/models/StartLiveActivitySuccessResponse.js +22 -0
- package/dist/models/StartLiveActivitySuccessResponse.js.map +1 -0
- package/dist/models/TemplateResource.d.ts +25 -0
- package/dist/models/TemplateResource.js +52 -0
- package/dist/models/TemplateResource.js.map +1 -0
- package/dist/models/TemplatesListResponse.d.ts +18 -0
- package/dist/models/TemplatesListResponse.js +22 -0
- package/dist/models/TemplatesListResponse.js.map +1 -0
- package/dist/models/UpdateApiKeyRequest.d.ts +20 -0
- package/dist/models/UpdateApiKeyRequest.js +34 -0
- package/dist/models/UpdateApiKeyRequest.js.map +1 -0
- package/dist/models/UpdateTemplateRequest.d.ts +24 -0
- package/dist/models/UpdateTemplateRequest.js +58 -0
- package/dist/models/UpdateTemplateRequest.js.map +1 -0
- package/dist/models/all.d.ts +14 -0
- package/dist/models/all.js +14 -0
- package/dist/models/all.js.map +1 -1
- package/dist/types/ObjectParamAPI.d.ts +88 -0
- package/dist/types/ObjectParamAPI.js +42 -0
- package/dist/types/ObjectParamAPI.js.map +1 -1
- package/dist/types/ObservableAPI.d.ts +26 -0
- package/dist/types/ObservableAPI.js +422 -86
- package/dist/types/ObservableAPI.js.map +1 -1
- package/dist/types/PromiseAPI.d.ts +26 -0
- package/dist/types/PromiseAPI.js +56 -0
- package/dist/types/PromiseAPI.js.map +1 -1
- package/models/ApiKeyToken.ts +69 -0
- package/models/ApiKeyTokensListResponse.ts +32 -0
- package/models/App.ts +1 -1
- package/models/BasicNotification.ts +1 -1
- package/models/BasicNotificationAllOf.ts +1 -1
- package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
- package/models/Button.ts +1 -1
- package/models/CopyTemplateRequest.ts +34 -0
- package/models/CreateApiKeyRequest.ts +48 -0
- package/models/CreateApiKeyResponse.ts +38 -0
- package/models/CreateNotificationSuccessResponse.ts +1 -1
- package/models/CreateSegmentConflictResponse.ts +1 -1
- package/models/CreateSegmentSuccessResponse.ts +1 -1
- package/models/CreateTemplateRequest.ts +102 -0
- package/models/CreateUserConflictResponse.ts +1 -1
- package/models/CreateUserConflictResponseErrorsInner.ts +1 -1
- package/models/CreateUserConflictResponseErrorsItemsMeta.ts +1 -1
- package/models/CustomEvent.ts +74 -0
- package/models/CustomEventsRequest.ts +32 -0
- package/models/DeliveryData.ts +1 -1
- package/models/ExportEventsSuccessResponse.ts +1 -1
- package/models/ExportSubscriptionsRequestBody.ts +1 -1
- package/models/ExportSubscriptionsSuccessResponse.ts +1 -1
- package/models/Filter.ts +1 -1
- package/models/FilterExpression.ts +1 -1
- package/models/GenericError.ts +1 -1
- package/models/GenericSuccessBoolResponse.ts +1 -1
- package/models/GetNotificationHistoryRequestBody.ts +1 -1
- package/models/GetSegmentsSuccessResponse.ts +1 -1
- package/models/LanguageStringMap.ts +1 -1
- package/models/Notification.ts +1 -1
- package/models/NotificationAllOf.ts +1 -1
- package/models/NotificationHistorySuccessResponse.ts +1 -1
- package/models/NotificationSlice.ts +1 -1
- package/models/NotificationTarget.ts +1 -1
- package/models/NotificationWithMeta.ts +11 -1
- package/models/NotificationWithMetaAllOf.ts +11 -1
- package/models/ObjectSerializer.ts +48 -1
- package/models/Operator.ts +1 -1
- package/models/OutcomeData.ts +1 -1
- package/models/OutcomesData.ts +1 -1
- package/models/PlatformDeliveryData.ts +1 -1
- package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
- package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
- package/models/PropertiesBody.ts +1 -1
- package/models/PropertiesDeltas.ts +1 -1
- package/models/PropertiesObject.ts +1 -1
- package/models/Purchase.ts +1 -1
- package/models/RateLimitError.ts +1 -1
- package/models/Segment.ts +1 -1
- package/models/SegmentData.ts +1 -1
- package/models/SegmentNotificationTarget.ts +1 -1
- package/models/StartLiveActivityRequest.ts +177 -0
- package/models/StartLiveActivitySuccessResponse.ts +31 -0
- package/models/Subscription.ts +1 -1
- package/models/SubscriptionBody.ts +1 -1
- package/models/SubscriptionNotificationTarget.ts +1 -1
- package/models/TemplateResource.ts +72 -0
- package/models/TemplatesListResponse.ts +32 -0
- package/models/TransferSubscriptionRequestBody.ts +1 -1
- package/models/UpdateApiKeyRequest.ts +48 -0
- package/models/UpdateLiveActivityRequest.ts +1 -1
- package/models/UpdateLiveActivitySuccessResponse.ts +1 -1
- package/models/UpdateTemplateRequest.ts +92 -0
- package/models/UpdateUserRequest.ts +1 -1
- package/models/User.ts +1 -1
- package/models/UserIdentityBody.ts +1 -1
- package/models/WebButton.ts +1 -1
- package/models/all.ts +14 -0
- package/onesignal-node-onesignal-5.3.0-beta1.tgz +0 -0
- package/package.json +6 -5
- package/types/ObjectParamAPI.ts +386 -0
- package/types/ObservableAPI.ts +370 -0
- package/types/PromiseAPI.ts +174 -0
package/apis/DefaultApi.ts
CHANGED
|
@@ -10,11 +10,17 @@ import {canConsumeForm, isCodeInRange} from '../util';
|
|
|
10
10
|
import {SecurityAuthentication} from '../auth/auth';
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
import { ApiKeyTokensListResponse } from '../models/ApiKeyTokensListResponse';
|
|
13
14
|
import { App } from '../models/App';
|
|
15
|
+
import { CopyTemplateRequest } from '../models/CopyTemplateRequest';
|
|
16
|
+
import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest';
|
|
17
|
+
import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse';
|
|
14
18
|
import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
|
|
15
19
|
import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
|
|
16
20
|
import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
|
|
21
|
+
import { CreateTemplateRequest } from '../models/CreateTemplateRequest';
|
|
17
22
|
import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse';
|
|
23
|
+
import { CustomEventsRequest } from '../models/CustomEventsRequest';
|
|
18
24
|
import { ExportEventsSuccessResponse } from '../models/ExportEventsSuccessResponse';
|
|
19
25
|
import { ExportSubscriptionsRequestBody } from '../models/ExportSubscriptionsRequestBody';
|
|
20
26
|
import { ExportSubscriptionsSuccessResponse } from '../models/ExportSubscriptionsSuccessResponse';
|
|
@@ -30,10 +36,16 @@ import { OutcomesData } from '../models/OutcomesData';
|
|
|
30
36
|
import { PropertiesBody } from '../models/PropertiesBody';
|
|
31
37
|
import { RateLimitError } from '../models/RateLimitError';
|
|
32
38
|
import { Segment } from '../models/Segment';
|
|
39
|
+
import { StartLiveActivityRequest } from '../models/StartLiveActivityRequest';
|
|
40
|
+
import { StartLiveActivitySuccessResponse } from '../models/StartLiveActivitySuccessResponse';
|
|
33
41
|
import { SubscriptionBody } from '../models/SubscriptionBody';
|
|
42
|
+
import { TemplateResource } from '../models/TemplateResource';
|
|
43
|
+
import { TemplatesListResponse } from '../models/TemplatesListResponse';
|
|
34
44
|
import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody';
|
|
45
|
+
import { UpdateApiKeyRequest } from '../models/UpdateApiKeyRequest';
|
|
35
46
|
import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest';
|
|
36
47
|
import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse';
|
|
48
|
+
import { UpdateTemplateRequest } from '../models/UpdateTemplateRequest';
|
|
37
49
|
import { UpdateUserRequest } from '../models/UpdateUserRequest';
|
|
38
50
|
import { User } from '../models/User';
|
|
39
51
|
import { UserIdentityBody } from '../models/UserIdentityBody';
|
|
@@ -73,7 +85,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
73
85
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
74
86
|
|
|
75
87
|
// Always add the One Signal telemetry to the request.
|
|
76
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
88
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
77
89
|
|
|
78
90
|
// Query Params
|
|
79
91
|
if (appId !== undefined) {
|
|
@@ -96,6 +108,77 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
96
108
|
return requestContext;
|
|
97
109
|
}
|
|
98
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Copy a template to a destination app.
|
|
113
|
+
* Copy template to another app
|
|
114
|
+
* @param templateId
|
|
115
|
+
* @param appId
|
|
116
|
+
* @param copyTemplateRequest
|
|
117
|
+
*/
|
|
118
|
+
public async copyTemplateToApp(templateId: string, appId: string, copyTemplateRequest: CopyTemplateRequest, _options?: Configuration): Promise<RequestContext> {
|
|
119
|
+
let _config = _options || this.configuration;
|
|
120
|
+
|
|
121
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
122
|
+
if (templateId === null || templateId === undefined) {
|
|
123
|
+
throw new RequiredError("DefaultApi", "copyTemplateToApp", "templateId");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// verify required parameter 'appId' is not null or undefined
|
|
128
|
+
if (appId === null || appId === undefined) {
|
|
129
|
+
throw new RequiredError("DefaultApi", "copyTemplateToApp", "appId");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
// verify required parameter 'copyTemplateRequest' is not null or undefined
|
|
134
|
+
if (copyTemplateRequest === null || copyTemplateRequest === undefined) {
|
|
135
|
+
throw new RequiredError("DefaultApi", "copyTemplateToApp", "copyTemplateRequest");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
// Path Params
|
|
140
|
+
const localVarPath = '/templates/{template_id}/copy_to_app'
|
|
141
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
142
|
+
|
|
143
|
+
// Make Request Context
|
|
144
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
145
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
146
|
+
|
|
147
|
+
// Always add the One Signal telemetry to the request.
|
|
148
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
149
|
+
|
|
150
|
+
// Query Params
|
|
151
|
+
if (appId !== undefined) {
|
|
152
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
// Body Params
|
|
157
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
158
|
+
"application/json"
|
|
159
|
+
]);
|
|
160
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
161
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
162
|
+
ObjectSerializer.serialize(copyTemplateRequest, "CopyTemplateRequest", ""),
|
|
163
|
+
contentType
|
|
164
|
+
);
|
|
165
|
+
requestContext.setBody(serializedBody);
|
|
166
|
+
|
|
167
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
168
|
+
// Apply auth methods
|
|
169
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
170
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
171
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
175
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
176
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return requestContext;
|
|
180
|
+
}
|
|
181
|
+
|
|
99
182
|
/**
|
|
100
183
|
* Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
|
101
184
|
* @param appId
|
|
@@ -141,7 +224,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
141
224
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
142
225
|
|
|
143
226
|
// Always add the One Signal telemetry to the request.
|
|
144
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
227
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
145
228
|
|
|
146
229
|
|
|
147
230
|
// Body Params
|
|
@@ -207,7 +290,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
207
290
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
208
291
|
|
|
209
292
|
// Always add the One Signal telemetry to the request.
|
|
210
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
293
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
211
294
|
|
|
212
295
|
|
|
213
296
|
// Body Params
|
|
@@ -236,6 +319,65 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
236
319
|
return requestContext;
|
|
237
320
|
}
|
|
238
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting.
|
|
324
|
+
* Create API key
|
|
325
|
+
* @param appId
|
|
326
|
+
* @param createApiKeyRequest
|
|
327
|
+
*/
|
|
328
|
+
public async createApiKey(appId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: Configuration): Promise<RequestContext> {
|
|
329
|
+
let _config = _options || this.configuration;
|
|
330
|
+
|
|
331
|
+
// verify required parameter 'appId' is not null or undefined
|
|
332
|
+
if (appId === null || appId === undefined) {
|
|
333
|
+
throw new RequiredError("DefaultApi", "createApiKey", "appId");
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
// verify required parameter 'createApiKeyRequest' is not null or undefined
|
|
338
|
+
if (createApiKeyRequest === null || createApiKeyRequest === undefined) {
|
|
339
|
+
throw new RequiredError("DefaultApi", "createApiKey", "createApiKeyRequest");
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
// Path Params
|
|
344
|
+
const localVarPath = '/apps/{app_id}/auth/tokens'
|
|
345
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
346
|
+
|
|
347
|
+
// Make Request Context
|
|
348
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
349
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
350
|
+
|
|
351
|
+
// Always add the One Signal telemetry to the request.
|
|
352
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
// Body Params
|
|
356
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
357
|
+
"application/json"
|
|
358
|
+
]);
|
|
359
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
360
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
361
|
+
ObjectSerializer.serialize(createApiKeyRequest, "CreateApiKeyRequest", ""),
|
|
362
|
+
contentType
|
|
363
|
+
);
|
|
364
|
+
requestContext.setBody(serializedBody);
|
|
365
|
+
|
|
366
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
367
|
+
// Apply auth methods
|
|
368
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
369
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
370
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
374
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
375
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return requestContext;
|
|
379
|
+
}
|
|
380
|
+
|
|
239
381
|
/**
|
|
240
382
|
* Creates a new OneSignal app
|
|
241
383
|
* Create an app
|
|
@@ -258,7 +400,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
258
400
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
259
401
|
|
|
260
402
|
// Always add the One Signal telemetry to the request.
|
|
261
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
403
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
262
404
|
|
|
263
405
|
|
|
264
406
|
// Body Params
|
|
@@ -287,6 +429,65 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
287
429
|
return requestContext;
|
|
288
430
|
}
|
|
289
431
|
|
|
432
|
+
/**
|
|
433
|
+
* The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.
|
|
434
|
+
* Create custom events
|
|
435
|
+
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
436
|
+
* @param customEventsRequest
|
|
437
|
+
*/
|
|
438
|
+
public async createCustomEvents(appId: string, customEventsRequest: CustomEventsRequest, _options?: Configuration): Promise<RequestContext> {
|
|
439
|
+
let _config = _options || this.configuration;
|
|
440
|
+
|
|
441
|
+
// verify required parameter 'appId' is not null or undefined
|
|
442
|
+
if (appId === null || appId === undefined) {
|
|
443
|
+
throw new RequiredError("DefaultApi", "createCustomEvents", "appId");
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
// verify required parameter 'customEventsRequest' is not null or undefined
|
|
448
|
+
if (customEventsRequest === null || customEventsRequest === undefined) {
|
|
449
|
+
throw new RequiredError("DefaultApi", "createCustomEvents", "customEventsRequest");
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
// Path Params
|
|
454
|
+
const localVarPath = '/apps/{app_id}/integrations/custom_events'
|
|
455
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
456
|
+
|
|
457
|
+
// Make Request Context
|
|
458
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
459
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
460
|
+
|
|
461
|
+
// Always add the One Signal telemetry to the request.
|
|
462
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
// Body Params
|
|
466
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
467
|
+
"application/json"
|
|
468
|
+
]);
|
|
469
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
470
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
471
|
+
ObjectSerializer.serialize(customEventsRequest, "CustomEventsRequest", ""),
|
|
472
|
+
contentType
|
|
473
|
+
);
|
|
474
|
+
requestContext.setBody(serializedBody);
|
|
475
|
+
|
|
476
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
477
|
+
// Apply auth methods
|
|
478
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
479
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
480
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
484
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
485
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return requestContext;
|
|
489
|
+
}
|
|
490
|
+
|
|
290
491
|
/**
|
|
291
492
|
* Sends notifications to your users
|
|
292
493
|
* Create notification
|
|
@@ -309,7 +510,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
309
510
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
310
511
|
|
|
311
512
|
// Always add the One Signal telemetry to the request.
|
|
312
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
513
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
313
514
|
|
|
314
515
|
|
|
315
516
|
// Body Params
|
|
@@ -363,7 +564,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
363
564
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
364
565
|
|
|
365
566
|
// Always add the One Signal telemetry to the request.
|
|
366
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
567
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
367
568
|
|
|
368
569
|
|
|
369
570
|
// Body Params
|
|
@@ -437,7 +638,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
437
638
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
438
639
|
|
|
439
640
|
// Always add the One Signal telemetry to the request.
|
|
440
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
641
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
441
642
|
|
|
442
643
|
|
|
443
644
|
// Body Params
|
|
@@ -466,6 +667,57 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
466
667
|
return requestContext;
|
|
467
668
|
}
|
|
468
669
|
|
|
670
|
+
/**
|
|
671
|
+
* Create reusable message templates for push, email, and SMS channels.
|
|
672
|
+
* Create template
|
|
673
|
+
* @param createTemplateRequest
|
|
674
|
+
*/
|
|
675
|
+
public async createTemplate(createTemplateRequest: CreateTemplateRequest, _options?: Configuration): Promise<RequestContext> {
|
|
676
|
+
let _config = _options || this.configuration;
|
|
677
|
+
|
|
678
|
+
// verify required parameter 'createTemplateRequest' is not null or undefined
|
|
679
|
+
if (createTemplateRequest === null || createTemplateRequest === undefined) {
|
|
680
|
+
throw new RequiredError("DefaultApi", "createTemplate", "createTemplateRequest");
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
// Path Params
|
|
685
|
+
const localVarPath = '/templates';
|
|
686
|
+
|
|
687
|
+
// Make Request Context
|
|
688
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
689
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
690
|
+
|
|
691
|
+
// Always add the One Signal telemetry to the request.
|
|
692
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
// Body Params
|
|
696
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
697
|
+
"application/json"
|
|
698
|
+
]);
|
|
699
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
700
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
701
|
+
ObjectSerializer.serialize(createTemplateRequest, "CreateTemplateRequest", ""),
|
|
702
|
+
contentType
|
|
703
|
+
);
|
|
704
|
+
requestContext.setBody(serializedBody);
|
|
705
|
+
|
|
706
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
707
|
+
// Apply auth methods
|
|
708
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
709
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
710
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
714
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
715
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return requestContext;
|
|
719
|
+
}
|
|
720
|
+
|
|
469
721
|
/**
|
|
470
722
|
* Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
|
|
471
723
|
* @param appId
|
|
@@ -495,7 +747,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
495
747
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
496
748
|
|
|
497
749
|
// Always add the One Signal telemetry to the request.
|
|
498
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
750
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
499
751
|
|
|
500
752
|
|
|
501
753
|
// Body Params
|
|
@@ -570,7 +822,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
570
822
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
571
823
|
|
|
572
824
|
// Always add the One Signal telemetry to the request.
|
|
573
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
825
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
574
826
|
|
|
575
827
|
|
|
576
828
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -588,6 +840,55 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
588
840
|
return requestContext;
|
|
589
841
|
}
|
|
590
842
|
|
|
843
|
+
/**
|
|
844
|
+
* Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself.
|
|
845
|
+
* Delete API key
|
|
846
|
+
* @param appId
|
|
847
|
+
* @param tokenId
|
|
848
|
+
*/
|
|
849
|
+
public async deleteApiKey(appId: string, tokenId: string, _options?: Configuration): Promise<RequestContext> {
|
|
850
|
+
let _config = _options || this.configuration;
|
|
851
|
+
|
|
852
|
+
// verify required parameter 'appId' is not null or undefined
|
|
853
|
+
if (appId === null || appId === undefined) {
|
|
854
|
+
throw new RequiredError("DefaultApi", "deleteApiKey", "appId");
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
// verify required parameter 'tokenId' is not null or undefined
|
|
859
|
+
if (tokenId === null || tokenId === undefined) {
|
|
860
|
+
throw new RequiredError("DefaultApi", "deleteApiKey", "tokenId");
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
// Path Params
|
|
865
|
+
const localVarPath = '/apps/{app_id}/auth/tokens/{token_id}'
|
|
866
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
867
|
+
.replace('{' + 'token_id' + '}', encodeURIComponent(String(tokenId)));
|
|
868
|
+
|
|
869
|
+
// Make Request Context
|
|
870
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
871
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
872
|
+
|
|
873
|
+
// Always add the One Signal telemetry to the request.
|
|
874
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
878
|
+
// Apply auth methods
|
|
879
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
880
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
881
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
885
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
886
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
return requestContext;
|
|
890
|
+
}
|
|
891
|
+
|
|
591
892
|
/**
|
|
592
893
|
* Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
|
593
894
|
* Delete Segment
|
|
@@ -619,7 +920,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
619
920
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
620
921
|
|
|
621
922
|
// Always add the One Signal telemetry to the request.
|
|
622
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
923
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
623
924
|
|
|
624
925
|
|
|
625
926
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -667,7 +968,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
667
968
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
668
969
|
|
|
669
970
|
// Always add the One Signal telemetry to the request.
|
|
670
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
971
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
671
972
|
|
|
672
973
|
|
|
673
974
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -686,44 +987,97 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
686
987
|
}
|
|
687
988
|
|
|
688
989
|
/**
|
|
689
|
-
*
|
|
990
|
+
* Delete a template by id.
|
|
991
|
+
* Delete template
|
|
992
|
+
* @param templateId
|
|
690
993
|
* @param appId
|
|
691
|
-
* @param aliasLabel
|
|
692
|
-
* @param aliasId
|
|
693
994
|
*/
|
|
694
|
-
public async
|
|
995
|
+
public async deleteTemplate(templateId: string, appId: string, _options?: Configuration): Promise<RequestContext> {
|
|
695
996
|
let _config = _options || this.configuration;
|
|
696
997
|
|
|
697
|
-
// verify required parameter '
|
|
698
|
-
if (
|
|
699
|
-
throw new RequiredError("DefaultApi", "
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
// verify required parameter 'aliasLabel' is not null or undefined
|
|
704
|
-
if (aliasLabel === null || aliasLabel === undefined) {
|
|
705
|
-
throw new RequiredError("DefaultApi", "deleteUser", "aliasLabel");
|
|
998
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
999
|
+
if (templateId === null || templateId === undefined) {
|
|
1000
|
+
throw new RequiredError("DefaultApi", "deleteTemplate", "templateId");
|
|
706
1001
|
}
|
|
707
1002
|
|
|
708
1003
|
|
|
709
|
-
// verify required parameter '
|
|
710
|
-
if (
|
|
711
|
-
throw new RequiredError("DefaultApi", "
|
|
1004
|
+
// verify required parameter 'appId' is not null or undefined
|
|
1005
|
+
if (appId === null || appId === undefined) {
|
|
1006
|
+
throw new RequiredError("DefaultApi", "deleteTemplate", "appId");
|
|
712
1007
|
}
|
|
713
1008
|
|
|
714
1009
|
|
|
715
1010
|
// Path Params
|
|
716
|
-
const localVarPath = '/
|
|
717
|
-
.replace('{' + '
|
|
718
|
-
.replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
|
|
719
|
-
.replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
|
|
1011
|
+
const localVarPath = '/templates/{template_id}'
|
|
1012
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
720
1013
|
|
|
721
1014
|
// Make Request Context
|
|
722
1015
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
723
1016
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
724
1017
|
|
|
725
1018
|
// Always add the One Signal telemetry to the request.
|
|
726
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1019
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1020
|
+
|
|
1021
|
+
// Query Params
|
|
1022
|
+
if (appId !== undefined) {
|
|
1023
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
1028
|
+
// Apply auth methods
|
|
1029
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
1030
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
1031
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
1035
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
1036
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
return requestContext;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
|
|
1044
|
+
* @param appId
|
|
1045
|
+
* @param aliasLabel
|
|
1046
|
+
* @param aliasId
|
|
1047
|
+
*/
|
|
1048
|
+
public async deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<RequestContext> {
|
|
1049
|
+
let _config = _options || this.configuration;
|
|
1050
|
+
|
|
1051
|
+
// verify required parameter 'appId' is not null or undefined
|
|
1052
|
+
if (appId === null || appId === undefined) {
|
|
1053
|
+
throw new RequiredError("DefaultApi", "deleteUser", "appId");
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
// verify required parameter 'aliasLabel' is not null or undefined
|
|
1058
|
+
if (aliasLabel === null || aliasLabel === undefined) {
|
|
1059
|
+
throw new RequiredError("DefaultApi", "deleteUser", "aliasLabel");
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
// verify required parameter 'aliasId' is not null or undefined
|
|
1064
|
+
if (aliasId === null || aliasId === undefined) {
|
|
1065
|
+
throw new RequiredError("DefaultApi", "deleteUser", "aliasId");
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
// Path Params
|
|
1070
|
+
const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
|
|
1071
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
1072
|
+
.replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
|
|
1073
|
+
.replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
|
|
1074
|
+
|
|
1075
|
+
// Make Request Context
|
|
1076
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
1077
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1078
|
+
|
|
1079
|
+
// Always add the One Signal telemetry to the request.
|
|
1080
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
727
1081
|
|
|
728
1082
|
|
|
729
1083
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -771,7 +1125,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
771
1125
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
772
1126
|
|
|
773
1127
|
// Always add the One Signal telemetry to the request.
|
|
774
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1128
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
775
1129
|
|
|
776
1130
|
// Query Params
|
|
777
1131
|
if (appId !== undefined) {
|
|
@@ -819,7 +1173,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
819
1173
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
820
1174
|
|
|
821
1175
|
// Always add the One Signal telemetry to the request.
|
|
822
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1176
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
823
1177
|
|
|
824
1178
|
|
|
825
1179
|
// Body Params
|
|
@@ -886,7 +1240,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
886
1240
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
887
1241
|
|
|
888
1242
|
// Always add the One Signal telemetry to the request.
|
|
889
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1243
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
890
1244
|
|
|
891
1245
|
|
|
892
1246
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -934,7 +1288,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
934
1288
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
935
1289
|
|
|
936
1290
|
// Always add the One Signal telemetry to the request.
|
|
937
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1291
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
938
1292
|
|
|
939
1293
|
|
|
940
1294
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -975,7 +1329,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
975
1329
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
976
1330
|
|
|
977
1331
|
// Always add the One Signal telemetry to the request.
|
|
978
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1332
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
979
1333
|
|
|
980
1334
|
|
|
981
1335
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -1008,7 +1362,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1008
1362
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1009
1363
|
|
|
1010
1364
|
// Always add the One Signal telemetry to the request.
|
|
1011
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1365
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1012
1366
|
|
|
1013
1367
|
|
|
1014
1368
|
let authMethod: SecurityAuthentication | undefined;
|
|
@@ -1056,7 +1410,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1056
1410
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1057
1411
|
|
|
1058
1412
|
// Always add the One Signal telemetry to the request.
|
|
1059
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1413
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1060
1414
|
|
|
1061
1415
|
// Query Params
|
|
1062
1416
|
if (appId !== undefined) {
|
|
@@ -1109,7 +1463,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1109
1463
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1110
1464
|
|
|
1111
1465
|
// Always add the One Signal telemetry to the request.
|
|
1112
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1466
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1113
1467
|
|
|
1114
1468
|
|
|
1115
1469
|
// Body Params
|
|
@@ -1166,7 +1520,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1166
1520
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1167
1521
|
|
|
1168
1522
|
// Always add the One Signal telemetry to the request.
|
|
1169
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1523
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1170
1524
|
|
|
1171
1525
|
// Query Params
|
|
1172
1526
|
if (appId !== undefined) {
|
|
@@ -1242,7 +1596,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1242
1596
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1243
1597
|
|
|
1244
1598
|
// Always add the One Signal telemetry to the request.
|
|
1245
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1599
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1246
1600
|
|
|
1247
1601
|
// Query Params
|
|
1248
1602
|
if (outcomeNames !== undefined) {
|
|
@@ -1312,7 +1666,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1312
1666
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1313
1667
|
|
|
1314
1668
|
// Always add the One Signal telemetry to the request.
|
|
1315
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1669
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1316
1670
|
|
|
1317
1671
|
// Query Params
|
|
1318
1672
|
if (offset !== undefined) {
|
|
@@ -1378,9 +1732,125 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1378
1732
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1379
1733
|
|
|
1380
1734
|
// Always add the One Signal telemetry to the request.
|
|
1381
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1735
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
1739
|
+
// Apply auth methods
|
|
1740
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
1741
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
1742
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
1746
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
1747
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
return requestContext;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch.
|
|
1755
|
+
* Rotate API key
|
|
1756
|
+
* @param appId
|
|
1757
|
+
* @param tokenId
|
|
1758
|
+
*/
|
|
1759
|
+
public async rotateApiKey(appId: string, tokenId: string, _options?: Configuration): Promise<RequestContext> {
|
|
1760
|
+
let _config = _options || this.configuration;
|
|
1761
|
+
|
|
1762
|
+
// verify required parameter 'appId' is not null or undefined
|
|
1763
|
+
if (appId === null || appId === undefined) {
|
|
1764
|
+
throw new RequiredError("DefaultApi", "rotateApiKey", "appId");
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
// verify required parameter 'tokenId' is not null or undefined
|
|
1769
|
+
if (tokenId === null || tokenId === undefined) {
|
|
1770
|
+
throw new RequiredError("DefaultApi", "rotateApiKey", "tokenId");
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
// Path Params
|
|
1775
|
+
const localVarPath = '/apps/{app_id}/auth/tokens/{token_id}/rotate'
|
|
1776
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
1777
|
+
.replace('{' + 'token_id' + '}', encodeURIComponent(String(tokenId)));
|
|
1778
|
+
|
|
1779
|
+
// Make Request Context
|
|
1780
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
1781
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1782
|
+
|
|
1783
|
+
// Always add the One Signal telemetry to the request.
|
|
1784
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
1788
|
+
// Apply auth methods
|
|
1789
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
1790
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
1791
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
1795
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
1796
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
return requestContext;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* Remotely start a Live Activity on iOS devices via OneSignal’s REST API.
|
|
1804
|
+
* Start Live Activity
|
|
1805
|
+
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
1806
|
+
* @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app\'s Live Activity implementation.
|
|
1807
|
+
* @param startLiveActivityRequest
|
|
1808
|
+
*/
|
|
1809
|
+
public async startLiveActivity(appId: string, activityType: string, startLiveActivityRequest: StartLiveActivityRequest, _options?: Configuration): Promise<RequestContext> {
|
|
1810
|
+
let _config = _options || this.configuration;
|
|
1811
|
+
|
|
1812
|
+
// verify required parameter 'appId' is not null or undefined
|
|
1813
|
+
if (appId === null || appId === undefined) {
|
|
1814
|
+
throw new RequiredError("DefaultApi", "startLiveActivity", "appId");
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
// verify required parameter 'activityType' is not null or undefined
|
|
1819
|
+
if (activityType === null || activityType === undefined) {
|
|
1820
|
+
throw new RequiredError("DefaultApi", "startLiveActivity", "activityType");
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
// verify required parameter 'startLiveActivityRequest' is not null or undefined
|
|
1825
|
+
if (startLiveActivityRequest === null || startLiveActivityRequest === undefined) {
|
|
1826
|
+
throw new RequiredError("DefaultApi", "startLiveActivity", "startLiveActivityRequest");
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
// Path Params
|
|
1831
|
+
const localVarPath = '/apps/{app_id}/activities/activity/{activity_type}'
|
|
1832
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
1833
|
+
.replace('{' + 'activity_type' + '}', encodeURIComponent(String(activityType)));
|
|
1834
|
+
|
|
1835
|
+
// Make Request Context
|
|
1836
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
1837
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1838
|
+
|
|
1839
|
+
// Always add the One Signal telemetry to the request.
|
|
1840
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1382
1841
|
|
|
1383
1842
|
|
|
1843
|
+
// Body Params
|
|
1844
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
1845
|
+
"application/json"
|
|
1846
|
+
]);
|
|
1847
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
1848
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
1849
|
+
ObjectSerializer.serialize(startLiveActivityRequest, "StartLiveActivityRequest", ""),
|
|
1850
|
+
contentType
|
|
1851
|
+
);
|
|
1852
|
+
requestContext.setBody(serializedBody);
|
|
1853
|
+
|
|
1384
1854
|
let authMethod: SecurityAuthentication | undefined;
|
|
1385
1855
|
// Apply auth methods
|
|
1386
1856
|
authMethod = _config.authMethods["rest_api_key"]
|
|
@@ -1433,7 +1903,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1433
1903
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1434
1904
|
|
|
1435
1905
|
// Always add the One Signal telemetry to the request.
|
|
1436
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1906
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1437
1907
|
|
|
1438
1908
|
|
|
1439
1909
|
// Body Params
|
|
@@ -1500,7 +1970,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1500
1970
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1501
1971
|
|
|
1502
1972
|
// Always add the One Signal telemetry to the request.
|
|
1503
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
1973
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1504
1974
|
|
|
1505
1975
|
// Query Params
|
|
1506
1976
|
if (token !== undefined) {
|
|
@@ -1523,6 +1993,73 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1523
1993
|
return requestContext;
|
|
1524
1994
|
}
|
|
1525
1995
|
|
|
1996
|
+
/**
|
|
1997
|
+
* Update a Rich Authentication Token (App API Key) for a OneSignal app.
|
|
1998
|
+
* Update API key
|
|
1999
|
+
* @param appId
|
|
2000
|
+
* @param tokenId
|
|
2001
|
+
* @param updateApiKeyRequest
|
|
2002
|
+
*/
|
|
2003
|
+
public async updateApiKey(appId: string, tokenId: string, updateApiKeyRequest: UpdateApiKeyRequest, _options?: Configuration): Promise<RequestContext> {
|
|
2004
|
+
let _config = _options || this.configuration;
|
|
2005
|
+
|
|
2006
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2007
|
+
if (appId === null || appId === undefined) {
|
|
2008
|
+
throw new RequiredError("DefaultApi", "updateApiKey", "appId");
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
// verify required parameter 'tokenId' is not null or undefined
|
|
2013
|
+
if (tokenId === null || tokenId === undefined) {
|
|
2014
|
+
throw new RequiredError("DefaultApi", "updateApiKey", "tokenId");
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
|
|
2018
|
+
// verify required parameter 'updateApiKeyRequest' is not null or undefined
|
|
2019
|
+
if (updateApiKeyRequest === null || updateApiKeyRequest === undefined) {
|
|
2020
|
+
throw new RequiredError("DefaultApi", "updateApiKey", "updateApiKeyRequest");
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
|
|
2024
|
+
// Path Params
|
|
2025
|
+
const localVarPath = '/apps/{app_id}/auth/tokens/{token_id}'
|
|
2026
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
2027
|
+
.replace('{' + 'token_id' + '}', encodeURIComponent(String(tokenId)));
|
|
2028
|
+
|
|
2029
|
+
// Make Request Context
|
|
2030
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
|
|
2031
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2032
|
+
|
|
2033
|
+
// Always add the One Signal telemetry to the request.
|
|
2034
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
// Body Params
|
|
2038
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
2039
|
+
"application/json"
|
|
2040
|
+
]);
|
|
2041
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
2042
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
2043
|
+
ObjectSerializer.serialize(updateApiKeyRequest, "UpdateApiKeyRequest", ""),
|
|
2044
|
+
contentType
|
|
2045
|
+
);
|
|
2046
|
+
requestContext.setBody(serializedBody);
|
|
2047
|
+
|
|
2048
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2049
|
+
// Apply auth methods
|
|
2050
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
2051
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2052
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2056
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2057
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
return requestContext;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
1526
2063
|
/**
|
|
1527
2064
|
* Updates the name or configuration settings of an existing OneSignal app
|
|
1528
2065
|
* Update an app
|
|
@@ -1553,7 +2090,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1553
2090
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1554
2091
|
|
|
1555
2092
|
// Always add the One Signal telemetry to the request.
|
|
1556
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
2093
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1557
2094
|
|
|
1558
2095
|
|
|
1559
2096
|
// Body Params
|
|
@@ -1620,7 +2157,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1620
2157
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1621
2158
|
|
|
1622
2159
|
// Always add the One Signal telemetry to the request.
|
|
1623
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
2160
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1624
2161
|
|
|
1625
2162
|
|
|
1626
2163
|
// Body Params
|
|
@@ -1686,7 +2223,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1686
2223
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1687
2224
|
|
|
1688
2225
|
// Always add the One Signal telemetry to the request.
|
|
1689
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
2226
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
1690
2227
|
|
|
1691
2228
|
|
|
1692
2229
|
// Body Params
|
|
@@ -1716,63 +2253,369 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1716
2253
|
}
|
|
1717
2254
|
|
|
1718
2255
|
/**
|
|
1719
|
-
*
|
|
1720
|
-
*
|
|
1721
|
-
* @param
|
|
1722
|
-
* @param
|
|
1723
|
-
* @param
|
|
2256
|
+
* Update properties on an existing OneSignal subscription using its token.
|
|
2257
|
+
* Update subscription by token
|
|
2258
|
+
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
2259
|
+
* @param tokenType The type of token to use when looking up the subscription. See Subscription Types.
|
|
2260
|
+
* @param token The value of the token to lookup by (e.g., email address, phone number).
|
|
2261
|
+
* @param subscriptionBody
|
|
2262
|
+
*/
|
|
2263
|
+
public async updateSubscriptionByToken(appId: string, tokenType: string, token: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<RequestContext> {
|
|
2264
|
+
let _config = _options || this.configuration;
|
|
2265
|
+
|
|
2266
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2267
|
+
if (appId === null || appId === undefined) {
|
|
2268
|
+
throw new RequiredError("DefaultApi", "updateSubscriptionByToken", "appId");
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
// verify required parameter 'tokenType' is not null or undefined
|
|
2273
|
+
if (tokenType === null || tokenType === undefined) {
|
|
2274
|
+
throw new RequiredError("DefaultApi", "updateSubscriptionByToken", "tokenType");
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
// verify required parameter 'token' is not null or undefined
|
|
2279
|
+
if (token === null || token === undefined) {
|
|
2280
|
+
throw new RequiredError("DefaultApi", "updateSubscriptionByToken", "token");
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
// verify required parameter 'subscriptionBody' is not null or undefined
|
|
2285
|
+
if (subscriptionBody === null || subscriptionBody === undefined) {
|
|
2286
|
+
throw new RequiredError("DefaultApi", "updateSubscriptionByToken", "subscriptionBody");
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
// Path Params
|
|
2291
|
+
const localVarPath = '/apps/{app_id}/subscriptions_by_token/{token_type}/{token}'
|
|
2292
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
2293
|
+
.replace('{' + 'token_type' + '}', encodeURIComponent(String(tokenType)))
|
|
2294
|
+
.replace('{' + 'token' + '}', encodeURIComponent(String(token)));
|
|
2295
|
+
|
|
2296
|
+
// Make Request Context
|
|
2297
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
|
|
2298
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2299
|
+
|
|
2300
|
+
// Always add the One Signal telemetry to the request.
|
|
2301
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
// Body Params
|
|
2305
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
2306
|
+
"application/json"
|
|
2307
|
+
]);
|
|
2308
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
2309
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
2310
|
+
ObjectSerializer.serialize(subscriptionBody, "SubscriptionBody", ""),
|
|
2311
|
+
contentType
|
|
2312
|
+
);
|
|
2313
|
+
requestContext.setBody(serializedBody);
|
|
2314
|
+
|
|
2315
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2316
|
+
// Apply auth methods
|
|
2317
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
2318
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2319
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2323
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2324
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
return requestContext;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* Update an existing template.
|
|
2332
|
+
* Update template
|
|
2333
|
+
* @param templateId
|
|
2334
|
+
* @param appId
|
|
2335
|
+
* @param updateTemplateRequest
|
|
2336
|
+
*/
|
|
2337
|
+
public async updateTemplate(templateId: string, appId: string, updateTemplateRequest: UpdateTemplateRequest, _options?: Configuration): Promise<RequestContext> {
|
|
2338
|
+
let _config = _options || this.configuration;
|
|
2339
|
+
|
|
2340
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
2341
|
+
if (templateId === null || templateId === undefined) {
|
|
2342
|
+
throw new RequiredError("DefaultApi", "updateTemplate", "templateId");
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
|
|
2346
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2347
|
+
if (appId === null || appId === undefined) {
|
|
2348
|
+
throw new RequiredError("DefaultApi", "updateTemplate", "appId");
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
// verify required parameter 'updateTemplateRequest' is not null or undefined
|
|
2353
|
+
if (updateTemplateRequest === null || updateTemplateRequest === undefined) {
|
|
2354
|
+
throw new RequiredError("DefaultApi", "updateTemplate", "updateTemplateRequest");
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
// Path Params
|
|
2359
|
+
const localVarPath = '/templates/{template_id}'
|
|
2360
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
2361
|
+
|
|
2362
|
+
// Make Request Context
|
|
2363
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
|
|
2364
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2365
|
+
|
|
2366
|
+
// Always add the One Signal telemetry to the request.
|
|
2367
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2368
|
+
|
|
2369
|
+
// Query Params
|
|
2370
|
+
if (appId !== undefined) {
|
|
2371
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
// Body Params
|
|
2376
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
2377
|
+
"application/json"
|
|
2378
|
+
]);
|
|
2379
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
2380
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
2381
|
+
ObjectSerializer.serialize(updateTemplateRequest, "UpdateTemplateRequest", ""),
|
|
2382
|
+
contentType
|
|
2383
|
+
);
|
|
2384
|
+
requestContext.setBody(serializedBody);
|
|
2385
|
+
|
|
2386
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2387
|
+
// Apply auth methods
|
|
2388
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
2389
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2390
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2394
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2395
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
return requestContext;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
/**
|
|
2402
|
+
* Updates an existing User’s properties.
|
|
2403
|
+
* @param appId
|
|
2404
|
+
* @param aliasLabel
|
|
2405
|
+
* @param aliasId
|
|
2406
|
+
* @param updateUserRequest
|
|
2407
|
+
*/
|
|
2408
|
+
public async updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, _options?: Configuration): Promise<RequestContext> {
|
|
2409
|
+
let _config = _options || this.configuration;
|
|
2410
|
+
|
|
2411
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2412
|
+
if (appId === null || appId === undefined) {
|
|
2413
|
+
throw new RequiredError("DefaultApi", "updateUser", "appId");
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
// verify required parameter 'aliasLabel' is not null or undefined
|
|
2418
|
+
if (aliasLabel === null || aliasLabel === undefined) {
|
|
2419
|
+
throw new RequiredError("DefaultApi", "updateUser", "aliasLabel");
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
// verify required parameter 'aliasId' is not null or undefined
|
|
2424
|
+
if (aliasId === null || aliasId === undefined) {
|
|
2425
|
+
throw new RequiredError("DefaultApi", "updateUser", "aliasId");
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
|
|
2429
|
+
// verify required parameter 'updateUserRequest' is not null or undefined
|
|
2430
|
+
if (updateUserRequest === null || updateUserRequest === undefined) {
|
|
2431
|
+
throw new RequiredError("DefaultApi", "updateUser", "updateUserRequest");
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
|
|
2435
|
+
// Path Params
|
|
2436
|
+
const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
|
|
2437
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
2438
|
+
.replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
|
|
2439
|
+
.replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
|
|
2440
|
+
|
|
2441
|
+
// Make Request Context
|
|
2442
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
|
|
2443
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2444
|
+
|
|
2445
|
+
// Always add the One Signal telemetry to the request.
|
|
2446
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2447
|
+
|
|
2448
|
+
|
|
2449
|
+
// Body Params
|
|
2450
|
+
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
2451
|
+
"application/json"
|
|
2452
|
+
]);
|
|
2453
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
2454
|
+
const serializedBody = ObjectSerializer.stringify(
|
|
2455
|
+
ObjectSerializer.serialize(updateUserRequest, "UpdateUserRequest", ""),
|
|
2456
|
+
contentType
|
|
2457
|
+
);
|
|
2458
|
+
requestContext.setBody(serializedBody);
|
|
2459
|
+
|
|
2460
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2461
|
+
// Apply auth methods
|
|
2462
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
2463
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2464
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2468
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2469
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
return requestContext;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
/**
|
|
2476
|
+
* View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app.
|
|
2477
|
+
* View API keys
|
|
2478
|
+
* @param appId
|
|
2479
|
+
*/
|
|
2480
|
+
public async viewApiKeys(appId: string, _options?: Configuration): Promise<RequestContext> {
|
|
2481
|
+
let _config = _options || this.configuration;
|
|
2482
|
+
|
|
2483
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2484
|
+
if (appId === null || appId === undefined) {
|
|
2485
|
+
throw new RequiredError("DefaultApi", "viewApiKeys", "appId");
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
// Path Params
|
|
2490
|
+
const localVarPath = '/apps/{app_id}/auth/tokens'
|
|
2491
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
2492
|
+
|
|
2493
|
+
// Make Request Context
|
|
2494
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
2495
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2496
|
+
|
|
2497
|
+
// Always add the One Signal telemetry to the request.
|
|
2498
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2499
|
+
|
|
2500
|
+
|
|
2501
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2502
|
+
// Apply auth methods
|
|
2503
|
+
authMethod = _config.authMethods["organization_api_key"]
|
|
2504
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2505
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2509
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2510
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
return requestContext;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
/**
|
|
2517
|
+
* Fetch a single template by id.
|
|
2518
|
+
* View template
|
|
2519
|
+
* @param templateId
|
|
2520
|
+
* @param appId
|
|
2521
|
+
*/
|
|
2522
|
+
public async viewTemplate(templateId: string, appId: string, _options?: Configuration): Promise<RequestContext> {
|
|
2523
|
+
let _config = _options || this.configuration;
|
|
2524
|
+
|
|
2525
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
2526
|
+
if (templateId === null || templateId === undefined) {
|
|
2527
|
+
throw new RequiredError("DefaultApi", "viewTemplate", "templateId");
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
// verify required parameter 'appId' is not null or undefined
|
|
2532
|
+
if (appId === null || appId === undefined) {
|
|
2533
|
+
throw new RequiredError("DefaultApi", "viewTemplate", "appId");
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
// Path Params
|
|
2538
|
+
const localVarPath = '/templates/{template_id}'
|
|
2539
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
2540
|
+
|
|
2541
|
+
// Make Request Context
|
|
2542
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
2543
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
2544
|
+
|
|
2545
|
+
// Always add the One Signal telemetry to the request.
|
|
2546
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2547
|
+
|
|
2548
|
+
// Query Params
|
|
2549
|
+
if (appId !== undefined) {
|
|
2550
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
2555
|
+
// Apply auth methods
|
|
2556
|
+
authMethod = _config.authMethods["rest_api_key"]
|
|
2557
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
2558
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
2562
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
2563
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
return requestContext;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* List templates for an app.
|
|
2571
|
+
* View templates
|
|
2572
|
+
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
2573
|
+
* @param limit Maximum number of templates. Default and max is 50.
|
|
2574
|
+
* @param offset Pagination offset.
|
|
2575
|
+
* @param channel Filter by delivery channel.
|
|
1724
2576
|
*/
|
|
1725
|
-
public async
|
|
2577
|
+
public async viewTemplates(appId: string, limit?: number, offset?: number, channel?: 'push' | 'email' | 'sms', _options?: Configuration): Promise<RequestContext> {
|
|
1726
2578
|
let _config = _options || this.configuration;
|
|
1727
2579
|
|
|
1728
2580
|
// verify required parameter 'appId' is not null or undefined
|
|
1729
2581
|
if (appId === null || appId === undefined) {
|
|
1730
|
-
throw new RequiredError("DefaultApi", "
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
// verify required parameter 'aliasLabel' is not null or undefined
|
|
1735
|
-
if (aliasLabel === null || aliasLabel === undefined) {
|
|
1736
|
-
throw new RequiredError("DefaultApi", "updateUser", "aliasLabel");
|
|
2582
|
+
throw new RequiredError("DefaultApi", "viewTemplates", "appId");
|
|
1737
2583
|
}
|
|
1738
2584
|
|
|
1739
2585
|
|
|
1740
|
-
// verify required parameter 'aliasId' is not null or undefined
|
|
1741
|
-
if (aliasId === null || aliasId === undefined) {
|
|
1742
|
-
throw new RequiredError("DefaultApi", "updateUser", "aliasId");
|
|
1743
|
-
}
|
|
1744
2586
|
|
|
1745
2587
|
|
|
1746
|
-
// verify required parameter 'updateUserRequest' is not null or undefined
|
|
1747
|
-
if (updateUserRequest === null || updateUserRequest === undefined) {
|
|
1748
|
-
throw new RequiredError("DefaultApi", "updateUser", "updateUserRequest");
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
2588
|
|
|
1752
2589
|
// Path Params
|
|
1753
|
-
const localVarPath = '/
|
|
1754
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
1755
|
-
.replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
|
|
1756
|
-
.replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
|
|
2590
|
+
const localVarPath = '/templates';
|
|
1757
2591
|
|
|
1758
2592
|
// Make Request Context
|
|
1759
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.
|
|
2593
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
1760
2594
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1761
2595
|
|
|
1762
2596
|
// Always add the One Signal telemetry to the request.
|
|
1763
|
-
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.
|
|
2597
|
+
requestContext.setHeaderParam("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-typescript, version=5.3.0-beta1");
|
|
2598
|
+
|
|
2599
|
+
// Query Params
|
|
2600
|
+
if (appId !== undefined) {
|
|
2601
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
2602
|
+
}
|
|
1764
2603
|
|
|
2604
|
+
// Query Params
|
|
2605
|
+
if (limit !== undefined) {
|
|
2606
|
+
requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
// Query Params
|
|
2610
|
+
if (offset !== undefined) {
|
|
2611
|
+
requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
// Query Params
|
|
2615
|
+
if (channel !== undefined) {
|
|
2616
|
+
requestContext.setQueryParam("channel", ObjectSerializer.serialize(channel, "'push' | 'email' | 'sms'", ""));
|
|
2617
|
+
}
|
|
1765
2618
|
|
|
1766
|
-
// Body Params
|
|
1767
|
-
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
1768
|
-
"application/json"
|
|
1769
|
-
]);
|
|
1770
|
-
requestContext.setHeaderParam("Content-Type", contentType);
|
|
1771
|
-
const serializedBody = ObjectSerializer.stringify(
|
|
1772
|
-
ObjectSerializer.serialize(updateUserRequest, "UpdateUserRequest", ""),
|
|
1773
|
-
contentType
|
|
1774
|
-
);
|
|
1775
|
-
requestContext.setBody(serializedBody);
|
|
1776
2619
|
|
|
1777
2620
|
let authMethod: SecurityAuthentication | undefined;
|
|
1778
2621
|
// Apply auth methods
|
|
@@ -1843,6 +2686,42 @@ export class DefaultApiResponseProcessor {
|
|
|
1843
2686
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1844
2687
|
}
|
|
1845
2688
|
|
|
2689
|
+
/**
|
|
2690
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2691
|
+
* to the expected objects
|
|
2692
|
+
*
|
|
2693
|
+
* @params response Response returned by the server for a request to copyTemplateToApp
|
|
2694
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
2695
|
+
*/
|
|
2696
|
+
public async copyTemplateToApp(response: ResponseContext): Promise<TemplateResource > {
|
|
2697
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
2698
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
2699
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
2700
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2701
|
+
"TemplateResource", ""
|
|
2702
|
+
) as TemplateResource;
|
|
2703
|
+
return body;
|
|
2704
|
+
}
|
|
2705
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
2706
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
2707
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2708
|
+
"GenericError", ""
|
|
2709
|
+
) as GenericError;
|
|
2710
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
2714
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
2715
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
2716
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2717
|
+
"TemplateResource", ""
|
|
2718
|
+
) as TemplateResource;
|
|
2719
|
+
return body;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2723
|
+
}
|
|
2724
|
+
|
|
1846
2725
|
/**
|
|
1847
2726
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
1848
2727
|
* to the expected objects
|
|
@@ -1957,6 +2836,42 @@ export class DefaultApiResponseProcessor {
|
|
|
1957
2836
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1958
2837
|
}
|
|
1959
2838
|
|
|
2839
|
+
/**
|
|
2840
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2841
|
+
* to the expected objects
|
|
2842
|
+
*
|
|
2843
|
+
* @params response Response returned by the server for a request to createApiKey
|
|
2844
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
2845
|
+
*/
|
|
2846
|
+
public async createApiKey(response: ResponseContext): Promise<CreateApiKeyResponse > {
|
|
2847
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
2848
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
2849
|
+
const body: CreateApiKeyResponse = ObjectSerializer.deserialize(
|
|
2850
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2851
|
+
"CreateApiKeyResponse", ""
|
|
2852
|
+
) as CreateApiKeyResponse;
|
|
2853
|
+
return body;
|
|
2854
|
+
}
|
|
2855
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
2856
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
2857
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2858
|
+
"GenericError", ""
|
|
2859
|
+
) as GenericError;
|
|
2860
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
2864
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
2865
|
+
const body: CreateApiKeyResponse = ObjectSerializer.deserialize(
|
|
2866
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2867
|
+
"CreateApiKeyResponse", ""
|
|
2868
|
+
) as CreateApiKeyResponse;
|
|
2869
|
+
return body;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
1960
2875
|
/**
|
|
1961
2876
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
1962
2877
|
* to the expected objects
|
|
@@ -2000,6 +2915,56 @@ export class DefaultApiResponseProcessor {
|
|
|
2000
2915
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2001
2916
|
}
|
|
2002
2917
|
|
|
2918
|
+
/**
|
|
2919
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2920
|
+
* to the expected objects
|
|
2921
|
+
*
|
|
2922
|
+
* @params response Response returned by the server for a request to createCustomEvents
|
|
2923
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
2924
|
+
*/
|
|
2925
|
+
public async createCustomEvents(response: ResponseContext): Promise<object > {
|
|
2926
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
2927
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
2928
|
+
const body: object = ObjectSerializer.deserialize(
|
|
2929
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2930
|
+
"object", ""
|
|
2931
|
+
) as object;
|
|
2932
|
+
return body;
|
|
2933
|
+
}
|
|
2934
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
2935
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
2936
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2937
|
+
"GenericError", ""
|
|
2938
|
+
) as GenericError;
|
|
2939
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
2940
|
+
}
|
|
2941
|
+
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
2942
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
2943
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2944
|
+
"GenericError", ""
|
|
2945
|
+
) as GenericError;
|
|
2946
|
+
throw new ApiException<GenericError>(401, "Unauthorized", body, response.headers);
|
|
2947
|
+
}
|
|
2948
|
+
if (isCodeInRange("429", response.httpStatusCode)) {
|
|
2949
|
+
const body: RateLimitError = ObjectSerializer.deserialize(
|
|
2950
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2951
|
+
"RateLimitError", ""
|
|
2952
|
+
) as RateLimitError;
|
|
2953
|
+
throw new ApiException<RateLimitError>(429, "Rate Limit Exceeded", body, response.headers);
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
2957
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
2958
|
+
const body: object = ObjectSerializer.deserialize(
|
|
2959
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2960
|
+
"object", ""
|
|
2961
|
+
) as object;
|
|
2962
|
+
return body;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2003
2968
|
/**
|
|
2004
2969
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2005
2970
|
* to the expected objects
|
|
@@ -2157,6 +3122,49 @@ export class DefaultApiResponseProcessor {
|
|
|
2157
3122
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2158
3123
|
}
|
|
2159
3124
|
|
|
3125
|
+
/**
|
|
3126
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
3127
|
+
* to the expected objects
|
|
3128
|
+
*
|
|
3129
|
+
* @params response Response returned by the server for a request to createTemplate
|
|
3130
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
3131
|
+
*/
|
|
3132
|
+
public async createTemplate(response: ResponseContext): Promise<TemplateResource > {
|
|
3133
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
3134
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
3135
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
3136
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3137
|
+
"TemplateResource", ""
|
|
3138
|
+
) as TemplateResource;
|
|
3139
|
+
return body;
|
|
3140
|
+
}
|
|
3141
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
3142
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
3143
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3144
|
+
"GenericError", ""
|
|
3145
|
+
) as GenericError;
|
|
3146
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
3147
|
+
}
|
|
3148
|
+
if (isCodeInRange("422", response.httpStatusCode)) {
|
|
3149
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
3150
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3151
|
+
"GenericError", ""
|
|
3152
|
+
) as GenericError;
|
|
3153
|
+
throw new ApiException<GenericError>(422, "Unprocessable Entity", body, response.headers);
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
3157
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
3158
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
3159
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3160
|
+
"TemplateResource", ""
|
|
3161
|
+
) as TemplateResource;
|
|
3162
|
+
return body;
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3166
|
+
}
|
|
3167
|
+
|
|
2160
3168
|
/**
|
|
2161
3169
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2162
3170
|
* to the expected objects
|
|
@@ -2278,6 +3286,42 @@ export class DefaultApiResponseProcessor {
|
|
|
2278
3286
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2279
3287
|
}
|
|
2280
3288
|
|
|
3289
|
+
/**
|
|
3290
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
3291
|
+
* to the expected objects
|
|
3292
|
+
*
|
|
3293
|
+
* @params response Response returned by the server for a request to deleteApiKey
|
|
3294
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
3295
|
+
*/
|
|
3296
|
+
public async deleteApiKey(response: ResponseContext): Promise<object > {
|
|
3297
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
3298
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
3299
|
+
const body: object = ObjectSerializer.deserialize(
|
|
3300
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3301
|
+
"object", ""
|
|
3302
|
+
) as object;
|
|
3303
|
+
return body;
|
|
3304
|
+
}
|
|
3305
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
3306
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
3307
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3308
|
+
"GenericError", ""
|
|
3309
|
+
) as GenericError;
|
|
3310
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
3314
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
3315
|
+
const body: object = ObjectSerializer.deserialize(
|
|
3316
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3317
|
+
"object", ""
|
|
3318
|
+
) as object;
|
|
3319
|
+
return body;
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3323
|
+
}
|
|
3324
|
+
|
|
2281
3325
|
/**
|
|
2282
3326
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2283
3327
|
* to the expected objects
|
|
@@ -2373,8 +3417,51 @@ export class DefaultApiResponseProcessor {
|
|
|
2373
3417
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
2374
3418
|
const body: void = ObjectSerializer.deserialize(
|
|
2375
3419
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
2376
|
-
"void", ""
|
|
2377
|
-
) as void;
|
|
3420
|
+
"void", ""
|
|
3421
|
+
) as void;
|
|
3422
|
+
return body;
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3428
|
+
/**
|
|
3429
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
3430
|
+
* to the expected objects
|
|
3431
|
+
*
|
|
3432
|
+
* @params response Response returned by the server for a request to deleteTemplate
|
|
3433
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
3434
|
+
*/
|
|
3435
|
+
public async deleteTemplate(response: ResponseContext): Promise<GenericSuccessBoolResponse > {
|
|
3436
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
3437
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
3438
|
+
const body: GenericSuccessBoolResponse = ObjectSerializer.deserialize(
|
|
3439
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3440
|
+
"GenericSuccessBoolResponse", ""
|
|
3441
|
+
) as GenericSuccessBoolResponse;
|
|
3442
|
+
return body;
|
|
3443
|
+
}
|
|
3444
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
3445
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
3446
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3447
|
+
"GenericError", ""
|
|
3448
|
+
) as GenericError;
|
|
3449
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
3450
|
+
}
|
|
3451
|
+
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
3452
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
3453
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3454
|
+
"GenericError", ""
|
|
3455
|
+
) as GenericError;
|
|
3456
|
+
throw new ApiException<GenericError>(404, "Not Found", body, response.headers);
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
3460
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
3461
|
+
const body: GenericSuccessBoolResponse = ObjectSerializer.deserialize(
|
|
3462
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
3463
|
+
"GenericSuccessBoolResponse", ""
|
|
3464
|
+
) as GenericSuccessBoolResponse;
|
|
2378
3465
|
return body;
|
|
2379
3466
|
}
|
|
2380
3467
|
|
|
@@ -2978,6 +4065,85 @@ export class DefaultApiResponseProcessor {
|
|
|
2978
4065
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
2979
4066
|
}
|
|
2980
4067
|
|
|
4068
|
+
/**
|
|
4069
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4070
|
+
* to the expected objects
|
|
4071
|
+
*
|
|
4072
|
+
* @params response Response returned by the server for a request to rotateApiKey
|
|
4073
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4074
|
+
*/
|
|
4075
|
+
public async rotateApiKey(response: ResponseContext): Promise<CreateApiKeyResponse > {
|
|
4076
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4077
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4078
|
+
const body: CreateApiKeyResponse = ObjectSerializer.deserialize(
|
|
4079
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4080
|
+
"CreateApiKeyResponse", ""
|
|
4081
|
+
) as CreateApiKeyResponse;
|
|
4082
|
+
return body;
|
|
4083
|
+
}
|
|
4084
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4085
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4086
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4087
|
+
"GenericError", ""
|
|
4088
|
+
) as GenericError;
|
|
4089
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4093
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4094
|
+
const body: CreateApiKeyResponse = ObjectSerializer.deserialize(
|
|
4095
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4096
|
+
"CreateApiKeyResponse", ""
|
|
4097
|
+
) as CreateApiKeyResponse;
|
|
4098
|
+
return body;
|
|
4099
|
+
}
|
|
4100
|
+
|
|
4101
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
/**
|
|
4105
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4106
|
+
* to the expected objects
|
|
4107
|
+
*
|
|
4108
|
+
* @params response Response returned by the server for a request to startLiveActivity
|
|
4109
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4110
|
+
*/
|
|
4111
|
+
public async startLiveActivity(response: ResponseContext): Promise<StartLiveActivitySuccessResponse > {
|
|
4112
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4113
|
+
if (isCodeInRange("201", response.httpStatusCode)) {
|
|
4114
|
+
const body: StartLiveActivitySuccessResponse = ObjectSerializer.deserialize(
|
|
4115
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4116
|
+
"StartLiveActivitySuccessResponse", ""
|
|
4117
|
+
) as StartLiveActivitySuccessResponse;
|
|
4118
|
+
return body;
|
|
4119
|
+
}
|
|
4120
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4121
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4122
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4123
|
+
"GenericError", ""
|
|
4124
|
+
) as GenericError;
|
|
4125
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4126
|
+
}
|
|
4127
|
+
if (isCodeInRange("429", response.httpStatusCode)) {
|
|
4128
|
+
const body: RateLimitError = ObjectSerializer.deserialize(
|
|
4129
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4130
|
+
"RateLimitError", ""
|
|
4131
|
+
) as RateLimitError;
|
|
4132
|
+
throw new ApiException<RateLimitError>(429, "Rate Limit Exceeded", body, response.headers);
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4136
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4137
|
+
const body: StartLiveActivitySuccessResponse = ObjectSerializer.deserialize(
|
|
4138
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4139
|
+
"StartLiveActivitySuccessResponse", ""
|
|
4140
|
+
) as StartLiveActivitySuccessResponse;
|
|
4141
|
+
return body;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4145
|
+
}
|
|
4146
|
+
|
|
2981
4147
|
/**
|
|
2982
4148
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
2983
4149
|
* to the expected objects
|
|
@@ -3078,6 +4244,42 @@ export class DefaultApiResponseProcessor {
|
|
|
3078
4244
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3079
4245
|
}
|
|
3080
4246
|
|
|
4247
|
+
/**
|
|
4248
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4249
|
+
* to the expected objects
|
|
4250
|
+
*
|
|
4251
|
+
* @params response Response returned by the server for a request to updateApiKey
|
|
4252
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4253
|
+
*/
|
|
4254
|
+
public async updateApiKey(response: ResponseContext): Promise<object > {
|
|
4255
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4256
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4257
|
+
const body: object = ObjectSerializer.deserialize(
|
|
4258
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4259
|
+
"object", ""
|
|
4260
|
+
) as object;
|
|
4261
|
+
return body;
|
|
4262
|
+
}
|
|
4263
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4264
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4265
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4266
|
+
"GenericError", ""
|
|
4267
|
+
) as GenericError;
|
|
4268
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4271
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4272
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4273
|
+
const body: object = ObjectSerializer.deserialize(
|
|
4274
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4275
|
+
"object", ""
|
|
4276
|
+
) as object;
|
|
4277
|
+
return body;
|
|
4278
|
+
}
|
|
4279
|
+
|
|
4280
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4281
|
+
}
|
|
4282
|
+
|
|
3081
4283
|
/**
|
|
3082
4284
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
3083
4285
|
* to the expected objects
|
|
@@ -3217,6 +4419,85 @@ export class DefaultApiResponseProcessor {
|
|
|
3217
4419
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3218
4420
|
}
|
|
3219
4421
|
|
|
4422
|
+
/**
|
|
4423
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4424
|
+
* to the expected objects
|
|
4425
|
+
*
|
|
4426
|
+
* @params response Response returned by the server for a request to updateSubscriptionByToken
|
|
4427
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4428
|
+
*/
|
|
4429
|
+
public async updateSubscriptionByToken(response: ResponseContext): Promise<object > {
|
|
4430
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4431
|
+
if (isCodeInRange("202", response.httpStatusCode)) {
|
|
4432
|
+
const body: object = ObjectSerializer.deserialize(
|
|
4433
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4434
|
+
"object", ""
|
|
4435
|
+
) as object;
|
|
4436
|
+
return body;
|
|
4437
|
+
}
|
|
4438
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4439
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4440
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4441
|
+
"GenericError", ""
|
|
4442
|
+
) as GenericError;
|
|
4443
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4444
|
+
}
|
|
4445
|
+
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
4446
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4447
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4448
|
+
"GenericError", ""
|
|
4449
|
+
) as GenericError;
|
|
4450
|
+
throw new ApiException<GenericError>(404, "Not Found", body, response.headers);
|
|
4451
|
+
}
|
|
4452
|
+
|
|
4453
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4454
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4455
|
+
const body: object = ObjectSerializer.deserialize(
|
|
4456
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4457
|
+
"object", ""
|
|
4458
|
+
) as object;
|
|
4459
|
+
return body;
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4465
|
+
/**
|
|
4466
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4467
|
+
* to the expected objects
|
|
4468
|
+
*
|
|
4469
|
+
* @params response Response returned by the server for a request to updateTemplate
|
|
4470
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4471
|
+
*/
|
|
4472
|
+
public async updateTemplate(response: ResponseContext): Promise<TemplateResource > {
|
|
4473
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4474
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4475
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
4476
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4477
|
+
"TemplateResource", ""
|
|
4478
|
+
) as TemplateResource;
|
|
4479
|
+
return body;
|
|
4480
|
+
}
|
|
4481
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4482
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4483
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4484
|
+
"GenericError", ""
|
|
4485
|
+
) as GenericError;
|
|
4486
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4487
|
+
}
|
|
4488
|
+
|
|
4489
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4490
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4491
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
4492
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4493
|
+
"TemplateResource", ""
|
|
4494
|
+
) as TemplateResource;
|
|
4495
|
+
return body;
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4498
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4499
|
+
}
|
|
4500
|
+
|
|
3220
4501
|
/**
|
|
3221
4502
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
3222
4503
|
* to the expected objects
|
|
@@ -3267,4 +4548,126 @@ export class DefaultApiResponseProcessor {
|
|
|
3267
4548
|
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
3268
4549
|
}
|
|
3269
4550
|
|
|
4551
|
+
/**
|
|
4552
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4553
|
+
* to the expected objects
|
|
4554
|
+
*
|
|
4555
|
+
* @params response Response returned by the server for a request to viewApiKeys
|
|
4556
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4557
|
+
*/
|
|
4558
|
+
public async viewApiKeys(response: ResponseContext): Promise<ApiKeyTokensListResponse > {
|
|
4559
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4560
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4561
|
+
const body: ApiKeyTokensListResponse = ObjectSerializer.deserialize(
|
|
4562
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4563
|
+
"ApiKeyTokensListResponse", ""
|
|
4564
|
+
) as ApiKeyTokensListResponse;
|
|
4565
|
+
return body;
|
|
4566
|
+
}
|
|
4567
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4568
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4569
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4570
|
+
"GenericError", ""
|
|
4571
|
+
) as GenericError;
|
|
4572
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4573
|
+
}
|
|
4574
|
+
|
|
4575
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4576
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4577
|
+
const body: ApiKeyTokensListResponse = ObjectSerializer.deserialize(
|
|
4578
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4579
|
+
"ApiKeyTokensListResponse", ""
|
|
4580
|
+
) as ApiKeyTokensListResponse;
|
|
4581
|
+
return body;
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4585
|
+
}
|
|
4586
|
+
|
|
4587
|
+
/**
|
|
4588
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4589
|
+
* to the expected objects
|
|
4590
|
+
*
|
|
4591
|
+
* @params response Response returned by the server for a request to viewTemplate
|
|
4592
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4593
|
+
*/
|
|
4594
|
+
public async viewTemplate(response: ResponseContext): Promise<TemplateResource > {
|
|
4595
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4596
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4597
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
4598
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4599
|
+
"TemplateResource", ""
|
|
4600
|
+
) as TemplateResource;
|
|
4601
|
+
return body;
|
|
4602
|
+
}
|
|
4603
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4604
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4605
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4606
|
+
"GenericError", ""
|
|
4607
|
+
) as GenericError;
|
|
4608
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4609
|
+
}
|
|
4610
|
+
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
4611
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4612
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4613
|
+
"GenericError", ""
|
|
4614
|
+
) as GenericError;
|
|
4615
|
+
throw new ApiException<GenericError>(404, "Not Found", body, response.headers);
|
|
4616
|
+
}
|
|
4617
|
+
|
|
4618
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4619
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4620
|
+
const body: TemplateResource = ObjectSerializer.deserialize(
|
|
4621
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4622
|
+
"TemplateResource", ""
|
|
4623
|
+
) as TemplateResource;
|
|
4624
|
+
return body;
|
|
4625
|
+
}
|
|
4626
|
+
|
|
4627
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4628
|
+
}
|
|
4629
|
+
|
|
4630
|
+
/**
|
|
4631
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
4632
|
+
* to the expected objects
|
|
4633
|
+
*
|
|
4634
|
+
* @params response Response returned by the server for a request to viewTemplates
|
|
4635
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
4636
|
+
*/
|
|
4637
|
+
public async viewTemplates(response: ResponseContext): Promise<TemplatesListResponse > {
|
|
4638
|
+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
4639
|
+
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
4640
|
+
const body: TemplatesListResponse = ObjectSerializer.deserialize(
|
|
4641
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4642
|
+
"TemplatesListResponse", ""
|
|
4643
|
+
) as TemplatesListResponse;
|
|
4644
|
+
return body;
|
|
4645
|
+
}
|
|
4646
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
4647
|
+
const body: GenericError = ObjectSerializer.deserialize(
|
|
4648
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4649
|
+
"GenericError", ""
|
|
4650
|
+
) as GenericError;
|
|
4651
|
+
throw new ApiException<GenericError>(400, "Bad Request", body, response.headers);
|
|
4652
|
+
}
|
|
4653
|
+
if (isCodeInRange("429", response.httpStatusCode)) {
|
|
4654
|
+
const body: RateLimitError = ObjectSerializer.deserialize(
|
|
4655
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4656
|
+
"RateLimitError", ""
|
|
4657
|
+
) as RateLimitError;
|
|
4658
|
+
throw new ApiException<RateLimitError>(429, "Rate Limit Exceeded", body, response.headers);
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4661
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
4662
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
4663
|
+
const body: TemplatesListResponse = ObjectSerializer.deserialize(
|
|
4664
|
+
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
4665
|
+
"TemplatesListResponse", ""
|
|
4666
|
+
) as TemplatesListResponse;
|
|
4667
|
+
return body;
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4670
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
4671
|
+
}
|
|
4672
|
+
|
|
3270
4673
|
}
|