@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.
Files changed (78) hide show
  1. package/.github/ISSUE_TEMPLATE/ask-question.yml +25 -0
  2. package/.github/ISSUE_TEMPLATE/bug-report.yml +51 -0
  3. package/.github/ISSUE_TEMPLATE/general-feedback.yml +25 -0
  4. package/.github/pull_request_template.md +44 -0
  5. package/.github/workflows/npm_deploy.yml +21 -0
  6. package/CHANGELOG.md +26 -0
  7. package/DefaultApi.md +1232 -0
  8. package/LICENSE +24 -0
  9. package/README.md +205 -102
  10. package/RELEASE_INSTRUCTIONS.md +2 -0
  11. package/apis/DefaultApi.ts +519 -532
  12. package/apis/baseapi.ts +4 -4
  13. package/apis/exception.ts +4 -3
  14. package/auth/auth.ts +4 -1
  15. package/configuration.ts +21 -2
  16. package/http/http.ts +26 -26
  17. package/index.ts +1 -0
  18. package/middleware.ts +1 -1
  19. package/models/App.ts +8 -8
  20. package/models/BasicNotification.ts +1019 -0
  21. package/models/BasicNotificationAllOf.ts +897 -0
  22. package/models/{NotificationAllOfAndroidBackgroundLayout.ts → BasicNotificationAllOfAndroidBackgroundLayout.ts} +4 -4
  23. package/models/Button.ts +2 -2
  24. package/models/CancelNotificationSuccessResponse.ts +31 -0
  25. package/models/{InlineResponse400.ts → CreateNotificationBadRequestResponse.ts} +4 -4
  26. package/models/{InlineResponse200.ts → CreateNotificationSuccessResponse.ts} +7 -6
  27. package/models/{InlineResponse2004.ts → CreatePlayerSuccessResponse.ts} +4 -4
  28. package/models/CreateSegmentBadRequestResponse.ts +38 -0
  29. package/models/{InlineResponse409.ts → CreateSegmentConflictResponse.ts} +4 -4
  30. package/models/{InlineResponse201.ts → CreateSegmentSuccessResponse.ts} +4 -4
  31. package/models/DeletePlayerBadRequestResponse.ts +31 -0
  32. package/models/DeletePlayerNotFoundResponse.ts +31 -0
  33. package/models/{InlineResponse2003.ts → DeletePlayerSuccessResponse.ts} +4 -4
  34. package/models/{InlineResponse4002.ts → DeleteSegmentBadRequestResponse.ts} +4 -4
  35. package/models/DeleteSegmentNotFoundResponse.ts +31 -0
  36. package/models/DeleteSegmentSuccessResponse.ts +31 -0
  37. package/models/DeliveryData.ts +17 -2
  38. package/models/ExportPlayersRequestBody.ts +5 -5
  39. package/models/{InlineResponse2005.ts → ExportPlayersSuccessResponse.ts} +4 -4
  40. package/models/Filter.ts +4 -4
  41. package/models/FilterExpressions.ts +4 -4
  42. package/models/FilterNotificationTarget.ts +2 -2
  43. package/models/GetNotificationRequestBody.ts +2 -2
  44. package/models/InvalidIdentifierError.ts +44 -0
  45. package/models/Notification.ts +72 -174
  46. package/models/Notification200Errors.ts +45 -0
  47. package/models/NotificationAllOf.ts +3 -858
  48. package/models/{InlineResponse4001.ts → NotificationHistoryBadRequestResponse.ts} +4 -4
  49. package/models/{InlineResponse2002.ts → NotificationHistorySuccessResponse.ts} +6 -6
  50. package/models/NotificationSlice.ts +5 -5
  51. package/models/NotificationTarget.ts +3 -124
  52. package/models/NotificationWithMeta.ts +1127 -0
  53. package/models/NotificationWithMetaAllOf.ts +132 -0
  54. package/models/ObjectSerializer.ts +97 -46
  55. package/models/Operator.ts +2 -2
  56. package/models/OutcomeData.ts +2 -2
  57. package/models/OutcomesData.ts +32 -0
  58. package/models/PlatformDeliveryData.ts +18 -2
  59. package/models/PlatformDeliveryDataEmailAllOf.ts +94 -0
  60. package/models/PlatformDeliveryDataSmsAllOf.ts +54 -0
  61. package/models/Player.ts +14 -14
  62. package/models/PlayerNotificationTarget.ts +3 -3
  63. package/models/PlayerSlice.ts +2 -2
  64. package/models/Purchase.ts +2 -2
  65. package/models/Segment.ts +3 -3
  66. package/models/SegmentNotificationTarget.ts +2 -2
  67. package/models/StringMap.ts +3 -3
  68. package/models/{InlineResponse2001.ts → UpdatePlayerSuccessResponse.ts} +6 -6
  69. package/models/UpdatePlayerTagsRequestBody.ts +4 -4
  70. package/models/UpdatePlayerTagsSuccessResponse.ts +31 -0
  71. package/models/all.ts +28 -13
  72. package/package.json +14 -9
  73. package/tsconfig.json +1 -2
  74. package/types/ObjectParamAPI.ts +101 -86
  75. package/types/ObservableAPI.ts +116 -101
  76. package/types/PromiseAPI.ts +97 -82
  77. package/util.ts +10 -1
  78. package/git_push.sh +0 -52
