@onesignal/node-onesignal 1.0.0-beta3 → 1.0.0-beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/ask-question.yml +25 -0
- package/.github/ISSUE_TEMPLATE/bug-report.yml +51 -0
- package/.github/ISSUE_TEMPLATE/general-feedback.yml +25 -0
- package/.github/pull_request_template.md +44 -0
- package/.github/workflows/npm_deploy.yml +21 -0
- package/CHANGELOG.md +26 -0
- package/DefaultApi.md +1232 -0
- package/LICENSE +24 -0
- package/README.md +205 -102
- package/RELEASE_INSTRUCTIONS.md +2 -0
- package/apis/DefaultApi.ts +519 -532
- package/apis/baseapi.ts +4 -4
- package/apis/exception.ts +4 -3
- package/auth/auth.ts +4 -1
- package/configuration.ts +21 -2
- package/http/http.ts +26 -26
- package/index.ts +1 -0
- package/middleware.ts +1 -1
- package/models/App.ts +8 -8
- package/models/BasicNotification.ts +1019 -0
- package/models/BasicNotificationAllOf.ts +897 -0
- package/models/{NotificationAllOfAndroidBackgroundLayout.ts → BasicNotificationAllOfAndroidBackgroundLayout.ts} +4 -4
- package/models/Button.ts +2 -2
- package/models/CancelNotificationSuccessResponse.ts +31 -0
- package/models/{InlineResponse400.ts → CreateNotificationBadRequestResponse.ts} +4 -4
- package/models/{InlineResponse200.ts → CreateNotificationSuccessResponse.ts} +7 -6
- package/models/{InlineResponse2004.ts → CreatePlayerSuccessResponse.ts} +4 -4
- package/models/CreateSegmentBadRequestResponse.ts +38 -0
- package/models/{InlineResponse409.ts → CreateSegmentConflictResponse.ts} +4 -4
- package/models/{InlineResponse201.ts → CreateSegmentSuccessResponse.ts} +4 -4
- package/models/DeletePlayerBadRequestResponse.ts +31 -0
- package/models/DeletePlayerNotFoundResponse.ts +31 -0
- package/models/{InlineResponse2003.ts → DeletePlayerSuccessResponse.ts} +4 -4
- package/models/{InlineResponse4002.ts → DeleteSegmentBadRequestResponse.ts} +4 -4
- package/models/DeleteSegmentNotFoundResponse.ts +31 -0
- package/models/DeleteSegmentSuccessResponse.ts +31 -0
- package/models/DeliveryData.ts +17 -2
- package/models/ExportPlayersRequestBody.ts +5 -5
- package/models/{InlineResponse2005.ts → ExportPlayersSuccessResponse.ts} +4 -4
- package/models/Filter.ts +4 -4
- package/models/FilterExpressions.ts +4 -4
- package/models/FilterNotificationTarget.ts +2 -2
- package/models/GetNotificationRequestBody.ts +2 -2
- package/models/InvalidIdentifierError.ts +44 -0
- package/models/Notification.ts +72 -174
- package/models/Notification200Errors.ts +45 -0
- package/models/NotificationAllOf.ts +3 -858
- package/models/{InlineResponse4001.ts → NotificationHistoryBadRequestResponse.ts} +4 -4
- package/models/{InlineResponse2002.ts → NotificationHistorySuccessResponse.ts} +6 -6
- package/models/NotificationSlice.ts +5 -5
- package/models/NotificationTarget.ts +3 -124
- package/models/NotificationWithMeta.ts +1127 -0
- package/models/NotificationWithMetaAllOf.ts +132 -0
- package/models/ObjectSerializer.ts +97 -46
- package/models/Operator.ts +2 -2
- package/models/OutcomeData.ts +2 -2
- package/models/OutcomesData.ts +32 -0
- package/models/PlatformDeliveryData.ts +18 -2
- package/models/PlatformDeliveryDataEmailAllOf.ts +94 -0
- package/models/PlatformDeliveryDataSmsAllOf.ts +54 -0
- package/models/Player.ts +14 -14
- package/models/PlayerNotificationTarget.ts +3 -3
- package/models/PlayerSlice.ts +2 -2
- package/models/Purchase.ts +2 -2
- package/models/Segment.ts +3 -3
- package/models/SegmentNotificationTarget.ts +2 -2
- package/models/StringMap.ts +3 -3
- package/models/{InlineResponse2001.ts → UpdatePlayerSuccessResponse.ts} +6 -6
- package/models/UpdatePlayerTagsRequestBody.ts +4 -4
- package/models/UpdatePlayerTagsSuccessResponse.ts +31 -0
- package/models/all.ts +28 -13
- package/package.json +14 -9
- package/tsconfig.json +1 -2
- package/types/ObjectParamAPI.ts +101 -86
- package/types/ObservableAPI.ts +116 -101
- package/types/PromiseAPI.ts +97 -82
- package/util.ts +10 -1
- package/git_push.sh +0 -52
package/apis/DefaultApi.ts
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
// TODO: better import syntax?
|
|
2
|
-
import {
|
|
2
|
+
import {BaseAPIRequestFactory, RequiredError} from './baseapi';
|
|
3
3
|
import {Configuration} from '../configuration';
|
|
4
|
-
import {
|
|
4
|
+
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
|
5
5
|
import * as FormData from "form-data";
|
|
6
|
+
import { URLSearchParams } from 'url';
|
|
6
7
|
import {ObjectSerializer} from '../models/ObjectSerializer';
|
|
7
8
|
import {ApiException} from './exception';
|
|
8
|
-
import {isCodeInRange} from '../util';
|
|
9
|
+
import {canConsumeForm, isCodeInRange} from '../util';
|
|
10
|
+
import {SecurityAuthentication} from '../auth/auth';
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
import { App } from '../models/App';
|
|
14
|
+
import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse';
|
|
15
|
+
import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse';
|
|
16
|
+
import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
|
|
17
|
+
import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse';
|
|
18
|
+
import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse';
|
|
19
|
+
import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
|
|
20
|
+
import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
|
|
21
|
+
import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse';
|
|
22
|
+
import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse';
|
|
23
|
+
import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse';
|
|
24
|
+
import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse';
|
|
25
|
+
import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse';
|
|
26
|
+
import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse';
|
|
11
27
|
import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody';
|
|
28
|
+
import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse';
|
|
12
29
|
import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody';
|
|
13
|
-
import { InlineResponse200 } from '../models/InlineResponse200';
|
|
14
|
-
import { InlineResponse2001 } from '../models/InlineResponse2001';
|
|
15
|
-
import { InlineResponse2002 } from '../models/InlineResponse2002';
|
|
16
|
-
import { InlineResponse2003 } from '../models/InlineResponse2003';
|
|
17
|
-
import { InlineResponse2004 } from '../models/InlineResponse2004';
|
|
18
|
-
import { InlineResponse2005 } from '../models/InlineResponse2005';
|
|
19
|
-
import { InlineResponse201 } from '../models/InlineResponse201';
|
|
20
|
-
import { InlineResponse400 } from '../models/InlineResponse400';
|
|
21
|
-
import { InlineResponse4001 } from '../models/InlineResponse4001';
|
|
22
|
-
import { InlineResponse4002 } from '../models/InlineResponse4002';
|
|
23
|
-
import { InlineResponse409 } from '../models/InlineResponse409';
|
|
24
30
|
import { Notification } from '../models/Notification';
|
|
31
|
+
import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse';
|
|
32
|
+
import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
|
|
25
33
|
import { NotificationSlice } from '../models/NotificationSlice';
|
|
26
|
-
import {
|
|
34
|
+
import { NotificationWithMeta } from '../models/NotificationWithMeta';
|
|
35
|
+
import { OutcomesData } from '../models/OutcomesData';
|
|
27
36
|
import { Player } from '../models/Player';
|
|
28
37
|
import { PlayerSlice } from '../models/PlayerSlice';
|
|
29
38
|
import { Segment } from '../models/Segment';
|
|
39
|
+
import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse';
|
|
30
40
|
import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody';
|
|
41
|
+
import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse';
|
|
31
42
|
|
|
32
43
|
/**
|
|
33
44
|
* no description
|
|
@@ -37,49 +48,48 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
37
48
|
/**
|
|
38
49
|
* Used to stop a scheduled or currently outgoing notification
|
|
39
50
|
* Stop a scheduled or currently outgoing notification
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
51
|
+
* @param appId
|
|
52
|
+
* @param notificationId
|
|
42
53
|
*/
|
|
43
|
-
public async cancelNotification(
|
|
54
|
+
public async cancelNotification(appId: string, notificationId: string, _options?: Configuration): Promise<RequestContext> {
|
|
44
55
|
let _config = _options || this.configuration;
|
|
45
56
|
|
|
46
|
-
// verify required parameter '
|
|
47
|
-
if (
|
|
48
|
-
throw new RequiredError(
|
|
57
|
+
// verify required parameter 'appId' is not null or undefined
|
|
58
|
+
if (appId === null || appId === undefined) {
|
|
59
|
+
throw new RequiredError("DefaultApi", "cancelNotification", "appId");
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
|
|
52
|
-
// verify required parameter '
|
|
53
|
-
if (
|
|
54
|
-
throw new RequiredError(
|
|
63
|
+
// verify required parameter 'notificationId' is not null or undefined
|
|
64
|
+
if (notificationId === null || notificationId === undefined) {
|
|
65
|
+
throw new RequiredError("DefaultApi", "cancelNotification", "notificationId");
|
|
55
66
|
}
|
|
56
67
|
|
|
57
68
|
|
|
58
69
|
// Path Params
|
|
59
70
|
const localVarPath = '/notifications/{notification_id}'
|
|
60
|
-
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(
|
|
71
|
+
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
|
|
61
72
|
|
|
62
73
|
// Make Request Context
|
|
63
74
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
64
75
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
65
76
|
|
|
66
77
|
// Query Params
|
|
67
|
-
if (
|
|
68
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
78
|
+
if (appId !== undefined) {
|
|
79
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
69
80
|
}
|
|
70
81
|
|
|
71
|
-
// Header Params
|
|
72
|
-
|
|
73
|
-
// Form Params
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// Body Params
|
|
77
82
|
|
|
78
|
-
let authMethod
|
|
83
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
79
84
|
// Apply auth methods
|
|
80
85
|
authMethod = _config.authMethods["app_key"]
|
|
81
|
-
if (authMethod) {
|
|
82
|
-
await authMethod
|
|
86
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
87
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
91
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
92
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
83
93
|
}
|
|
84
94
|
|
|
85
95
|
return requestContext;
|
|
@@ -95,7 +105,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
95
105
|
|
|
96
106
|
// verify required parameter 'app' is not null or undefined
|
|
97
107
|
if (app === null || app === undefined) {
|
|
98
|
-
throw new RequiredError(
|
|
108
|
+
throw new RequiredError("DefaultApi", "createApp", "app");
|
|
99
109
|
}
|
|
100
110
|
|
|
101
111
|
|
|
@@ -106,12 +116,6 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
106
116
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
107
117
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
108
118
|
|
|
109
|
-
// Query Params
|
|
110
|
-
|
|
111
|
-
// Header Params
|
|
112
|
-
|
|
113
|
-
// Form Params
|
|
114
|
-
|
|
115
119
|
|
|
116
120
|
// Body Params
|
|
117
121
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -124,11 +128,16 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
124
128
|
);
|
|
125
129
|
requestContext.setBody(serializedBody);
|
|
126
130
|
|
|
127
|
-
let authMethod
|
|
131
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
128
132
|
// Apply auth methods
|
|
129
133
|
authMethod = _config.authMethods["user_key"]
|
|
130
|
-
if (authMethod) {
|
|
131
|
-
await authMethod
|
|
134
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
135
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
139
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
140
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
return requestContext;
|
|
@@ -144,7 +153,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
144
153
|
|
|
145
154
|
// verify required parameter 'notification' is not null or undefined
|
|
146
155
|
if (notification === null || notification === undefined) {
|
|
147
|
-
throw new RequiredError(
|
|
156
|
+
throw new RequiredError("DefaultApi", "createNotification", "notification");
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
|
|
@@ -155,12 +164,6 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
155
164
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
156
165
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
157
166
|
|
|
158
|
-
// Query Params
|
|
159
|
-
|
|
160
|
-
// Header Params
|
|
161
|
-
|
|
162
|
-
// Form Params
|
|
163
|
-
|
|
164
167
|
|
|
165
168
|
// Body Params
|
|
166
169
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -173,18 +176,23 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
173
176
|
);
|
|
174
177
|
requestContext.setBody(serializedBody);
|
|
175
178
|
|
|
176
|
-
let authMethod
|
|
179
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
177
180
|
// Apply auth methods
|
|
178
181
|
authMethod = _config.authMethods["app_key"]
|
|
179
|
-
if (authMethod) {
|
|
180
|
-
await authMethod
|
|
182
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
183
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
187
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
188
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
181
189
|
}
|
|
182
190
|
|
|
183
191
|
return requestContext;
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
/**
|
|
187
|
-
* Register a new device to one of your OneSignal apps
|
|
195
|
+
* Register a new device to one of your OneSignal apps 🚧 Don\'t use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won\'t work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
|
|
188
196
|
* Add a device
|
|
189
197
|
* @param player
|
|
190
198
|
*/
|
|
@@ -193,7 +201,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
193
201
|
|
|
194
202
|
// verify required parameter 'player' is not null or undefined
|
|
195
203
|
if (player === null || player === undefined) {
|
|
196
|
-
throw new RequiredError(
|
|
204
|
+
throw new RequiredError("DefaultApi", "createPlayer", "player");
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
|
|
@@ -204,12 +212,6 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
204
212
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
205
213
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
206
214
|
|
|
207
|
-
// Query Params
|
|
208
|
-
|
|
209
|
-
// Header Params
|
|
210
|
-
|
|
211
|
-
// Form Params
|
|
212
|
-
|
|
213
215
|
|
|
214
216
|
// Body Params
|
|
215
217
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -222,46 +224,45 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
222
224
|
);
|
|
223
225
|
requestContext.setBody(serializedBody);
|
|
224
226
|
|
|
225
|
-
let authMethod
|
|
227
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
226
228
|
// Apply auth methods
|
|
227
229
|
authMethod = _config.authMethods["app_key"]
|
|
228
|
-
if (authMethod) {
|
|
229
|
-
await authMethod
|
|
230
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
231
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
235
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
236
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
230
237
|
}
|
|
231
238
|
|
|
232
239
|
return requestContext;
|
|
233
240
|
}
|
|
234
241
|
|
|
235
242
|
/**
|
|
236
|
-
* Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's.
|
|
243
|
+
* Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator\'s. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
|
|
237
244
|
* Create Segments
|
|
238
|
-
* @param
|
|
245
|
+
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
239
246
|
* @param segment
|
|
240
247
|
*/
|
|
241
|
-
public async createSegments(
|
|
248
|
+
public async createSegments(appId: string, segment?: Segment, _options?: Configuration): Promise<RequestContext> {
|
|
242
249
|
let _config = _options || this.configuration;
|
|
243
250
|
|
|
244
|
-
// verify required parameter '
|
|
245
|
-
if (
|
|
246
|
-
throw new RequiredError(
|
|
251
|
+
// verify required parameter 'appId' is not null or undefined
|
|
252
|
+
if (appId === null || appId === undefined) {
|
|
253
|
+
throw new RequiredError("DefaultApi", "createSegments", "appId");
|
|
247
254
|
}
|
|
248
255
|
|
|
249
256
|
|
|
250
257
|
|
|
251
258
|
// Path Params
|
|
252
259
|
const localVarPath = '/apps/{app_id}/segments'
|
|
253
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
260
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
254
261
|
|
|
255
262
|
// Make Request Context
|
|
256
263
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
257
264
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
258
265
|
|
|
259
|
-
// Query Params
|
|
260
|
-
|
|
261
|
-
// Header Params
|
|
262
|
-
|
|
263
|
-
// Form Params
|
|
264
|
-
|
|
265
266
|
|
|
266
267
|
// Body Params
|
|
267
268
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -274,11 +275,16 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
274
275
|
);
|
|
275
276
|
requestContext.setBody(serializedBody);
|
|
276
277
|
|
|
277
|
-
let authMethod
|
|
278
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
278
279
|
// Apply auth methods
|
|
279
280
|
authMethod = _config.authMethods["app_key"]
|
|
280
|
-
if (authMethod) {
|
|
281
|
-
await authMethod
|
|
281
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
282
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
286
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
287
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
282
288
|
}
|
|
283
289
|
|
|
284
290
|
return requestContext;
|
|
@@ -287,49 +293,48 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
287
293
|
/**
|
|
288
294
|
* Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
|
|
289
295
|
* Delete a user record
|
|
290
|
-
* @param
|
|
291
|
-
* @param
|
|
296
|
+
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
297
|
+
* @param playerId The OneSignal player_id
|
|
292
298
|
*/
|
|
293
|
-
public async deletePlayer(
|
|
299
|
+
public async deletePlayer(appId: string, playerId: string, _options?: Configuration): Promise<RequestContext> {
|
|
294
300
|
let _config = _options || this.configuration;
|
|
295
301
|
|
|
296
|
-
// verify required parameter '
|
|
297
|
-
if (
|
|
298
|
-
throw new RequiredError(
|
|
302
|
+
// verify required parameter 'appId' is not null or undefined
|
|
303
|
+
if (appId === null || appId === undefined) {
|
|
304
|
+
throw new RequiredError("DefaultApi", "deletePlayer", "appId");
|
|
299
305
|
}
|
|
300
306
|
|
|
301
307
|
|
|
302
|
-
// verify required parameter '
|
|
303
|
-
if (
|
|
304
|
-
throw new RequiredError(
|
|
308
|
+
// verify required parameter 'playerId' is not null or undefined
|
|
309
|
+
if (playerId === null || playerId === undefined) {
|
|
310
|
+
throw new RequiredError("DefaultApi", "deletePlayer", "playerId");
|
|
305
311
|
}
|
|
306
312
|
|
|
307
313
|
|
|
308
314
|
// Path Params
|
|
309
315
|
const localVarPath = '/players/{player_id}'
|
|
310
|
-
.replace('{' + 'player_id' + '}', encodeURIComponent(String(
|
|
316
|
+
.replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
|
|
311
317
|
|
|
312
318
|
// Make Request Context
|
|
313
319
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
314
320
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
315
321
|
|
|
316
322
|
// Query Params
|
|
317
|
-
if (
|
|
318
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
323
|
+
if (appId !== undefined) {
|
|
324
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
319
325
|
}
|
|
320
326
|
|
|
321
|
-
// Header Params
|
|
322
327
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
// Body Params
|
|
327
|
-
|
|
328
|
-
let authMethod = null;
|
|
328
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
329
329
|
// Apply auth methods
|
|
330
330
|
authMethod = _config.authMethods["app_key"]
|
|
331
|
-
if (authMethod) {
|
|
332
|
-
await authMethod
|
|
331
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
332
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
336
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
337
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
333
338
|
}
|
|
334
339
|
|
|
335
340
|
return requestContext;
|
|
@@ -338,82 +343,73 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
338
343
|
/**
|
|
339
344
|
* Delete segments (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.
|
|
340
345
|
* Delete Segments
|
|
341
|
-
* @param
|
|
342
|
-
* @param
|
|
346
|
+
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
347
|
+
* @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
|
343
348
|
*/
|
|
344
|
-
public async deleteSegments(
|
|
349
|
+
public async deleteSegments(appId: string, segmentId: string, _options?: Configuration): Promise<RequestContext> {
|
|
345
350
|
let _config = _options || this.configuration;
|
|
346
351
|
|
|
347
|
-
// verify required parameter '
|
|
348
|
-
if (
|
|
349
|
-
throw new RequiredError(
|
|
352
|
+
// verify required parameter 'appId' is not null or undefined
|
|
353
|
+
if (appId === null || appId === undefined) {
|
|
354
|
+
throw new RequiredError("DefaultApi", "deleteSegments", "appId");
|
|
350
355
|
}
|
|
351
356
|
|
|
352
357
|
|
|
353
|
-
// verify required parameter '
|
|
354
|
-
if (
|
|
355
|
-
throw new RequiredError(
|
|
358
|
+
// verify required parameter 'segmentId' is not null or undefined
|
|
359
|
+
if (segmentId === null || segmentId === undefined) {
|
|
360
|
+
throw new RequiredError("DefaultApi", "deleteSegments", "segmentId");
|
|
356
361
|
}
|
|
357
362
|
|
|
358
363
|
|
|
359
364
|
// Path Params
|
|
360
365
|
const localVarPath = '/apps/{app_id}/segments/{segment_id}'
|
|
361
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
362
|
-
.replace('{' + 'segment_id' + '}', encodeURIComponent(String(
|
|
366
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
367
|
+
.replace('{' + 'segment_id' + '}', encodeURIComponent(String(segmentId)));
|
|
363
368
|
|
|
364
369
|
// Make Request Context
|
|
365
370
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
|
366
371
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
367
372
|
|
|
368
|
-
// Query Params
|
|
369
|
-
|
|
370
|
-
// Header Params
|
|
371
|
-
|
|
372
|
-
// Form Params
|
|
373
373
|
|
|
374
|
-
|
|
375
|
-
// Body Params
|
|
376
|
-
|
|
377
|
-
let authMethod = null;
|
|
374
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
378
375
|
// Apply auth methods
|
|
379
376
|
authMethod = _config.authMethods["app_key"]
|
|
380
|
-
if (authMethod) {
|
|
381
|
-
await authMethod
|
|
377
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
378
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
382
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
383
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
382
384
|
}
|
|
383
385
|
|
|
384
386
|
return requestContext;
|
|
385
387
|
}
|
|
386
388
|
|
|
387
389
|
/**
|
|
388
|
-
* Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable.
|
|
390
|
+
* Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
|
|
389
391
|
* CSV export
|
|
390
|
-
* @param
|
|
391
|
-
* @param
|
|
392
|
+
* @param appId The app ID that you want to export devices from
|
|
393
|
+
* @param exportPlayersRequestBody
|
|
392
394
|
*/
|
|
393
|
-
public async exportPlayers(
|
|
395
|
+
public async exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _options?: Configuration): Promise<RequestContext> {
|
|
394
396
|
let _config = _options || this.configuration;
|
|
395
397
|
|
|
396
|
-
// verify required parameter '
|
|
397
|
-
if (
|
|
398
|
-
throw new RequiredError(
|
|
398
|
+
// verify required parameter 'appId' is not null or undefined
|
|
399
|
+
if (appId === null || appId === undefined) {
|
|
400
|
+
throw new RequiredError("DefaultApi", "exportPlayers", "appId");
|
|
399
401
|
}
|
|
400
402
|
|
|
401
403
|
|
|
402
404
|
|
|
403
405
|
// Path Params
|
|
404
406
|
const localVarPath = '/players/csv_export?app_id={app_id}'
|
|
405
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
407
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
406
408
|
|
|
407
409
|
// Make Request Context
|
|
408
410
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
409
411
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
410
412
|
|
|
411
|
-
// Query Params
|
|
412
|
-
|
|
413
|
-
// Header Params
|
|
414
|
-
|
|
415
|
-
// Form Params
|
|
416
|
-
|
|
417
413
|
|
|
418
414
|
// Body Params
|
|
419
415
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -421,16 +417,21 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
421
417
|
]);
|
|
422
418
|
requestContext.setHeaderParam("Content-Type", contentType);
|
|
423
419
|
const serializedBody = ObjectSerializer.stringify(
|
|
424
|
-
ObjectSerializer.serialize(
|
|
420
|
+
ObjectSerializer.serialize(exportPlayersRequestBody, "ExportPlayersRequestBody", ""),
|
|
425
421
|
contentType
|
|
426
422
|
);
|
|
427
423
|
requestContext.setBody(serializedBody);
|
|
428
424
|
|
|
429
|
-
let authMethod
|
|
425
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
430
426
|
// Apply auth methods
|
|
431
427
|
authMethod = _config.authMethods["app_key"]
|
|
432
|
-
if (authMethod) {
|
|
433
|
-
await authMethod
|
|
428
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
429
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
433
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
434
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
434
435
|
}
|
|
435
436
|
|
|
436
437
|
return requestContext;
|
|
@@ -439,39 +440,36 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
439
440
|
/**
|
|
440
441
|
* View the details of a single OneSignal app
|
|
441
442
|
* View an app
|
|
442
|
-
* @param
|
|
443
|
+
* @param appId An app id
|
|
443
444
|
*/
|
|
444
|
-
public async getApp(
|
|
445
|
+
public async getApp(appId: string, _options?: Configuration): Promise<RequestContext> {
|
|
445
446
|
let _config = _options || this.configuration;
|
|
446
447
|
|
|
447
|
-
// verify required parameter '
|
|
448
|
-
if (
|
|
449
|
-
throw new RequiredError(
|
|
448
|
+
// verify required parameter 'appId' is not null or undefined
|
|
449
|
+
if (appId === null || appId === undefined) {
|
|
450
|
+
throw new RequiredError("DefaultApi", "getApp", "appId");
|
|
450
451
|
}
|
|
451
452
|
|
|
452
453
|
|
|
453
454
|
// Path Params
|
|
454
455
|
const localVarPath = '/apps/{app_id}'
|
|
455
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
456
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
456
457
|
|
|
457
458
|
// Make Request Context
|
|
458
459
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
459
460
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
460
461
|
|
|
461
|
-
// Query Params
|
|
462
|
-
|
|
463
|
-
// Header Params
|
|
464
|
-
|
|
465
|
-
// Form Params
|
|
466
|
-
|
|
467
462
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
let authMethod = null;
|
|
463
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
471
464
|
// Apply auth methods
|
|
472
465
|
authMethod = _config.authMethods["user_key"]
|
|
473
|
-
if (authMethod) {
|
|
474
|
-
await authMethod
|
|
466
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
467
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
471
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
472
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
475
473
|
}
|
|
476
474
|
|
|
477
475
|
return requestContext;
|
|
@@ -491,20 +489,17 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
491
489
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
492
490
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
493
491
|
|
|
494
|
-
// Query Params
|
|
495
492
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
// Form Params
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
// Body Params
|
|
502
|
-
|
|
503
|
-
let authMethod = null;
|
|
493
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
504
494
|
// Apply auth methods
|
|
505
495
|
authMethod = _config.authMethods["user_key"]
|
|
506
|
-
if (authMethod) {
|
|
507
|
-
await authMethod
|
|
496
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
497
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
501
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
502
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
508
503
|
}
|
|
509
504
|
|
|
510
505
|
return requestContext;
|
|
@@ -513,89 +508,82 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
513
508
|
/**
|
|
514
509
|
* View the details of a single notification and outcomes associated with it
|
|
515
510
|
* View notification
|
|
516
|
-
* @param
|
|
517
|
-
* @param
|
|
511
|
+
* @param appId
|
|
512
|
+
* @param notificationId
|
|
518
513
|
*/
|
|
519
|
-
public async getNotification(
|
|
514
|
+
public async getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<RequestContext> {
|
|
520
515
|
let _config = _options || this.configuration;
|
|
521
516
|
|
|
522
|
-
// verify required parameter '
|
|
523
|
-
if (
|
|
524
|
-
throw new RequiredError(
|
|
517
|
+
// verify required parameter 'appId' is not null or undefined
|
|
518
|
+
if (appId === null || appId === undefined) {
|
|
519
|
+
throw new RequiredError("DefaultApi", "getNotification", "appId");
|
|
525
520
|
}
|
|
526
521
|
|
|
527
522
|
|
|
528
|
-
// verify required parameter '
|
|
529
|
-
if (
|
|
530
|
-
throw new RequiredError(
|
|
523
|
+
// verify required parameter 'notificationId' is not null or undefined
|
|
524
|
+
if (notificationId === null || notificationId === undefined) {
|
|
525
|
+
throw new RequiredError("DefaultApi", "getNotification", "notificationId");
|
|
531
526
|
}
|
|
532
527
|
|
|
533
528
|
|
|
534
529
|
// Path Params
|
|
535
530
|
const localVarPath = '/notifications/{notification_id}'
|
|
536
|
-
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(
|
|
531
|
+
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
|
|
537
532
|
|
|
538
533
|
// Make Request Context
|
|
539
534
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
540
535
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
541
536
|
|
|
542
537
|
// Query Params
|
|
543
|
-
if (
|
|
544
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
538
|
+
if (appId !== undefined) {
|
|
539
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
545
540
|
}
|
|
546
541
|
|
|
547
|
-
// Header Params
|
|
548
|
-
|
|
549
|
-
// Form Params
|
|
550
|
-
|
|
551
542
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
let authMethod = null;
|
|
543
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
555
544
|
// Apply auth methods
|
|
556
545
|
authMethod = _config.authMethods["app_key"]
|
|
557
|
-
if (authMethod) {
|
|
558
|
-
await authMethod
|
|
546
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
547
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
551
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
552
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
559
553
|
}
|
|
560
554
|
|
|
561
555
|
return requestContext;
|
|
562
556
|
}
|
|
563
557
|
|
|
564
558
|
/**
|
|
565
|
-
* -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address.
|
|
559
|
+
* -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App\'s REST API Key, available in Keys & IDs.
|
|
566
560
|
* Notification History
|
|
567
|
-
* @param
|
|
568
|
-
* @param
|
|
561
|
+
* @param notificationId The \"id\" of the message found in the Notification object
|
|
562
|
+
* @param getNotificationRequestBody
|
|
569
563
|
*/
|
|
570
|
-
public async getNotificationHistory(
|
|
564
|
+
public async getNotificationHistory(notificationId: string, getNotificationRequestBody: GetNotificationRequestBody, _options?: Configuration): Promise<RequestContext> {
|
|
571
565
|
let _config = _options || this.configuration;
|
|
572
566
|
|
|
573
|
-
// verify required parameter '
|
|
574
|
-
if (
|
|
575
|
-
throw new RequiredError(
|
|
567
|
+
// verify required parameter 'notificationId' is not null or undefined
|
|
568
|
+
if (notificationId === null || notificationId === undefined) {
|
|
569
|
+
throw new RequiredError("DefaultApi", "getNotificationHistory", "notificationId");
|
|
576
570
|
}
|
|
577
571
|
|
|
578
572
|
|
|
579
|
-
// verify required parameter '
|
|
580
|
-
if (
|
|
581
|
-
throw new RequiredError(
|
|
573
|
+
// verify required parameter 'getNotificationRequestBody' is not null or undefined
|
|
574
|
+
if (getNotificationRequestBody === null || getNotificationRequestBody === undefined) {
|
|
575
|
+
throw new RequiredError("DefaultApi", "getNotificationHistory", "getNotificationRequestBody");
|
|
582
576
|
}
|
|
583
577
|
|
|
584
578
|
|
|
585
579
|
// Path Params
|
|
586
580
|
const localVarPath = '/notifications/{notification_id}/history'
|
|
587
|
-
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(
|
|
581
|
+
.replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
|
|
588
582
|
|
|
589
583
|
// Make Request Context
|
|
590
584
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
591
585
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
592
586
|
|
|
593
|
-
// Query Params
|
|
594
|
-
|
|
595
|
-
// Header Params
|
|
596
|
-
|
|
597
|
-
// Form Params
|
|
598
|
-
|
|
599
587
|
|
|
600
588
|
// Body Params
|
|
601
589
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -603,16 +591,21 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
603
591
|
]);
|
|
604
592
|
requestContext.setHeaderParam("Content-Type", contentType);
|
|
605
593
|
const serializedBody = ObjectSerializer.stringify(
|
|
606
|
-
ObjectSerializer.serialize(
|
|
594
|
+
ObjectSerializer.serialize(getNotificationRequestBody, "GetNotificationRequestBody", ""),
|
|
607
595
|
contentType
|
|
608
596
|
);
|
|
609
597
|
requestContext.setBody(serializedBody);
|
|
610
598
|
|
|
611
|
-
let authMethod
|
|
599
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
612
600
|
// Apply auth methods
|
|
613
601
|
authMethod = _config.authMethods["app_key"]
|
|
614
|
-
if (authMethod) {
|
|
615
|
-
await authMethod
|
|
602
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
603
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
607
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
608
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
616
609
|
}
|
|
617
610
|
|
|
618
611
|
return requestContext;
|
|
@@ -621,17 +614,17 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
621
614
|
/**
|
|
622
615
|
* View the details of multiple notifications
|
|
623
616
|
* View notifications
|
|
624
|
-
* @param
|
|
617
|
+
* @param appId The app ID that you want to view notifications from
|
|
625
618
|
* @param limit How many notifications to return. Max is 50. Default is 50.
|
|
626
619
|
* @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
|
|
627
620
|
* @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
|
|
628
621
|
*/
|
|
629
|
-
public async getNotifications(
|
|
622
|
+
public async getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<RequestContext> {
|
|
630
623
|
let _config = _options || this.configuration;
|
|
631
624
|
|
|
632
|
-
// verify required parameter '
|
|
633
|
-
if (
|
|
634
|
-
throw new RequiredError(
|
|
625
|
+
// verify required parameter 'appId' is not null or undefined
|
|
626
|
+
if (appId === null || appId === undefined) {
|
|
627
|
+
throw new RequiredError("DefaultApi", "getNotifications", "appId");
|
|
635
628
|
}
|
|
636
629
|
|
|
637
630
|
|
|
@@ -646,58 +639,63 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
646
639
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
647
640
|
|
|
648
641
|
// Query Params
|
|
649
|
-
if (
|
|
650
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
642
|
+
if (appId !== undefined) {
|
|
643
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
651
644
|
}
|
|
645
|
+
|
|
646
|
+
// Query Params
|
|
652
647
|
if (limit !== undefined) {
|
|
653
|
-
requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "
|
|
648
|
+
requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
|
|
654
649
|
}
|
|
650
|
+
|
|
651
|
+
// Query Params
|
|
655
652
|
if (offset !== undefined) {
|
|
656
653
|
requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
|
|
657
654
|
}
|
|
655
|
+
|
|
656
|
+
// Query Params
|
|
658
657
|
if (kind !== undefined) {
|
|
659
658
|
requestContext.setQueryParam("kind", ObjectSerializer.serialize(kind, "0 | 1 | 3", ""));
|
|
660
659
|
}
|
|
661
660
|
|
|
662
|
-
// Header Params
|
|
663
|
-
|
|
664
|
-
// Form Params
|
|
665
661
|
|
|
666
|
-
|
|
667
|
-
// Body Params
|
|
668
|
-
|
|
669
|
-
let authMethod = null;
|
|
662
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
670
663
|
// Apply auth methods
|
|
671
664
|
authMethod = _config.authMethods["app_key"]
|
|
672
|
-
if (authMethod) {
|
|
673
|
-
await authMethod
|
|
665
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
666
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
670
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
671
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
674
672
|
}
|
|
675
673
|
|
|
676
674
|
return requestContext;
|
|
677
675
|
}
|
|
678
676
|
|
|
679
677
|
/**
|
|
680
|
-
* View the details of all the outcomes associated with your app
|
|
678
|
+
* View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it.
|
|
681
679
|
* View Outcomes
|
|
682
|
-
* @param
|
|
683
|
-
* @param
|
|
684
|
-
* @param
|
|
685
|
-
* @param
|
|
686
|
-
* @param
|
|
687
|
-
* @param
|
|
680
|
+
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
681
|
+
* @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
|
|
682
|
+
* @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name.
|
|
683
|
+
* @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.
|
|
684
|
+
* @param outcomePlatforms Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
|
|
685
|
+
* @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
|
|
688
686
|
*/
|
|
689
|
-
public async getOutcomes(
|
|
687
|
+
public async getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<RequestContext> {
|
|
690
688
|
let _config = _options || this.configuration;
|
|
691
689
|
|
|
692
|
-
// verify required parameter '
|
|
693
|
-
if (
|
|
694
|
-
throw new RequiredError(
|
|
690
|
+
// verify required parameter 'appId' is not null or undefined
|
|
691
|
+
if (appId === null || appId === undefined) {
|
|
692
|
+
throw new RequiredError("DefaultApi", "getOutcomes", "appId");
|
|
695
693
|
}
|
|
696
694
|
|
|
697
695
|
|
|
698
|
-
// verify required parameter '
|
|
699
|
-
if (
|
|
700
|
-
throw new RequiredError(
|
|
696
|
+
// verify required parameter 'outcomeNames' is not null or undefined
|
|
697
|
+
if (outcomeNames === null || outcomeNames === undefined) {
|
|
698
|
+
throw new RequiredError("DefaultApi", "getOutcomes", "outcomeNames");
|
|
701
699
|
}
|
|
702
700
|
|
|
703
701
|
|
|
@@ -707,41 +705,48 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
707
705
|
|
|
708
706
|
// Path Params
|
|
709
707
|
const localVarPath = '/apps/{app_id}/outcomes'
|
|
710
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
708
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
711
709
|
|
|
712
710
|
// Make Request Context
|
|
713
711
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
714
712
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
715
713
|
|
|
716
714
|
// Query Params
|
|
717
|
-
if (
|
|
718
|
-
requestContext.setQueryParam("outcome_names", ObjectSerializer.serialize(
|
|
719
|
-
}
|
|
720
|
-
if (outcome_names2 !== undefined) {
|
|
721
|
-
requestContext.setQueryParam("outcome_names[]", ObjectSerializer.serialize(outcome_names2, "string", ""));
|
|
722
|
-
}
|
|
723
|
-
if (outcome_time_range !== undefined) {
|
|
724
|
-
requestContext.setQueryParam("outcome_time_range", ObjectSerializer.serialize(outcome_time_range, "string", ""));
|
|
715
|
+
if (outcomeNames !== undefined) {
|
|
716
|
+
requestContext.setQueryParam("outcome_names", ObjectSerializer.serialize(outcomeNames, "string", ""));
|
|
725
717
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
requestContext.setQueryParam("outcome_attribution", ObjectSerializer.serialize(outcome_attribution, "string", ""));
|
|
718
|
+
|
|
719
|
+
// Query Params
|
|
720
|
+
if (outcomeNames2 !== undefined) {
|
|
721
|
+
requestContext.setQueryParam("outcome_names[]", ObjectSerializer.serialize(outcomeNames2, "string", ""));
|
|
731
722
|
}
|
|
732
723
|
|
|
733
|
-
//
|
|
724
|
+
// Query Params
|
|
725
|
+
if (outcomeTimeRange !== undefined) {
|
|
726
|
+
requestContext.setQueryParam("outcome_time_range", ObjectSerializer.serialize(outcomeTimeRange, "string", ""));
|
|
727
|
+
}
|
|
734
728
|
|
|
735
|
-
//
|
|
729
|
+
// Query Params
|
|
730
|
+
if (outcomePlatforms !== undefined) {
|
|
731
|
+
requestContext.setQueryParam("outcome_platforms", ObjectSerializer.serialize(outcomePlatforms, "string", ""));
|
|
732
|
+
}
|
|
736
733
|
|
|
734
|
+
// Query Params
|
|
735
|
+
if (outcomeAttribution !== undefined) {
|
|
736
|
+
requestContext.setQueryParam("outcome_attribution", ObjectSerializer.serialize(outcomeAttribution, "string", ""));
|
|
737
|
+
}
|
|
737
738
|
|
|
738
|
-
// Body Params
|
|
739
739
|
|
|
740
|
-
let authMethod
|
|
740
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
741
741
|
// Apply auth methods
|
|
742
742
|
authMethod = _config.authMethods["app_key"]
|
|
743
|
-
if (authMethod) {
|
|
744
|
-
await authMethod
|
|
743
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
744
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
748
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
749
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
745
750
|
}
|
|
746
751
|
|
|
747
752
|
return requestContext;
|
|
@@ -750,54 +755,55 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
750
755
|
/**
|
|
751
756
|
* View the details of an existing device in one of your OneSignal apps
|
|
752
757
|
* View device
|
|
753
|
-
* @param
|
|
754
|
-
* @param
|
|
755
|
-
* @param
|
|
758
|
+
* @param appId Your app_id for this device
|
|
759
|
+
* @param playerId Player\'s OneSignal ID
|
|
760
|
+
* @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
|
756
761
|
*/
|
|
757
|
-
public async getPlayer(
|
|
762
|
+
public async getPlayer(appId: string, playerId: string, emailAuthHash?: string, _options?: Configuration): Promise<RequestContext> {
|
|
758
763
|
let _config = _options || this.configuration;
|
|
759
764
|
|
|
760
|
-
// verify required parameter '
|
|
761
|
-
if (
|
|
762
|
-
throw new RequiredError(
|
|
765
|
+
// verify required parameter 'appId' is not null or undefined
|
|
766
|
+
if (appId === null || appId === undefined) {
|
|
767
|
+
throw new RequiredError("DefaultApi", "getPlayer", "appId");
|
|
763
768
|
}
|
|
764
769
|
|
|
765
770
|
|
|
766
|
-
// verify required parameter '
|
|
767
|
-
if (
|
|
768
|
-
throw new RequiredError(
|
|
771
|
+
// verify required parameter 'playerId' is not null or undefined
|
|
772
|
+
if (playerId === null || playerId === undefined) {
|
|
773
|
+
throw new RequiredError("DefaultApi", "getPlayer", "playerId");
|
|
769
774
|
}
|
|
770
775
|
|
|
771
776
|
|
|
772
777
|
|
|
773
778
|
// Path Params
|
|
774
779
|
const localVarPath = '/players/{player_id}'
|
|
775
|
-
.replace('{' + 'player_id' + '}', encodeURIComponent(String(
|
|
780
|
+
.replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
|
|
776
781
|
|
|
777
782
|
// Make Request Context
|
|
778
783
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
779
784
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
780
785
|
|
|
781
786
|
// Query Params
|
|
782
|
-
if (
|
|
783
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
787
|
+
if (appId !== undefined) {
|
|
788
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
784
789
|
}
|
|
785
|
-
if (email_auth_hash !== undefined) {
|
|
786
|
-
requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(email_auth_hash, "string", ""));
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
// Header Params
|
|
790
|
-
|
|
791
|
-
// Form Params
|
|
792
790
|
|
|
791
|
+
// Query Params
|
|
792
|
+
if (emailAuthHash !== undefined) {
|
|
793
|
+
requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(emailAuthHash, "string", ""));
|
|
794
|
+
}
|
|
793
795
|
|
|
794
|
-
// Body Params
|
|
795
796
|
|
|
796
|
-
let authMethod
|
|
797
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
797
798
|
// Apply auth methods
|
|
798
799
|
authMethod = _config.authMethods["app_key"]
|
|
799
|
-
if (authMethod) {
|
|
800
|
-
await authMethod
|
|
800
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
801
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
805
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
806
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
801
807
|
}
|
|
802
808
|
|
|
803
809
|
return requestContext;
|
|
@@ -806,16 +812,16 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
806
812
|
/**
|
|
807
813
|
* View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant.
|
|
808
814
|
* View devices
|
|
809
|
-
* @param
|
|
815
|
+
* @param appId The app ID that you want to view players from
|
|
810
816
|
* @param limit How many devices to return. Max is 300. Default is 300
|
|
811
817
|
* @param offset Result offset. Default is 0. Results are sorted by id;
|
|
812
818
|
*/
|
|
813
|
-
public async getPlayers(
|
|
819
|
+
public async getPlayers(appId: string, limit?: number, offset?: number, _options?: Configuration): Promise<RequestContext> {
|
|
814
820
|
let _config = _options || this.configuration;
|
|
815
821
|
|
|
816
|
-
// verify required parameter '
|
|
817
|
-
if (
|
|
818
|
-
throw new RequiredError(
|
|
822
|
+
// verify required parameter 'appId' is not null or undefined
|
|
823
|
+
if (appId === null || appId === undefined) {
|
|
824
|
+
throw new RequiredError("DefaultApi", "getPlayers", "appId");
|
|
819
825
|
}
|
|
820
826
|
|
|
821
827
|
|
|
@@ -829,28 +835,31 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
829
835
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
830
836
|
|
|
831
837
|
// Query Params
|
|
832
|
-
if (
|
|
833
|
-
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(
|
|
838
|
+
if (appId !== undefined) {
|
|
839
|
+
requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
|
|
834
840
|
}
|
|
841
|
+
|
|
842
|
+
// Query Params
|
|
835
843
|
if (limit !== undefined) {
|
|
836
|
-
requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "
|
|
844
|
+
requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
|
|
837
845
|
}
|
|
846
|
+
|
|
847
|
+
// Query Params
|
|
838
848
|
if (offset !== undefined) {
|
|
839
849
|
requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
|
|
840
850
|
}
|
|
841
851
|
|
|
842
|
-
// Header Params
|
|
843
|
-
|
|
844
|
-
// Form Params
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
// Body Params
|
|
848
852
|
|
|
849
|
-
let authMethod
|
|
853
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
850
854
|
// Apply auth methods
|
|
851
855
|
authMethod = _config.authMethods["app_key"]
|
|
852
|
-
if (authMethod) {
|
|
853
|
-
await authMethod
|
|
856
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
857
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
861
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
862
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
854
863
|
}
|
|
855
864
|
|
|
856
865
|
return requestContext;
|
|
@@ -859,38 +868,32 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
859
868
|
/**
|
|
860
869
|
* Updates the name or configuration settings of an existing OneSignal app
|
|
861
870
|
* Update an app
|
|
862
|
-
* @param
|
|
871
|
+
* @param appId An app id
|
|
863
872
|
* @param app
|
|
864
873
|
*/
|
|
865
|
-
public async updateApp(
|
|
874
|
+
public async updateApp(appId: string, app: App, _options?: Configuration): Promise<RequestContext> {
|
|
866
875
|
let _config = _options || this.configuration;
|
|
867
876
|
|
|
868
|
-
// verify required parameter '
|
|
869
|
-
if (
|
|
870
|
-
throw new RequiredError(
|
|
877
|
+
// verify required parameter 'appId' is not null or undefined
|
|
878
|
+
if (appId === null || appId === undefined) {
|
|
879
|
+
throw new RequiredError("DefaultApi", "updateApp", "appId");
|
|
871
880
|
}
|
|
872
881
|
|
|
873
882
|
|
|
874
883
|
// verify required parameter 'app' is not null or undefined
|
|
875
884
|
if (app === null || app === undefined) {
|
|
876
|
-
throw new RequiredError(
|
|
885
|
+
throw new RequiredError("DefaultApi", "updateApp", "app");
|
|
877
886
|
}
|
|
878
887
|
|
|
879
888
|
|
|
880
889
|
// Path Params
|
|
881
890
|
const localVarPath = '/apps/{app_id}'
|
|
882
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
891
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
|
|
883
892
|
|
|
884
893
|
// Make Request Context
|
|
885
894
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
|
886
895
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
887
896
|
|
|
888
|
-
// Query Params
|
|
889
|
-
|
|
890
|
-
// Header Params
|
|
891
|
-
|
|
892
|
-
// Form Params
|
|
893
|
-
|
|
894
897
|
|
|
895
898
|
// Body Params
|
|
896
899
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -903,11 +906,16 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
903
906
|
);
|
|
904
907
|
requestContext.setBody(serializedBody);
|
|
905
908
|
|
|
906
|
-
let authMethod
|
|
909
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
907
910
|
// Apply auth methods
|
|
908
911
|
authMethod = _config.authMethods["user_key"]
|
|
909
|
-
if (authMethod) {
|
|
910
|
-
await authMethod
|
|
912
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
913
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
917
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
918
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
911
919
|
}
|
|
912
920
|
|
|
913
921
|
return requestContext;
|
|
@@ -916,38 +924,32 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
916
924
|
/**
|
|
917
925
|
* Update an existing device in one of your OneSignal apps
|
|
918
926
|
* Edit device
|
|
919
|
-
* @param
|
|
927
|
+
* @param playerId Player\'s OneSignal ID
|
|
920
928
|
* @param player
|
|
921
929
|
*/
|
|
922
|
-
public async updatePlayer(
|
|
930
|
+
public async updatePlayer(playerId: string, player: Player, _options?: Configuration): Promise<RequestContext> {
|
|
923
931
|
let _config = _options || this.configuration;
|
|
924
932
|
|
|
925
|
-
// verify required parameter '
|
|
926
|
-
if (
|
|
927
|
-
throw new RequiredError(
|
|
933
|
+
// verify required parameter 'playerId' is not null or undefined
|
|
934
|
+
if (playerId === null || playerId === undefined) {
|
|
935
|
+
throw new RequiredError("DefaultApi", "updatePlayer", "playerId");
|
|
928
936
|
}
|
|
929
937
|
|
|
930
938
|
|
|
931
939
|
// verify required parameter 'player' is not null or undefined
|
|
932
940
|
if (player === null || player === undefined) {
|
|
933
|
-
throw new RequiredError(
|
|
941
|
+
throw new RequiredError("DefaultApi", "updatePlayer", "player");
|
|
934
942
|
}
|
|
935
943
|
|
|
936
944
|
|
|
937
945
|
// Path Params
|
|
938
946
|
const localVarPath = '/players/{player_id}'
|
|
939
|
-
.replace('{' + 'player_id' + '}', encodeURIComponent(String(
|
|
947
|
+
.replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
|
|
940
948
|
|
|
941
949
|
// Make Request Context
|
|
942
950
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
|
943
951
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
944
952
|
|
|
945
|
-
// Query Params
|
|
946
|
-
|
|
947
|
-
// Header Params
|
|
948
|
-
|
|
949
|
-
// Form Params
|
|
950
|
-
|
|
951
953
|
|
|
952
954
|
// Body Params
|
|
953
955
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -960,54 +962,53 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
960
962
|
);
|
|
961
963
|
requestContext.setBody(serializedBody);
|
|
962
964
|
|
|
963
|
-
let authMethod
|
|
965
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
964
966
|
// Apply auth methods
|
|
965
967
|
authMethod = _config.authMethods["app_key"]
|
|
966
|
-
if (authMethod) {
|
|
967
|
-
await authMethod
|
|
968
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
969
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
973
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
974
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
968
975
|
}
|
|
969
976
|
|
|
970
977
|
return requestContext;
|
|
971
978
|
}
|
|
972
979
|
|
|
973
980
|
/**
|
|
974
|
-
* Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs.
|
|
981
|
+
* Update an existing device\'s tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device\'s tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
|
|
975
982
|
* Edit tags with external user id
|
|
976
|
-
* @param
|
|
977
|
-
* @param
|
|
978
|
-
* @param
|
|
983
|
+
* @param appId The OneSignal App ID the user record is found under.
|
|
984
|
+
* @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
|
|
985
|
+
* @param updatePlayerTagsRequestBody
|
|
979
986
|
*/
|
|
980
|
-
public async updatePlayerTags(
|
|
987
|
+
public async updatePlayerTags(appId: string, externalUserId: string, updatePlayerTagsRequestBody?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<RequestContext> {
|
|
981
988
|
let _config = _options || this.configuration;
|
|
982
989
|
|
|
983
|
-
// verify required parameter '
|
|
984
|
-
if (
|
|
985
|
-
throw new RequiredError(
|
|
990
|
+
// verify required parameter 'appId' is not null or undefined
|
|
991
|
+
if (appId === null || appId === undefined) {
|
|
992
|
+
throw new RequiredError("DefaultApi", "updatePlayerTags", "appId");
|
|
986
993
|
}
|
|
987
994
|
|
|
988
995
|
|
|
989
|
-
// verify required parameter '
|
|
990
|
-
if (
|
|
991
|
-
throw new RequiredError(
|
|
996
|
+
// verify required parameter 'externalUserId' is not null or undefined
|
|
997
|
+
if (externalUserId === null || externalUserId === undefined) {
|
|
998
|
+
throw new RequiredError("DefaultApi", "updatePlayerTags", "externalUserId");
|
|
992
999
|
}
|
|
993
1000
|
|
|
994
1001
|
|
|
995
1002
|
|
|
996
1003
|
// Path Params
|
|
997
1004
|
const localVarPath = '/apps/{app_id}/users/{external_user_id}'
|
|
998
|
-
.replace('{' + 'app_id' + '}', encodeURIComponent(String(
|
|
999
|
-
.replace('{' + 'external_user_id' + '}', encodeURIComponent(String(
|
|
1005
|
+
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
|
|
1006
|
+
.replace('{' + 'external_user_id' + '}', encodeURIComponent(String(externalUserId)));
|
|
1000
1007
|
|
|
1001
1008
|
// Make Request Context
|
|
1002
1009
|
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
|
1003
1010
|
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
1004
1011
|
|
|
1005
|
-
// Query Params
|
|
1006
|
-
|
|
1007
|
-
// Header Params
|
|
1008
|
-
|
|
1009
|
-
// Form Params
|
|
1010
|
-
|
|
1011
1012
|
|
|
1012
1013
|
// Body Params
|
|
1013
1014
|
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
@@ -1015,16 +1016,21 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
|
|
|
1015
1016
|
]);
|
|
1016
1017
|
requestContext.setHeaderParam("Content-Type", contentType);
|
|
1017
1018
|
const serializedBody = ObjectSerializer.stringify(
|
|
1018
|
-
ObjectSerializer.serialize(
|
|
1019
|
+
ObjectSerializer.serialize(updatePlayerTagsRequestBody, "UpdatePlayerTagsRequestBody", ""),
|
|
1019
1020
|
contentType
|
|
1020
1021
|
);
|
|
1021
1022
|
requestContext.setBody(serializedBody);
|
|
1022
1023
|
|
|
1023
|
-
let authMethod
|
|
1024
|
+
let authMethod: SecurityAuthentication | undefined;
|
|
1024
1025
|
// Apply auth methods
|
|
1025
1026
|
authMethod = _config.authMethods["app_key"]
|
|
1026
|
-
if (authMethod) {
|
|
1027
|
-
await authMethod
|
|
1027
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
1028
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
1032
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
1033
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
1028
1034
|
}
|
|
1029
1035
|
|
|
1030
1036
|
return requestContext;
|
|
@@ -1041,27 +1047,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1041
1047
|
* @params response Response returned by the server for a request to cancelNotification
|
|
1042
1048
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1043
1049
|
*/
|
|
1044
|
-
public async cancelNotification(response: ResponseContext): Promise<
|
|
1050
|
+
public async cancelNotification(response: ResponseContext): Promise<CancelNotificationSuccessResponse > {
|
|
1045
1051
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1046
1052
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1047
|
-
const body:
|
|
1053
|
+
const body: CancelNotificationSuccessResponse = ObjectSerializer.deserialize(
|
|
1048
1054
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1049
|
-
"
|
|
1050
|
-
) as
|
|
1055
|
+
"CancelNotificationSuccessResponse", ""
|
|
1056
|
+
) as CancelNotificationSuccessResponse;
|
|
1051
1057
|
return body;
|
|
1052
1058
|
}
|
|
1053
1059
|
|
|
1054
1060
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1055
1061
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1056
|
-
const body:
|
|
1062
|
+
const body: CancelNotificationSuccessResponse = ObjectSerializer.deserialize(
|
|
1057
1063
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1058
|
-
"
|
|
1059
|
-
) as
|
|
1064
|
+
"CancelNotificationSuccessResponse", ""
|
|
1065
|
+
) as CancelNotificationSuccessResponse;
|
|
1060
1066
|
return body;
|
|
1061
1067
|
}
|
|
1062
1068
|
|
|
1063
|
-
|
|
1064
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1069
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1065
1070
|
}
|
|
1066
1071
|
|
|
1067
1072
|
/**
|
|
@@ -1090,8 +1095,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1090
1095
|
return body;
|
|
1091
1096
|
}
|
|
1092
1097
|
|
|
1093
|
-
|
|
1094
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1098
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1095
1099
|
}
|
|
1096
1100
|
|
|
1097
1101
|
/**
|
|
@@ -1101,34 +1105,33 @@ export class DefaultApiResponseProcessor {
|
|
|
1101
1105
|
* @params response Response returned by the server for a request to createNotification
|
|
1102
1106
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1103
1107
|
*/
|
|
1104
|
-
public async createNotification(response: ResponseContext): Promise<
|
|
1108
|
+
public async createNotification(response: ResponseContext): Promise<CreateNotificationSuccessResponse > {
|
|
1105
1109
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1106
1110
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1107
|
-
const body:
|
|
1111
|
+
const body: CreateNotificationSuccessResponse = ObjectSerializer.deserialize(
|
|
1108
1112
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1109
|
-
"
|
|
1110
|
-
) as
|
|
1113
|
+
"CreateNotificationSuccessResponse", ""
|
|
1114
|
+
) as CreateNotificationSuccessResponse;
|
|
1111
1115
|
return body;
|
|
1112
1116
|
}
|
|
1113
1117
|
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1114
|
-
const body:
|
|
1118
|
+
const body: CreateNotificationBadRequestResponse = ObjectSerializer.deserialize(
|
|
1115
1119
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1116
|
-
"
|
|
1117
|
-
) as
|
|
1118
|
-
throw new ApiException<
|
|
1120
|
+
"CreateNotificationBadRequestResponse", ""
|
|
1121
|
+
) as CreateNotificationBadRequestResponse;
|
|
1122
|
+
throw new ApiException<CreateNotificationBadRequestResponse>(400, "Bad Request", body, response.headers);
|
|
1119
1123
|
}
|
|
1120
1124
|
|
|
1121
1125
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1122
1126
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1123
|
-
const body:
|
|
1127
|
+
const body: CreateNotificationSuccessResponse = ObjectSerializer.deserialize(
|
|
1124
1128
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1125
|
-
"
|
|
1126
|
-
) as
|
|
1129
|
+
"CreateNotificationSuccessResponse", ""
|
|
1130
|
+
) as CreateNotificationSuccessResponse;
|
|
1127
1131
|
return body;
|
|
1128
1132
|
}
|
|
1129
1133
|
|
|
1130
|
-
|
|
1131
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1134
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1132
1135
|
}
|
|
1133
1136
|
|
|
1134
1137
|
/**
|
|
@@ -1138,27 +1141,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1138
1141
|
* @params response Response returned by the server for a request to createPlayer
|
|
1139
1142
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1140
1143
|
*/
|
|
1141
|
-
public async createPlayer(response: ResponseContext): Promise<
|
|
1144
|
+
public async createPlayer(response: ResponseContext): Promise<CreatePlayerSuccessResponse > {
|
|
1142
1145
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1143
1146
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1144
|
-
const body:
|
|
1147
|
+
const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1145
1148
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1146
|
-
"
|
|
1147
|
-
) as
|
|
1149
|
+
"CreatePlayerSuccessResponse", ""
|
|
1150
|
+
) as CreatePlayerSuccessResponse;
|
|
1148
1151
|
return body;
|
|
1149
1152
|
}
|
|
1150
1153
|
|
|
1151
1154
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1152
1155
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1153
|
-
const body:
|
|
1156
|
+
const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1154
1157
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1155
|
-
"
|
|
1156
|
-
) as
|
|
1158
|
+
"CreatePlayerSuccessResponse", ""
|
|
1159
|
+
) as CreatePlayerSuccessResponse;
|
|
1157
1160
|
return body;
|
|
1158
1161
|
}
|
|
1159
1162
|
|
|
1160
|
-
|
|
1161
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1163
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1162
1164
|
}
|
|
1163
1165
|
|
|
1164
1166
|
/**
|
|
@@ -1168,41 +1170,40 @@ export class DefaultApiResponseProcessor {
|
|
|
1168
1170
|
* @params response Response returned by the server for a request to createSegments
|
|
1169
1171
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1170
1172
|
*/
|
|
1171
|
-
public async createSegments(response: ResponseContext): Promise<
|
|
1173
|
+
public async createSegments(response: ResponseContext): Promise<CreateSegmentSuccessResponse > {
|
|
1172
1174
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1173
1175
|
if (isCodeInRange("201", response.httpStatusCode)) {
|
|
1174
|
-
const body:
|
|
1176
|
+
const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
|
|
1175
1177
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1176
|
-
"
|
|
1177
|
-
) as
|
|
1178
|
+
"CreateSegmentSuccessResponse", ""
|
|
1179
|
+
) as CreateSegmentSuccessResponse;
|
|
1178
1180
|
return body;
|
|
1179
1181
|
}
|
|
1180
|
-
if (isCodeInRange("
|
|
1181
|
-
const body:
|
|
1182
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1183
|
+
const body: CreateSegmentBadRequestResponse = ObjectSerializer.deserialize(
|
|
1182
1184
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1183
|
-
"
|
|
1184
|
-
) as
|
|
1185
|
-
throw new ApiException<
|
|
1185
|
+
"CreateSegmentBadRequestResponse", ""
|
|
1186
|
+
) as CreateSegmentBadRequestResponse;
|
|
1187
|
+
throw new ApiException<CreateSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
|
|
1186
1188
|
}
|
|
1187
|
-
if (isCodeInRange("
|
|
1188
|
-
const body:
|
|
1189
|
+
if (isCodeInRange("409", response.httpStatusCode)) {
|
|
1190
|
+
const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize(
|
|
1189
1191
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1190
|
-
"
|
|
1191
|
-
) as
|
|
1192
|
-
throw new ApiException<
|
|
1192
|
+
"CreateSegmentConflictResponse", ""
|
|
1193
|
+
) as CreateSegmentConflictResponse;
|
|
1194
|
+
throw new ApiException<CreateSegmentConflictResponse>(409, "Conflict", body, response.headers);
|
|
1193
1195
|
}
|
|
1194
1196
|
|
|
1195
1197
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1196
1198
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1197
|
-
const body:
|
|
1199
|
+
const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
|
|
1198
1200
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1199
|
-
"
|
|
1200
|
-
) as
|
|
1201
|
+
"CreateSegmentSuccessResponse", ""
|
|
1202
|
+
) as CreateSegmentSuccessResponse;
|
|
1201
1203
|
return body;
|
|
1202
1204
|
}
|
|
1203
1205
|
|
|
1204
|
-
|
|
1205
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1206
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1206
1207
|
}
|
|
1207
1208
|
|
|
1208
1209
|
/**
|
|
@@ -1212,41 +1213,40 @@ export class DefaultApiResponseProcessor {
|
|
|
1212
1213
|
* @params response Response returned by the server for a request to deletePlayer
|
|
1213
1214
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1214
1215
|
*/
|
|
1215
|
-
public async deletePlayer(response: ResponseContext): Promise<
|
|
1216
|
+
public async deletePlayer(response: ResponseContext): Promise<DeletePlayerSuccessResponse > {
|
|
1216
1217
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1217
1218
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1218
|
-
const body:
|
|
1219
|
+
const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1219
1220
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1220
|
-
"
|
|
1221
|
-
) as
|
|
1221
|
+
"DeletePlayerSuccessResponse", ""
|
|
1222
|
+
) as DeletePlayerSuccessResponse;
|
|
1222
1223
|
return body;
|
|
1223
1224
|
}
|
|
1224
|
-
if (isCodeInRange("
|
|
1225
|
-
const body:
|
|
1225
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1226
|
+
const body: DeletePlayerBadRequestResponse = ObjectSerializer.deserialize(
|
|
1226
1227
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1227
|
-
"
|
|
1228
|
-
) as
|
|
1229
|
-
throw new ApiException<
|
|
1228
|
+
"DeletePlayerBadRequestResponse", ""
|
|
1229
|
+
) as DeletePlayerBadRequestResponse;
|
|
1230
|
+
throw new ApiException<DeletePlayerBadRequestResponse>(400, "Bad Request", body, response.headers);
|
|
1230
1231
|
}
|
|
1231
|
-
if (isCodeInRange("
|
|
1232
|
-
const body:
|
|
1232
|
+
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
1233
|
+
const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize(
|
|
1233
1234
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1234
|
-
"
|
|
1235
|
-
) as
|
|
1236
|
-
throw new ApiException<
|
|
1235
|
+
"DeletePlayerNotFoundResponse", ""
|
|
1236
|
+
) as DeletePlayerNotFoundResponse;
|
|
1237
|
+
throw new ApiException<DeletePlayerNotFoundResponse>(404, "Not Found", body, response.headers);
|
|
1237
1238
|
}
|
|
1238
1239
|
|
|
1239
1240
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1240
1241
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1241
|
-
const body:
|
|
1242
|
+
const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1242
1243
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1243
|
-
"
|
|
1244
|
-
) as
|
|
1244
|
+
"DeletePlayerSuccessResponse", ""
|
|
1245
|
+
) as DeletePlayerSuccessResponse;
|
|
1245
1246
|
return body;
|
|
1246
1247
|
}
|
|
1247
1248
|
|
|
1248
|
-
|
|
1249
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1249
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1250
1250
|
}
|
|
1251
1251
|
|
|
1252
1252
|
/**
|
|
@@ -1256,41 +1256,40 @@ export class DefaultApiResponseProcessor {
|
|
|
1256
1256
|
* @params response Response returned by the server for a request to deleteSegments
|
|
1257
1257
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1258
1258
|
*/
|
|
1259
|
-
public async deleteSegments(response: ResponseContext): Promise<
|
|
1259
|
+
public async deleteSegments(response: ResponseContext): Promise<DeleteSegmentSuccessResponse > {
|
|
1260
1260
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1261
1261
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1262
|
-
const body:
|
|
1262
|
+
const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
|
|
1263
1263
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1264
|
-
"
|
|
1265
|
-
) as
|
|
1264
|
+
"DeleteSegmentSuccessResponse", ""
|
|
1265
|
+
) as DeleteSegmentSuccessResponse;
|
|
1266
1266
|
return body;
|
|
1267
1267
|
}
|
|
1268
|
-
if (isCodeInRange("
|
|
1269
|
-
const body:
|
|
1268
|
+
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1269
|
+
const body: DeleteSegmentBadRequestResponse = ObjectSerializer.deserialize(
|
|
1270
1270
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1271
|
-
"
|
|
1272
|
-
) as
|
|
1273
|
-
throw new ApiException<
|
|
1271
|
+
"DeleteSegmentBadRequestResponse", ""
|
|
1272
|
+
) as DeleteSegmentBadRequestResponse;
|
|
1273
|
+
throw new ApiException<DeleteSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
|
|
1274
1274
|
}
|
|
1275
|
-
if (isCodeInRange("
|
|
1276
|
-
const body:
|
|
1275
|
+
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
1276
|
+
const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize(
|
|
1277
1277
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1278
|
-
"
|
|
1279
|
-
) as
|
|
1280
|
-
throw new ApiException<
|
|
1278
|
+
"DeleteSegmentNotFoundResponse", ""
|
|
1279
|
+
) as DeleteSegmentNotFoundResponse;
|
|
1280
|
+
throw new ApiException<DeleteSegmentNotFoundResponse>(404, "Not Found", body, response.headers);
|
|
1281
1281
|
}
|
|
1282
1282
|
|
|
1283
1283
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1284
1284
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1285
|
-
const body:
|
|
1285
|
+
const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
|
|
1286
1286
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1287
|
-
"
|
|
1288
|
-
) as
|
|
1287
|
+
"DeleteSegmentSuccessResponse", ""
|
|
1288
|
+
) as DeleteSegmentSuccessResponse;
|
|
1289
1289
|
return body;
|
|
1290
1290
|
}
|
|
1291
1291
|
|
|
1292
|
-
|
|
1293
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1292
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1294
1293
|
}
|
|
1295
1294
|
|
|
1296
1295
|
/**
|
|
@@ -1300,34 +1299,33 @@ export class DefaultApiResponseProcessor {
|
|
|
1300
1299
|
* @params response Response returned by the server for a request to exportPlayers
|
|
1301
1300
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1302
1301
|
*/
|
|
1303
|
-
public async exportPlayers(response: ResponseContext): Promise<
|
|
1302
|
+
public async exportPlayers(response: ResponseContext): Promise<ExportPlayersSuccessResponse > {
|
|
1304
1303
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1305
1304
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1306
|
-
const body:
|
|
1305
|
+
const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
|
|
1307
1306
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1308
|
-
"
|
|
1309
|
-
) as
|
|
1307
|
+
"ExportPlayersSuccessResponse", ""
|
|
1308
|
+
) as ExportPlayersSuccessResponse;
|
|
1310
1309
|
return body;
|
|
1311
1310
|
}
|
|
1312
1311
|
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1313
|
-
const body:
|
|
1312
|
+
const body: object = ObjectSerializer.deserialize(
|
|
1314
1313
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1315
|
-
"
|
|
1316
|
-
) as
|
|
1317
|
-
throw new ApiException<
|
|
1314
|
+
"object", ""
|
|
1315
|
+
) as object;
|
|
1316
|
+
throw new ApiException<object>(400, "Bad Request", body, response.headers);
|
|
1318
1317
|
}
|
|
1319
1318
|
|
|
1320
1319
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1321
1320
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1322
|
-
const body:
|
|
1321
|
+
const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
|
|
1323
1322
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1324
|
-
"
|
|
1325
|
-
) as
|
|
1323
|
+
"ExportPlayersSuccessResponse", ""
|
|
1324
|
+
) as ExportPlayersSuccessResponse;
|
|
1326
1325
|
return body;
|
|
1327
1326
|
}
|
|
1328
1327
|
|
|
1329
|
-
|
|
1330
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1328
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1331
1329
|
}
|
|
1332
1330
|
|
|
1333
1331
|
/**
|
|
@@ -1356,8 +1354,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1356
1354
|
return body;
|
|
1357
1355
|
}
|
|
1358
1356
|
|
|
1359
|
-
|
|
1360
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1357
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1361
1358
|
}
|
|
1362
1359
|
|
|
1363
1360
|
/**
|
|
@@ -1367,27 +1364,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1367
1364
|
* @params response Response returned by the server for a request to getApps
|
|
1368
1365
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1369
1366
|
*/
|
|
1370
|
-
public async getApps(response: ResponseContext): Promise<
|
|
1367
|
+
public async getApps(response: ResponseContext): Promise<Array<App> > {
|
|
1371
1368
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1372
1369
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1373
|
-
const body:
|
|
1370
|
+
const body: Array<App> = ObjectSerializer.deserialize(
|
|
1374
1371
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1375
|
-
"
|
|
1376
|
-
) as
|
|
1372
|
+
"Array<App>", ""
|
|
1373
|
+
) as Array<App>;
|
|
1377
1374
|
return body;
|
|
1378
1375
|
}
|
|
1379
1376
|
|
|
1380
1377
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1381
1378
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1382
|
-
const body:
|
|
1379
|
+
const body: Array<App> = ObjectSerializer.deserialize(
|
|
1383
1380
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1384
|
-
"
|
|
1385
|
-
) as
|
|
1381
|
+
"Array<App>", ""
|
|
1382
|
+
) as Array<App>;
|
|
1386
1383
|
return body;
|
|
1387
1384
|
}
|
|
1388
1385
|
|
|
1389
|
-
|
|
1390
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1386
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1391
1387
|
}
|
|
1392
1388
|
|
|
1393
1389
|
/**
|
|
@@ -1397,27 +1393,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1397
1393
|
* @params response Response returned by the server for a request to getNotification
|
|
1398
1394
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1399
1395
|
*/
|
|
1400
|
-
public async getNotification(response: ResponseContext): Promise<
|
|
1396
|
+
public async getNotification(response: ResponseContext): Promise<NotificationWithMeta > {
|
|
1401
1397
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1402
1398
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1403
|
-
const body:
|
|
1399
|
+
const body: NotificationWithMeta = ObjectSerializer.deserialize(
|
|
1404
1400
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1405
|
-
"
|
|
1406
|
-
) as
|
|
1401
|
+
"NotificationWithMeta", ""
|
|
1402
|
+
) as NotificationWithMeta;
|
|
1407
1403
|
return body;
|
|
1408
1404
|
}
|
|
1409
1405
|
|
|
1410
1406
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1411
1407
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1412
|
-
const body:
|
|
1408
|
+
const body: NotificationWithMeta = ObjectSerializer.deserialize(
|
|
1413
1409
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1414
|
-
"
|
|
1415
|
-
) as
|
|
1410
|
+
"NotificationWithMeta", ""
|
|
1411
|
+
) as NotificationWithMeta;
|
|
1416
1412
|
return body;
|
|
1417
1413
|
}
|
|
1418
1414
|
|
|
1419
|
-
|
|
1420
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1415
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1421
1416
|
}
|
|
1422
1417
|
|
|
1423
1418
|
/**
|
|
@@ -1427,34 +1422,33 @@ export class DefaultApiResponseProcessor {
|
|
|
1427
1422
|
* @params response Response returned by the server for a request to getNotificationHistory
|
|
1428
1423
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1429
1424
|
*/
|
|
1430
|
-
public async getNotificationHistory(response: ResponseContext): Promise<
|
|
1425
|
+
public async getNotificationHistory(response: ResponseContext): Promise<NotificationHistorySuccessResponse > {
|
|
1431
1426
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1432
1427
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1433
|
-
const body:
|
|
1428
|
+
const body: NotificationHistorySuccessResponse = ObjectSerializer.deserialize(
|
|
1434
1429
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1435
|
-
"
|
|
1436
|
-
) as
|
|
1430
|
+
"NotificationHistorySuccessResponse", ""
|
|
1431
|
+
) as NotificationHistorySuccessResponse;
|
|
1437
1432
|
return body;
|
|
1438
1433
|
}
|
|
1439
1434
|
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
1440
|
-
const body:
|
|
1435
|
+
const body: NotificationHistoryBadRequestResponse = ObjectSerializer.deserialize(
|
|
1441
1436
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1442
|
-
"
|
|
1443
|
-
) as
|
|
1444
|
-
throw new ApiException<
|
|
1437
|
+
"NotificationHistoryBadRequestResponse", ""
|
|
1438
|
+
) as NotificationHistoryBadRequestResponse;
|
|
1439
|
+
throw new ApiException<NotificationHistoryBadRequestResponse>(400, "Bad Request", body, response.headers);
|
|
1445
1440
|
}
|
|
1446
1441
|
|
|
1447
1442
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1448
1443
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1449
|
-
const body:
|
|
1444
|
+
const body: NotificationHistorySuccessResponse = ObjectSerializer.deserialize(
|
|
1450
1445
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1451
|
-
"
|
|
1452
|
-
) as
|
|
1446
|
+
"NotificationHistorySuccessResponse", ""
|
|
1447
|
+
) as NotificationHistorySuccessResponse;
|
|
1453
1448
|
return body;
|
|
1454
1449
|
}
|
|
1455
1450
|
|
|
1456
|
-
|
|
1457
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1451
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1458
1452
|
}
|
|
1459
1453
|
|
|
1460
1454
|
/**
|
|
@@ -1483,8 +1477,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1483
1477
|
return body;
|
|
1484
1478
|
}
|
|
1485
1479
|
|
|
1486
|
-
|
|
1487
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1480
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1488
1481
|
}
|
|
1489
1482
|
|
|
1490
1483
|
/**
|
|
@@ -1494,27 +1487,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1494
1487
|
* @params response Response returned by the server for a request to getOutcomes
|
|
1495
1488
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1496
1489
|
*/
|
|
1497
|
-
public async getOutcomes(response: ResponseContext): Promise<
|
|
1490
|
+
public async getOutcomes(response: ResponseContext): Promise<OutcomesData > {
|
|
1498
1491
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1499
1492
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1500
|
-
const body:
|
|
1493
|
+
const body: OutcomesData = ObjectSerializer.deserialize(
|
|
1501
1494
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1502
|
-
"
|
|
1503
|
-
) as
|
|
1495
|
+
"OutcomesData", ""
|
|
1496
|
+
) as OutcomesData;
|
|
1504
1497
|
return body;
|
|
1505
1498
|
}
|
|
1506
1499
|
|
|
1507
1500
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1508
1501
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1509
|
-
const body:
|
|
1502
|
+
const body: OutcomesData = ObjectSerializer.deserialize(
|
|
1510
1503
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1511
|
-
"
|
|
1512
|
-
) as
|
|
1504
|
+
"OutcomesData", ""
|
|
1505
|
+
) as OutcomesData;
|
|
1513
1506
|
return body;
|
|
1514
1507
|
}
|
|
1515
1508
|
|
|
1516
|
-
|
|
1517
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1509
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1518
1510
|
}
|
|
1519
1511
|
|
|
1520
1512
|
/**
|
|
@@ -1543,8 +1535,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1543
1535
|
return body;
|
|
1544
1536
|
}
|
|
1545
1537
|
|
|
1546
|
-
|
|
1547
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1538
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1548
1539
|
}
|
|
1549
1540
|
|
|
1550
1541
|
/**
|
|
@@ -1573,8 +1564,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1573
1564
|
return body;
|
|
1574
1565
|
}
|
|
1575
1566
|
|
|
1576
|
-
|
|
1577
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1567
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1578
1568
|
}
|
|
1579
1569
|
|
|
1580
1570
|
/**
|
|
@@ -1603,8 +1593,7 @@ export class DefaultApiResponseProcessor {
|
|
|
1603
1593
|
return body;
|
|
1604
1594
|
}
|
|
1605
1595
|
|
|
1606
|
-
|
|
1607
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1596
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1608
1597
|
}
|
|
1609
1598
|
|
|
1610
1599
|
/**
|
|
@@ -1614,27 +1603,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1614
1603
|
* @params response Response returned by the server for a request to updatePlayer
|
|
1615
1604
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1616
1605
|
*/
|
|
1617
|
-
public async updatePlayer(response: ResponseContext): Promise<
|
|
1606
|
+
public async updatePlayer(response: ResponseContext): Promise<UpdatePlayerSuccessResponse > {
|
|
1618
1607
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1619
1608
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1620
|
-
const body:
|
|
1609
|
+
const body: UpdatePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1621
1610
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1622
|
-
"
|
|
1623
|
-
) as
|
|
1611
|
+
"UpdatePlayerSuccessResponse", ""
|
|
1612
|
+
) as UpdatePlayerSuccessResponse;
|
|
1624
1613
|
return body;
|
|
1625
1614
|
}
|
|
1626
1615
|
|
|
1627
1616
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1628
1617
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1629
|
-
const body:
|
|
1618
|
+
const body: UpdatePlayerSuccessResponse = ObjectSerializer.deserialize(
|
|
1630
1619
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1631
|
-
"
|
|
1632
|
-
) as
|
|
1620
|
+
"UpdatePlayerSuccessResponse", ""
|
|
1621
|
+
) as UpdatePlayerSuccessResponse;
|
|
1633
1622
|
return body;
|
|
1634
1623
|
}
|
|
1635
1624
|
|
|
1636
|
-
|
|
1637
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1625
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1638
1626
|
}
|
|
1639
1627
|
|
|
1640
1628
|
/**
|
|
@@ -1644,27 +1632,26 @@ export class DefaultApiResponseProcessor {
|
|
|
1644
1632
|
* @params response Response returned by the server for a request to updatePlayerTags
|
|
1645
1633
|
* @throws ApiException if the response code was not in [200, 299]
|
|
1646
1634
|
*/
|
|
1647
|
-
public async updatePlayerTags(response: ResponseContext): Promise<
|
|
1635
|
+
public async updatePlayerTags(response: ResponseContext): Promise<UpdatePlayerTagsSuccessResponse > {
|
|
1648
1636
|
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
1649
1637
|
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
1650
|
-
const body:
|
|
1638
|
+
const body: UpdatePlayerTagsSuccessResponse = ObjectSerializer.deserialize(
|
|
1651
1639
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1652
|
-
"
|
|
1653
|
-
) as
|
|
1640
|
+
"UpdatePlayerTagsSuccessResponse", ""
|
|
1641
|
+
) as UpdatePlayerTagsSuccessResponse;
|
|
1654
1642
|
return body;
|
|
1655
1643
|
}
|
|
1656
1644
|
|
|
1657
1645
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
1658
1646
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
1659
|
-
const body:
|
|
1647
|
+
const body: UpdatePlayerTagsSuccessResponse = ObjectSerializer.deserialize(
|
|
1660
1648
|
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
1661
|
-
"
|
|
1662
|
-
) as
|
|
1649
|
+
"UpdatePlayerTagsSuccessResponse", ""
|
|
1650
|
+
) as UpdatePlayerTagsSuccessResponse;
|
|
1663
1651
|
return body;
|
|
1664
1652
|
}
|
|
1665
1653
|
|
|
1666
|
-
|
|
1667
|
-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
|
1654
|
+
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
1668
1655
|
}
|
|
1669
1656
|
|
|
1670
1657
|
}
|