@@ -1,33 +1,44 @@
1
1
  // TODO: better import syntax?
2
- import { BaseAPIRequestFactory, RequiredError } from './baseapi';
2
+ import {BaseAPIRequestFactory, RequiredError} from './baseapi';
3
3
  import {Configuration} from '../configuration';
4
- import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
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 { OutcomeData } from '../models/OutcomeData';
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 app_id
41
- * @param notification_id
51
+ * @param appId
52
+ * @param notificationId
42
53
  */
43
- public async cancelNotification(app_id: string, notification_id: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
47
- if (app_id === null || app_id === undefined) {
48
- throw new RequiredError('Required parameter app_id was null or undefined when calling cancelNotification.');
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 'notification_id' is not null or undefined
53
- if (notification_id === null || notification_id === undefined) {
54
- throw new RequiredError('Required parameter notification_id was null or undefined when calling cancelNotification.');
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(notification_id)));
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 (app_id !== undefined) {
68
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
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 = null;
83
+ let authMethod: SecurityAuthentication | undefined;
79
84
  // Apply auth methods
80
85
  authMethod = _config.authMethods["app_key"]
81
- if (authMethod) {
82
- await authMethod.applySecurityAuthentication(requestContext);
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('Required parameter app was null or undefined when calling createApp.');
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 = null;
131
+ let authMethod: SecurityAuthentication | undefined;
128
132
  // Apply auth methods
129
133
  authMethod = _config.authMethods["user_key"]
130
- if (authMethod) {
131
- await authMethod.applySecurityAuthentication(requestContext);
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('Required parameter notification was null or undefined when calling createNotification.');
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 = null;
179
+ let authMethod: SecurityAuthentication | undefined;
177
180
  // Apply auth methods
178
181
  authMethod = _config.authMethods["app_key"]
179
- if (authMethod) {
180
- await authMethod.applySecurityAuthentication(requestContext);
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 🚧 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.
195
+ * Register a new device to one of your OneSignal apps &#x1F6A7; 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. &#x1F6A7; 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('Required parameter player was null or undefined when calling createPlayer.');
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 = null;
227
+ let authMethod: SecurityAuthentication | undefined;
226
228
  // Apply auth methods
227
229
  authMethod = _config.authMethods["app_key"]
228
- if (authMethod) {
229
- await authMethod.applySecurityAuthentication(requestContext);
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. 🚧 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.
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. &#x1F6A7; 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 app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
245
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
239
246
  * @param segment
240
247
  */
241
- public async createSegments(app_id: string, segment?: Segment, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
245
- if (app_id === null || app_id === undefined) {
246
- throw new RequiredError('Required parameter app_id was null or undefined when calling createSegments.');
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(app_id)));
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 = null;
278
+ let authMethod: SecurityAuthentication | undefined;
278
279
  // Apply auth methods
279
280
  authMethod = _config.authMethods["app_key"]
280
- if (authMethod) {
281
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
291
- * @param player_id The OneSignal player_id
296
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
297
+ * @param playerId The OneSignal player_id
292
298
  */
293
- public async deletePlayer(app_id: string, player_id: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
297
- if (app_id === null || app_id === undefined) {
298
- throw new RequiredError('Required parameter app_id was null or undefined when calling deletePlayer.');
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 'player_id' is not null or undefined
303
- if (player_id === null || player_id === undefined) {
304
- throw new RequiredError('Required parameter player_id was null or undefined when calling deletePlayer.');
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(player_id)));
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 (app_id !== undefined) {
318
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
323
+ if (appId !== undefined) {
324
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
319
325
  }
320
326
 
321
- // Header Params
322
327
 
323
- // Form Params
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.applySecurityAuthentication(requestContext);
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 app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
342
- * @param segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard.
346
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; 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(app_id: string, segment_id: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
348
- if (app_id === null || app_id === undefined) {
349
- throw new RequiredError('Required parameter app_id was null or undefined when calling deleteSegments.');
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 'segment_id' is not null or undefined
354
- if (segment_id === null || segment_id === undefined) {
355
- throw new RequiredError('Required parameter segment_id was null or undefined when calling deleteSegments.');
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(app_id)))
362
- .replace('{' + 'segment_id' + '}', encodeURIComponent(String(segment_id)));
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.applySecurityAuthentication(requestContext);
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. 🚧 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. |
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. &#x1F6A7; 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. &#x1F6A7; Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. &#x1F6A7; 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 app_id The app ID that you want to export devices from
391
- * @param export_players_request_body
392
+ * @param appId The app ID that you want to export devices from
393
+ * @param exportPlayersRequestBody
392
394
  */
393
- public async exportPlayers(app_id: string, export_players_request_body?: ExportPlayersRequestBody, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
397
- if (app_id === null || app_id === undefined) {
398
- throw new RequiredError('Required parameter app_id was null or undefined when calling exportPlayers.');
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(app_id)));
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(export_players_request_body, "ExportPlayersRequestBody", ""),
420
+ ObjectSerializer.serialize(exportPlayersRequestBody, "ExportPlayersRequestBody", ""),
425
421
  contentType
426
422
  );
427
423
  requestContext.setBody(serializedBody);
428
424
 
429
- let authMethod = null;
425
+ let authMethod: SecurityAuthentication | undefined;
430
426
  // Apply auth methods
431
427
  authMethod = _config.authMethods["app_key"]
432
- if (authMethod) {
433
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id An app id
443
+ * @param appId An app id
443
444
  */
444
- public async getApp(app_id: string, _options?: Configuration): Promise<RequestContext> {
445
+ public async getApp(appId: string, _options?: Configuration): Promise<RequestContext> {
445
446
  let _config = _options || this.configuration;
446
447
 
447
- // verify required parameter 'app_id' is not null or undefined
448
- if (app_id === null || app_id === undefined) {
449
- throw new RequiredError('Required parameter app_id was null or undefined when calling getApp.');
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(app_id)));
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
- // Body Params
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.applySecurityAuthentication(requestContext);
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
- // Header Params
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.applySecurityAuthentication(requestContext);
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 app_id
517
- * @param notification_id
511
+ * @param appId
512
+ * @param notificationId
518
513
  */
519
- public async getNotification(app_id: string, notification_id: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
523
- if (app_id === null || app_id === undefined) {
524
- throw new RequiredError('Required parameter app_id was null or undefined when calling getNotification.');
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 'notification_id' is not null or undefined
529
- if (notification_id === null || notification_id === undefined) {
530
- throw new RequiredError('Required parameter notification_id was null or undefined when calling getNotification.');
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(notification_id)));
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 (app_id !== undefined) {
544
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
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
- // Body Params
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.applySecurityAuthentication(requestContext);
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. 🚧 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.
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. &#x1F6A7; 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 notification_id The \&quot;id\&quot; of the message found in the Notification object
568
- * @param get_notification_request_body
561
+ * @param notificationId The \&quot;id\&quot; of the message found in the Notification object
562
+ * @param getNotificationRequestBody
569
563
  */
570
- public async getNotificationHistory(notification_id: string, get_notification_request_body: GetNotificationRequestBody, _options?: Configuration): Promise<RequestContext> {
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 'notification_id' is not null or undefined
574
- if (notification_id === null || notification_id === undefined) {
575
- throw new RequiredError('Required parameter notification_id was null or undefined when calling getNotificationHistory.');
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 'get_notification_request_body' is not null or undefined
580
- if (get_notification_request_body === null || get_notification_request_body === undefined) {
581
- throw new RequiredError('Required parameter get_notification_request_body was null or undefined when calling getNotificationHistory.');
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(notification_id)));
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(get_notification_request_body, "GetNotificationRequestBody", ""),
594
+ ObjectSerializer.serialize(getNotificationRequestBody, "GetNotificationRequestBody", ""),
607
595
  contentType
608
596
  );
609
597
  requestContext.setBody(serializedBody);
610
598
 
611
- let authMethod = null;
599
+ let authMethod: SecurityAuthentication | undefined;
612
600
  // Apply auth methods
613
601
  authMethod = _config.authMethods["app_key"]
614
- if (authMethod) {
615
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id The app ID that you want to view notifications from
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) * &#x60;0&#x60; - Dashboard only * &#x60;1&#x60; - API only * &#x60;3&#x60; - Automated only
628
621
  */
629
- public async getNotifications(app_id: string, limit?: string, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
633
- if (app_id === null || app_id === undefined) {
634
- throw new RequiredError('Required parameter app_id was null or undefined when calling getNotifications.');
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 (app_id !== undefined) {
650
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
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, "string", ""));
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.applySecurityAuthentication(requestContext);
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 🚧 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.
678
+ * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. &#x1F6A7; 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 app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
683
- * @param outcome_names 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
684
- * @param outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where Sales, Purchase is the custom outcomes with a comma in the name.
685
- * @param outcome_time_range 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.
686
- * @param outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
687
- * @param outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
680
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; 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 \&quot;os\&quot; 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[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; 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\&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;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&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
688
686
  */
689
- public async getOutcomes(app_id: string, outcome_names: string, outcome_names2?: string, outcome_time_range?: string, outcome_platforms?: string, outcome_attribution?: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
693
- if (app_id === null || app_id === undefined) {
694
- throw new RequiredError('Required parameter app_id was null or undefined when calling getOutcomes.');
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 'outcome_names' is not null or undefined
699
- if (outcome_names === null || outcome_names === undefined) {
700
- throw new RequiredError('Required parameter outcome_names was null or undefined when calling getOutcomes.');
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(app_id)));
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 (outcome_names !== undefined) {
718
- requestContext.setQueryParam("outcome_names", ObjectSerializer.serialize(outcome_names, "string", ""));
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
- if (outcome_platforms !== undefined) {
727
- requestContext.setQueryParam("outcome_platforms", ObjectSerializer.serialize(outcome_platforms, "string", ""));
728
- }
729
- if (outcome_attribution !== undefined) {
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
- // Header Params
724
+ // Query Params
725
+ if (outcomeTimeRange !== undefined) {
726
+ requestContext.setQueryParam("outcome_time_range", ObjectSerializer.serialize(outcomeTimeRange, "string", ""));
727
+ }
734
728
 
735
- // Form Params
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 = null;
740
+ let authMethod: SecurityAuthentication | undefined;
741
741
  // Apply auth methods
742
742
  authMethod = _config.authMethods["app_key"]
743
- if (authMethod) {
744
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id Your app_id for this device
754
- * @param player_id Player&#39;s OneSignal ID
755
- * @param email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
758
+ * @param appId Your app_id for this device
759
+ * @param playerId Player\&#39;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(app_id: string, player_id: string, email_auth_hash?: string, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
761
- if (app_id === null || app_id === undefined) {
762
- throw new RequiredError('Required parameter app_id was null or undefined when calling getPlayer.');
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 'player_id' is not null or undefined
767
- if (player_id === null || player_id === undefined) {
768
- throw new RequiredError('Required parameter player_id was null or undefined when calling getPlayer.');
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(player_id)));
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 (app_id !== undefined) {
783
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
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 = null;
797
+ let authMethod: SecurityAuthentication | undefined;
797
798
  // Apply auth methods
798
799
  authMethod = _config.authMethods["app_key"]
799
- if (authMethod) {
800
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id The app ID that you want to view players from
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(app_id: string, limit?: string, offset?: number, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
817
- if (app_id === null || app_id === undefined) {
818
- throw new RequiredError('Required parameter app_id was null or undefined when calling getPlayers.');
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 (app_id !== undefined) {
833
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(app_id, "string", ""));
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, "string", ""));
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 = null;
853
+ let authMethod: SecurityAuthentication | undefined;
850
854
  // Apply auth methods
851
855
  authMethod = _config.authMethods["app_key"]
852
- if (authMethod) {
853
- await authMethod.applySecurityAuthentication(requestContext);
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 app_id An app id
871
+ * @param appId An app id
863
872
  * @param app
864
873
  */
865
- public async updateApp(app_id: string, app: App, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
869
- if (app_id === null || app_id === undefined) {
870
- throw new RequiredError('Required parameter app_id was null or undefined when calling updateApp.');
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('Required parameter app was null or undefined when calling updateApp.');
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(app_id)));
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 = null;
909
+ let authMethod: SecurityAuthentication | undefined;
907
910
  // Apply auth methods
908
911
  authMethod = _config.authMethods["user_key"]
909
- if (authMethod) {
910
- await authMethod.applySecurityAuthentication(requestContext);
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 player_id Player&#39;s OneSignal ID
927
+ * @param playerId Player\&#39;s OneSignal ID
920
928
  * @param player
921
929
  */
922
- public async updatePlayer(player_id: string, player: Player, _options?: Configuration): Promise<RequestContext> {
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 'player_id' is not null or undefined
926
- if (player_id === null || player_id === undefined) {
927
- throw new RequiredError('Required parameter player_id was null or undefined when calling updatePlayer.');
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('Required parameter player was null or undefined when calling updatePlayer.');
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(player_id)));
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 = null;
965
+ let authMethod: SecurityAuthentication | undefined;
964
966
  // Apply auth methods
965
967
  authMethod = _config.authMethods["app_key"]
966
- if (authMethod) {
967
- await authMethod.applySecurityAuthentication(requestContext);
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. 📘 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\" }
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. &#128216; 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 app_id The OneSignal App ID the user record is found under.
977
- * @param external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
978
- * @param update_player_tags_request_body
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(app_id: string, external_user_id: string, update_player_tags_request_body?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<RequestContext> {
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 'app_id' is not null or undefined
984
- if (app_id === null || app_id === undefined) {
985
- throw new RequiredError('Required parameter app_id was null or undefined when calling updatePlayerTags.');
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 'external_user_id' is not null or undefined
990
- if (external_user_id === null || external_user_id === undefined) {
991
- throw new RequiredError('Required parameter external_user_id was null or undefined when calling updatePlayerTags.');
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(app_id)))
999
- .replace('{' + 'external_user_id' + '}', encodeURIComponent(String(external_user_id)));
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(update_player_tags_request_body, "UpdatePlayerTagsRequestBody", ""),
1019
+ ObjectSerializer.serialize(updatePlayerTagsRequestBody, "UpdatePlayerTagsRequestBody", ""),
1019
1020
  contentType
1020
1021
  );
1021
1022
  requestContext.setBody(serializedBody);
1022
1023
 
1023
- let authMethod = null;
1024
+ let authMethod: SecurityAuthentication | undefined;
1024
1025
  // Apply auth methods
1025
1026
  authMethod = _config.authMethods["app_key"]
1026
- if (authMethod) {
1027
- await authMethod.applySecurityAuthentication(requestContext);
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<InlineResponse2001 > {
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: InlineResponse2001 = ObjectSerializer.deserialize(
1053
+ const body: CancelNotificationSuccessResponse = ObjectSerializer.deserialize(
1048
1054
  ObjectSerializer.parse(await response.body.text(), contentType),
1049
- "InlineResponse2001", ""
1050
- ) as InlineResponse2001;
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: InlineResponse2001 = ObjectSerializer.deserialize(
1062
+ const body: CancelNotificationSuccessResponse = ObjectSerializer.deserialize(
1057
1063
  ObjectSerializer.parse(await response.body.text(), contentType),
1058
- "InlineResponse2001", ""
1059
- ) as InlineResponse2001;
1064
+ "CancelNotificationSuccessResponse", ""
1065
+ ) as CancelNotificationSuccessResponse;
1060
1066
  return body;
1061
1067
  }
1062
1068
 
1063
- let body = response.body || "";
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
- let body = response.body || "";
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<InlineResponse200 > {
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: InlineResponse200 = ObjectSerializer.deserialize(
1111
+ const body: CreateNotificationSuccessResponse = ObjectSerializer.deserialize(
1108
1112
  ObjectSerializer.parse(await response.body.text(), contentType),
1109
- "InlineResponse200", ""
1110
- ) as InlineResponse200;
1113
+ "CreateNotificationSuccessResponse", ""
1114
+ ) as CreateNotificationSuccessResponse;
1111
1115
  return body;
1112
1116
  }
1113
1117
  if (isCodeInRange("400", response.httpStatusCode)) {
1114
- const body: InlineResponse400 = ObjectSerializer.deserialize(
1118
+ const body: CreateNotificationBadRequestResponse = ObjectSerializer.deserialize(
1115
1119
  ObjectSerializer.parse(await response.body.text(), contentType),
1116
- "InlineResponse400", ""
1117
- ) as InlineResponse400;
1118
- throw new ApiException<InlineResponse400>(400, body);
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: InlineResponse200 = ObjectSerializer.deserialize(
1127
+ const body: CreateNotificationSuccessResponse = ObjectSerializer.deserialize(
1124
1128
  ObjectSerializer.parse(await response.body.text(), contentType),
1125
- "InlineResponse200", ""
1126
- ) as InlineResponse200;
1129
+ "CreateNotificationSuccessResponse", ""
1130
+ ) as CreateNotificationSuccessResponse;
1127
1131
  return body;
1128
1132
  }
1129
1133
 
1130
- let body = response.body || "";
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<InlineResponse2004 > {
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: InlineResponse2004 = ObjectSerializer.deserialize(
1147
+ const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
1145
1148
  ObjectSerializer.parse(await response.body.text(), contentType),
1146
- "InlineResponse2004", ""
1147
- ) as InlineResponse2004;
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: InlineResponse2004 = ObjectSerializer.deserialize(
1156
+ const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
1154
1157
  ObjectSerializer.parse(await response.body.text(), contentType),
1155
- "InlineResponse2004", ""
1156
- ) as InlineResponse2004;
1158
+ "CreatePlayerSuccessResponse", ""
1159
+ ) as CreatePlayerSuccessResponse;
1157
1160
  return body;
1158
1161
  }
1159
1162
 
1160
- let body = response.body || "";
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<InlineResponse201 > {
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: InlineResponse201 = ObjectSerializer.deserialize(
1176
+ const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
1175
1177
  ObjectSerializer.parse(await response.body.text(), contentType),
1176
- "InlineResponse201", ""
1177
- ) as InlineResponse201;
1178
+ "CreateSegmentSuccessResponse", ""
1179
+ ) as CreateSegmentSuccessResponse;
1178
1180
  return body;
1179
1181
  }
1180
- if (isCodeInRange("409", response.httpStatusCode)) {
1181
- const body: InlineResponse409 = ObjectSerializer.deserialize(
1182
+ if (isCodeInRange("400", response.httpStatusCode)) {
1183
+ const body: CreateSegmentBadRequestResponse = ObjectSerializer.deserialize(
1182
1184
  ObjectSerializer.parse(await response.body.text(), contentType),
1183
- "InlineResponse409", ""
1184
- ) as InlineResponse409;
1185
- throw new ApiException<InlineResponse409>(409, body);
1185
+ "CreateSegmentBadRequestResponse", ""
1186
+ ) as CreateSegmentBadRequestResponse;
1187
+ throw new ApiException<CreateSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1186
1188
  }
1187
- if (isCodeInRange("400", response.httpStatusCode)) {
1188
- const body: InlineResponse409 = ObjectSerializer.deserialize(
1189
+ if (isCodeInRange("409", response.httpStatusCode)) {
1190
+ const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize(
1189
1191
  ObjectSerializer.parse(await response.body.text(), contentType),
1190
- "InlineResponse409", ""
1191
- ) as InlineResponse409;
1192
- throw new ApiException<InlineResponse409>(400, body);
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: InlineResponse201 = ObjectSerializer.deserialize(
1199
+ const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
1198
1200
  ObjectSerializer.parse(await response.body.text(), contentType),
1199
- "InlineResponse201", ""
1200
- ) as InlineResponse201;
1201
+ "CreateSegmentSuccessResponse", ""
1202
+ ) as CreateSegmentSuccessResponse;
1201
1203
  return body;
1202
1204
  }
1203
1205
 
1204
- let body = response.body || "";
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<InlineResponse2001 > {
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: InlineResponse2001 = ObjectSerializer.deserialize(
1219
+ const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
1219
1220
  ObjectSerializer.parse(await response.body.text(), contentType),
1220
- "InlineResponse2001", ""
1221
- ) as InlineResponse2001;
1221
+ "DeletePlayerSuccessResponse", ""
1222
+ ) as DeletePlayerSuccessResponse;
1222
1223
  return body;
1223
1224
  }
1224
- if (isCodeInRange("404", response.httpStatusCode)) {
1225
- const body: InlineResponse2001 = ObjectSerializer.deserialize(
1225
+ if (isCodeInRange("400", response.httpStatusCode)) {
1226
+ const body: DeletePlayerBadRequestResponse = ObjectSerializer.deserialize(
1226
1227
  ObjectSerializer.parse(await response.body.text(), contentType),
1227
- "InlineResponse2001", ""
1228
- ) as InlineResponse2001;
1229
- throw new ApiException<InlineResponse2001>(404, body);
1228
+ "DeletePlayerBadRequestResponse", ""
1229
+ ) as DeletePlayerBadRequestResponse;
1230
+ throw new ApiException<DeletePlayerBadRequestResponse>(400, "Bad Request", body, response.headers);
1230
1231
  }
1231
- if (isCodeInRange("400", response.httpStatusCode)) {
1232
- const body: InlineResponse4002 = ObjectSerializer.deserialize(
1232
+ if (isCodeInRange("404", response.httpStatusCode)) {
1233
+ const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize(
1233
1234
  ObjectSerializer.parse(await response.body.text(), contentType),
1234
- "InlineResponse4002", ""
1235
- ) as InlineResponse4002;
1236
- throw new ApiException<InlineResponse4002>(400, body);
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: InlineResponse2001 = ObjectSerializer.deserialize(
1242
+ const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
1242
1243
  ObjectSerializer.parse(await response.body.text(), contentType),
1243
- "InlineResponse2001", ""
1244
- ) as InlineResponse2001;
1244
+ "DeletePlayerSuccessResponse", ""
1245
+ ) as DeletePlayerSuccessResponse;
1245
1246
  return body;
1246
1247
  }
1247
1248
 
1248
- let body = response.body || "";
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<InlineResponse2003 > {
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: InlineResponse2003 = ObjectSerializer.deserialize(
1262
+ const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
1263
1263
  ObjectSerializer.parse(await response.body.text(), contentType),
1264
- "InlineResponse2003", ""
1265
- ) as InlineResponse2003;
1264
+ "DeleteSegmentSuccessResponse", ""
1265
+ ) as DeleteSegmentSuccessResponse;
1266
1266
  return body;
1267
1267
  }
1268
- if (isCodeInRange("404", response.httpStatusCode)) {
1269
- const body: InlineResponse2003 = ObjectSerializer.deserialize(
1268
+ if (isCodeInRange("400", response.httpStatusCode)) {
1269
+ const body: DeleteSegmentBadRequestResponse = ObjectSerializer.deserialize(
1270
1270
  ObjectSerializer.parse(await response.body.text(), contentType),
1271
- "InlineResponse2003", ""
1272
- ) as InlineResponse2003;
1273
- throw new ApiException<InlineResponse2003>(404, body);
1271
+ "DeleteSegmentBadRequestResponse", ""
1272
+ ) as DeleteSegmentBadRequestResponse;
1273
+ throw new ApiException<DeleteSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1274
1274
  }
1275
- if (isCodeInRange("400", response.httpStatusCode)) {
1276
- const body: InlineResponse4002 = ObjectSerializer.deserialize(
1275
+ if (isCodeInRange("404", response.httpStatusCode)) {
1276
+ const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize(
1277
1277
  ObjectSerializer.parse(await response.body.text(), contentType),
1278
- "InlineResponse4002", ""
1279
- ) as InlineResponse4002;
1280
- throw new ApiException<InlineResponse4002>(400, body);
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: InlineResponse2003 = ObjectSerializer.deserialize(
1285
+ const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
1286
1286
  ObjectSerializer.parse(await response.body.text(), contentType),
1287
- "InlineResponse2003", ""
1288
- ) as InlineResponse2003;
1287
+ "DeleteSegmentSuccessResponse", ""
1288
+ ) as DeleteSegmentSuccessResponse;
1289
1289
  return body;
1290
1290
  }
1291
1291
 
1292
- let body = response.body || "";
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<InlineResponse2005 > {
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: InlineResponse2005 = ObjectSerializer.deserialize(
1305
+ const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
1307
1306
  ObjectSerializer.parse(await response.body.text(), contentType),
1308
- "InlineResponse2005", ""
1309
- ) as InlineResponse2005;
1307
+ "ExportPlayersSuccessResponse", ""
1308
+ ) as ExportPlayersSuccessResponse;
1310
1309
  return body;
1311
1310
  }
1312
1311
  if (isCodeInRange("400", response.httpStatusCode)) {
1313
- const body: any = ObjectSerializer.deserialize(
1312
+ const body: object = ObjectSerializer.deserialize(
1314
1313
  ObjectSerializer.parse(await response.body.text(), contentType),
1315
- "any", ""
1316
- ) as any;
1317
- throw new ApiException<any>(400, body);
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: InlineResponse2005 = ObjectSerializer.deserialize(
1321
+ const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
1323
1322
  ObjectSerializer.parse(await response.body.text(), contentType),
1324
- "InlineResponse2005", ""
1325
- ) as InlineResponse2005;
1323
+ "ExportPlayersSuccessResponse", ""
1324
+ ) as ExportPlayersSuccessResponse;
1326
1325
  return body;
1327
1326
  }
1328
1327
 
1329
- let body = response.body || "";
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
- let body = response.body || "";
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<string > {
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: string = ObjectSerializer.deserialize(
1370
+ const body: Array<App> = ObjectSerializer.deserialize(
1374
1371
  ObjectSerializer.parse(await response.body.text(), contentType),
1375
- "string", ""
1376
- ) as string;
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: string = ObjectSerializer.deserialize(
1379
+ const body: Array<App> = ObjectSerializer.deserialize(
1383
1380
  ObjectSerializer.parse(await response.body.text(), contentType),
1384
- "string", ""
1385
- ) as string;
1381
+ "Array<App>", ""
1382
+ ) as Array<App>;
1386
1383
  return body;
1387
1384
  }
1388
1385
 
1389
- let body = response.body || "";
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<Notification > {
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: Notification = ObjectSerializer.deserialize(
1399
+ const body: NotificationWithMeta = ObjectSerializer.deserialize(
1404
1400
  ObjectSerializer.parse(await response.body.text(), contentType),
1405
- "Notification", ""
1406
- ) as Notification;
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: Notification = ObjectSerializer.deserialize(
1408
+ const body: NotificationWithMeta = ObjectSerializer.deserialize(
1413
1409
  ObjectSerializer.parse(await response.body.text(), contentType),
1414
- "Notification", ""
1415
- ) as Notification;
1410
+ "NotificationWithMeta", ""
1411
+ ) as NotificationWithMeta;
1416
1412
  return body;
1417
1413
  }
1418
1414
 
1419
- let body = response.body || "";
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<InlineResponse2002 > {
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: InlineResponse2002 = ObjectSerializer.deserialize(
1428
+ const body: NotificationHistorySuccessResponse = ObjectSerializer.deserialize(
1434
1429
  ObjectSerializer.parse(await response.body.text(), contentType),
1435
- "InlineResponse2002", ""
1436
- ) as InlineResponse2002;
1430
+ "NotificationHistorySuccessResponse", ""
1431
+ ) as NotificationHistorySuccessResponse;
1437
1432
  return body;
1438
1433
  }
1439
1434
  if (isCodeInRange("400", response.httpStatusCode)) {
1440
- const body: InlineResponse4001 = ObjectSerializer.deserialize(
1435
+ const body: NotificationHistoryBadRequestResponse = ObjectSerializer.deserialize(
1441
1436
  ObjectSerializer.parse(await response.body.text(), contentType),
1442
- "InlineResponse4001", ""
1443
- ) as InlineResponse4001;
1444
- throw new ApiException<InlineResponse4001>(400, body);
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: InlineResponse2002 = ObjectSerializer.deserialize(
1444
+ const body: NotificationHistorySuccessResponse = ObjectSerializer.deserialize(
1450
1445
  ObjectSerializer.parse(await response.body.text(), contentType),
1451
- "InlineResponse2002", ""
1452
- ) as InlineResponse2002;
1446
+ "NotificationHistorySuccessResponse", ""
1447
+ ) as NotificationHistorySuccessResponse;
1453
1448
  return body;
1454
1449
  }
1455
1450
 
1456
- let body = response.body || "";
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
- let body = response.body || "";
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<Array<OutcomeData> > {
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: Array<OutcomeData> = ObjectSerializer.deserialize(
1493
+ const body: OutcomesData = ObjectSerializer.deserialize(
1501
1494
  ObjectSerializer.parse(await response.body.text(), contentType),
1502
- "Array<OutcomeData>", ""
1503
- ) as Array<OutcomeData>;
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: Array<OutcomeData> = ObjectSerializer.deserialize(
1502
+ const body: OutcomesData = ObjectSerializer.deserialize(
1510
1503
  ObjectSerializer.parse(await response.body.text(), contentType),
1511
- "Array<OutcomeData>", ""
1512
- ) as Array<OutcomeData>;
1504
+ "OutcomesData", ""
1505
+ ) as OutcomesData;
1513
1506
  return body;
1514
1507
  }
1515
1508
 
1516
- let body = response.body || "";
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
- let body = response.body || "";
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
- let body = response.body || "";
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
- let body = response.body || "";
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<InlineResponse2001 > {
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: InlineResponse2001 = ObjectSerializer.deserialize(
1609
+ const body: UpdatePlayerSuccessResponse = ObjectSerializer.deserialize(
1621
1610
  ObjectSerializer.parse(await response.body.text(), contentType),
1622
- "InlineResponse2001", ""
1623
- ) as InlineResponse2001;
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: InlineResponse2001 = ObjectSerializer.deserialize(
1618
+ const body: UpdatePlayerSuccessResponse = ObjectSerializer.deserialize(
1630
1619
  ObjectSerializer.parse(await response.body.text(), contentType),
1631
- "InlineResponse2001", ""
1632
- ) as InlineResponse2001;
1620
+ "UpdatePlayerSuccessResponse", ""
1621
+ ) as UpdatePlayerSuccessResponse;
1633
1622
  return body;
1634
1623
  }
1635
1624
 
1636
- let body = response.body || "";
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<InlineResponse2003 > {
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: InlineResponse2003 = ObjectSerializer.deserialize(
1638
+ const body: UpdatePlayerTagsSuccessResponse = ObjectSerializer.deserialize(
1651
1639
  ObjectSerializer.parse(await response.body.text(), contentType),
1652
- "InlineResponse2003", ""
1653
- ) as InlineResponse2003;
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: InlineResponse2003 = ObjectSerializer.deserialize(
1647
+ const body: UpdatePlayerTagsSuccessResponse = ObjectSerializer.deserialize(
1660
1648
  ObjectSerializer.parse(await response.body.text(), contentType),
1661
- "InlineResponse2003", ""
1662
- ) as InlineResponse2003;
1649
+ "UpdatePlayerTagsSuccessResponse", ""
1650
+ ) as UpdatePlayerTagsSuccessResponse;
1663
1651
  return body;
1664
1652
  }
1665
1653
 
1666
- let body = response.body || "";
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
  }