@onesignal/node-onesignal 1.0.0-beta7 → 1.0.0-beta9

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 (208) hide show
  1. package/.github/workflows/Zapier.yml +29 -0
  2. package/.github/workflows/npm_deploy.yml +6 -7
  3. package/CHANGELOG.md +19 -0
  4. package/DefaultApi.md +1365 -164
  5. package/README.md +189 -0
  6. package/apis/DefaultApi.ts +2041 -423
  7. package/dist/apis/DefaultApi.d.ts +48 -0
  8. package/dist/apis/DefaultApi.js +1861 -414
  9. package/dist/apis/DefaultApi.js.map +1 -1
  10. package/dist/auth/auth.d.ts +6 -6
  11. package/dist/auth/auth.js +1 -1
  12. package/dist/http/http.d.ts +2 -2
  13. package/dist/http/http.js +1 -1
  14. package/dist/models/App.d.ts +5 -1
  15. package/dist/models/App.js +24 -0
  16. package/dist/models/App.js.map +1 -1
  17. package/dist/models/BadRequestError.d.ts +17 -0
  18. package/dist/models/BadRequestError.js +22 -0
  19. package/dist/models/BadRequestError.js.map +1 -0
  20. package/dist/models/BasicNotification.d.ts +5 -1
  21. package/dist/models/BasicNotification.js +12 -0
  22. package/dist/models/BasicNotification.js.map +1 -1
  23. package/dist/models/BasicNotificationAllOf.d.ts +1 -1
  24. package/dist/models/BeginLiveActivityRequest.d.ts +18 -0
  25. package/dist/models/BeginLiveActivityRequest.js +28 -0
  26. package/dist/models/BeginLiveActivityRequest.js.map +1 -0
  27. package/dist/models/CreateSubscriptionRequestBody.d.ts +19 -0
  28. package/dist/models/CreateSubscriptionRequestBody.js +28 -0
  29. package/dist/models/CreateSubscriptionRequestBody.js.map +1 -0
  30. package/dist/models/CreateUserConflictResponse.d.ts +18 -0
  31. package/dist/models/CreateUserConflictResponse.js +22 -0
  32. package/dist/models/CreateUserConflictResponse.js.map +1 -0
  33. package/dist/models/CreateUserConflictResponseErrorsInner.d.ts +20 -0
  34. package/dist/models/CreateUserConflictResponseErrorsInner.js +34 -0
  35. package/dist/models/CreateUserConflictResponseErrorsInner.js.map +1 -0
  36. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.d.ts +17 -0
  37. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js +22 -0
  38. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js.map +1 -0
  39. package/dist/models/Filter.d.ts +1 -1
  40. package/dist/models/FilterExpressions.d.ts +2 -2
  41. package/dist/models/GetNotificationRequestBody.d.ts +1 -1
  42. package/dist/models/IdentifyUserConflictResponse.d.ts +18 -0
  43. package/dist/models/IdentifyUserConflictResponse.js +22 -0
  44. package/dist/models/IdentifyUserConflictResponse.js.map +1 -0
  45. package/dist/models/IdentifyUserConflictResponseErrorsInner.d.ts +18 -0
  46. package/dist/models/IdentifyUserConflictResponseErrorsInner.js +28 -0
  47. package/dist/models/IdentifyUserConflictResponseErrorsInner.js.map +1 -0
  48. package/dist/models/InlineResponse200.d.ts +19 -0
  49. package/dist/models/InlineResponse200.js +22 -0
  50. package/dist/models/InlineResponse200.js.map +1 -0
  51. package/dist/models/InlineResponse2003.d.ts +17 -0
  52. package/dist/models/InlineResponse2003.js +22 -0
  53. package/dist/models/InlineResponse2003.js.map +1 -0
  54. package/dist/models/InlineResponse201.d.ts +18 -0
  55. package/dist/models/InlineResponse201.js +22 -0
  56. package/dist/models/InlineResponse201.js.map +1 -0
  57. package/dist/models/InlineResponse202.d.ts +18 -0
  58. package/dist/models/InlineResponse202.js +22 -0
  59. package/dist/models/InlineResponse202.js.map +1 -0
  60. package/dist/models/Notification.d.ts +5 -1
  61. package/dist/models/Notification.js +12 -0
  62. package/dist/models/Notification.js.map +1 -1
  63. package/dist/models/NotificationTarget.d.ts +4 -0
  64. package/dist/models/NotificationTarget.js +12 -0
  65. package/dist/models/NotificationTarget.js.map +1 -1
  66. package/dist/models/NotificationWithMeta.d.ts +5 -1
  67. package/dist/models/NotificationWithMeta.js +12 -0
  68. package/dist/models/NotificationWithMeta.js.map +1 -1
  69. package/dist/models/ObjectSerializer.d.ts +25 -5
  70. package/dist/models/ObjectSerializer.js +83 -15
  71. package/dist/models/ObjectSerializer.js.map +1 -1
  72. package/dist/models/Operator.d.ts +1 -1
  73. package/dist/models/OutcomeData.d.ts +1 -1
  74. package/dist/models/Player.d.ts +1 -1
  75. package/dist/models/Player.js +1 -1
  76. package/dist/models/Player.js.map +1 -1
  77. package/dist/models/PlayerNotificationTarget.d.ts +4 -0
  78. package/dist/models/PlayerNotificationTarget.js +12 -0
  79. package/dist/models/PlayerNotificationTarget.js.map +1 -1
  80. package/dist/models/PlayerNotificationTargetIncludeAliases.d.ts +17 -0
  81. package/dist/models/PlayerNotificationTargetIncludeAliases.js +22 -0
  82. package/dist/models/PlayerNotificationTargetIncludeAliases.js.map +1 -0
  83. package/dist/models/PropertiesDeltas.d.ts +21 -0
  84. package/dist/models/PropertiesDeltas.js +40 -0
  85. package/dist/models/PropertiesDeltas.js.map +1 -0
  86. package/dist/models/PropertiesObject.d.ts +30 -0
  87. package/dist/models/PropertiesObject.js +82 -0
  88. package/dist/models/PropertiesObject.js.map +1 -0
  89. package/dist/models/Purchase.d.ts +1 -1
  90. package/dist/models/Purchase.js +1 -1
  91. package/dist/models/SubscriptionObject.d.ts +34 -0
  92. package/dist/models/SubscriptionObject.js +118 -0
  93. package/dist/models/SubscriptionObject.js.map +1 -0
  94. package/dist/models/TransferSubscriptionRequestBody.d.ts +19 -0
  95. package/dist/models/TransferSubscriptionRequestBody.js +22 -0
  96. package/dist/models/TransferSubscriptionRequestBody.js.map +1 -0
  97. package/dist/models/UpdateLiveActivityRequest.d.ts +22 -0
  98. package/dist/models/UpdateLiveActivityRequest.js +40 -0
  99. package/dist/models/UpdateLiveActivityRequest.js.map +1 -0
  100. package/dist/models/UpdateLiveActivitySuccessResponse.d.ts +19 -0
  101. package/dist/models/UpdateLiveActivitySuccessResponse.js +28 -0
  102. package/dist/models/UpdateLiveActivitySuccessResponse.js.map +1 -0
  103. package/dist/models/UpdateSubscriptionRequestBody.d.ts +18 -0
  104. package/dist/models/UpdateSubscriptionRequestBody.js +22 -0
  105. package/dist/models/UpdateSubscriptionRequestBody.js.map +1 -0
  106. package/dist/models/UpdateUserRequest.d.ts +21 -0
  107. package/dist/models/UpdateUserRequest.js +34 -0
  108. package/dist/models/UpdateUserRequest.js.map +1 -0
  109. package/dist/models/User.d.ts +25 -0
  110. package/dist/models/User.js +40 -0
  111. package/dist/models/User.js.map +1 -0
  112. package/dist/models/UserIdentityRequestBody.d.ts +19 -0
  113. package/dist/models/UserIdentityRequestBody.js +22 -0
  114. package/dist/models/UserIdentityRequestBody.js.map +1 -0
  115. package/dist/models/UserIdentityResponse.d.ts +19 -0
  116. package/dist/models/UserIdentityResponse.js +22 -0
  117. package/dist/models/UserIdentityResponse.js.map +1 -0
  118. package/dist/models/UserSubscriptionOptions.d.ts +17 -0
  119. package/dist/models/UserSubscriptionOptions.js +22 -0
  120. package/dist/models/UserSubscriptionOptions.js.map +1 -0
  121. package/dist/models/all.d.ts +25 -5
  122. package/dist/models/all.js +25 -5
  123. package/dist/models/all.js.map +1 -1
  124. package/dist/types/ObjectParamAPI.d.ts +117 -0
  125. package/dist/types/ObjectParamAPI.js +51 -0
  126. package/dist/types/ObjectParamAPI.js.map +1 -1
  127. package/dist/types/ObservableAPI.d.ts +31 -0
  128. package/dist/types/ObservableAPI.js +464 -56
  129. package/dist/types/ObservableAPI.js.map +1 -1
  130. package/dist/types/PromiseAPI.d.ts +31 -0
  131. package/dist/types/PromiseAPI.js +68 -0
  132. package/dist/types/PromiseAPI.js.map +1 -1
  133. package/models/App.ts +41 -1
  134. package/models/BadRequestError.ts +31 -0
  135. package/models/BasicNotification.ts +17 -1
  136. package/models/BasicNotificationAllOf.ts +1 -1
  137. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
  138. package/models/BeginLiveActivityRequest.ts +38 -0
  139. package/models/Button.ts +1 -1
  140. package/models/CancelNotificationSuccessResponse.ts +1 -1
  141. package/models/CreateNotificationSuccessResponse.ts +1 -1
  142. package/models/CreatePlayerSuccessResponse.ts +1 -1
  143. package/models/CreateSegmentConflictResponse.ts +1 -1
  144. package/models/CreateSegmentSuccessResponse.ts +1 -1
  145. package/models/CreateSubscriptionRequestBody.ts +39 -0
  146. package/models/CreateUserConflictResponse.ts +32 -0
  147. package/models/CreateUserConflictResponseErrorsInner.ts +46 -0
  148. package/models/CreateUserConflictResponseErrorsItemsMeta.ts +31 -0
  149. package/models/DeletePlayerNotFoundResponse.ts +1 -1
  150. package/models/DeletePlayerSuccessResponse.ts +1 -1
  151. package/models/DeleteSegmentNotFoundResponse.ts +1 -1
  152. package/models/DeleteSegmentSuccessResponse.ts +1 -1
  153. package/models/DeliveryData.ts +1 -1
  154. package/models/ExportPlayersRequestBody.ts +1 -1
  155. package/models/ExportPlayersSuccessResponse.ts +1 -1
  156. package/models/Filter.ts +1 -1
  157. package/models/FilterExpressions.ts +1 -1
  158. package/models/GetNotificationRequestBody.ts +1 -1
  159. package/models/IdentifyUserConflictResponse.ts +32 -0
  160. package/models/IdentifyUserConflictResponseErrorsInner.ts +38 -0
  161. package/models/InlineResponse200.ts +31 -0
  162. package/models/InlineResponse2003.ts +31 -0
  163. package/models/InlineResponse201.ts +32 -0
  164. package/models/InlineResponse202.ts +32 -0
  165. package/models/InvalidIdentifierError.ts +1 -1
  166. package/models/Notification.ts +17 -1
  167. package/models/Notification200Errors.ts +1 -1
  168. package/models/NotificationAllOf.ts +1 -1
  169. package/models/NotificationHistorySuccessResponse.ts +1 -1
  170. package/models/NotificationSlice.ts +1 -1
  171. package/models/NotificationTarget.ts +19 -1
  172. package/models/NotificationWithMeta.ts +17 -1
  173. package/models/NotificationWithMetaAllOf.ts +1 -1
  174. package/models/ObjectSerializer.ts +89 -21
  175. package/models/Operator.ts +1 -1
  176. package/models/OutcomeData.ts +1 -1
  177. package/models/OutcomesData.ts +1 -1
  178. package/models/PlatformDeliveryData.ts +1 -1
  179. package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
  180. package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
  181. package/models/Player.ts +3 -3
  182. package/models/PlayerNotificationTarget.ts +19 -1
  183. package/models/PlayerNotificationTargetIncludeAliases.ts +31 -0
  184. package/models/PlayerSlice.ts +1 -1
  185. package/models/PropertiesDeltas.ts +53 -0
  186. package/models/PropertiesObject.ts +102 -0
  187. package/models/Purchase.ts +3 -3
  188. package/models/Segment.ts +1 -1
  189. package/models/SegmentNotificationTarget.ts +1 -1
  190. package/models/StringMap.ts +1 -1
  191. package/models/SubscriptionObject.ts +146 -0
  192. package/models/TransferSubscriptionRequestBody.ts +31 -0
  193. package/models/UpdateLiveActivityRequest.ts +62 -0
  194. package/models/UpdateLiveActivitySuccessResponse.ts +39 -0
  195. package/models/UpdatePlayerSuccessResponse.ts +1 -1
  196. package/models/UpdatePlayerTagsRequestBody.ts +1 -1
  197. package/models/UpdatePlayerTagsSuccessResponse.ts +1 -1
  198. package/models/UpdateSubscriptionRequestBody.ts +32 -0
  199. package/models/UpdateUserRequest.ts +47 -0
  200. package/models/User.ts +55 -0
  201. package/models/UserIdentityRequestBody.ts +31 -0
  202. package/models/UserIdentityResponse.ts +31 -0
  203. package/models/UserSubscriptionOptions.ts +31 -0
  204. package/models/all.ts +25 -5
  205. package/package.json +3 -3
  206. package/types/ObjectParamAPI.ts +527 -5
  207. package/types/ObservableAPI.ts +454 -5
  208. package/types/PromiseAPI.ts +216 -5
@@ -11,24 +11,28 @@ import {SecurityAuthentication} from '../auth/auth';
11
11
 
12
12
 
13
13
  import { App } from '../models/App';
14
+ import { BadRequestError } from '../models/BadRequestError';
15
+ import { BeginLiveActivityRequest } from '../models/BeginLiveActivityRequest';
14
16
  import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse';
15
- import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse';
16
17
  import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
17
18
  import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse';
18
- import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse';
19
19
  import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
20
20
  import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
21
- import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse';
21
+ import { CreateSubscriptionRequestBody } from '../models/CreateSubscriptionRequestBody';
22
+ import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse';
22
23
  import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse';
23
24
  import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse';
24
- import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse';
25
25
  import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse';
26
26
  import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse';
27
27
  import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody';
28
28
  import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse';
29
29
  import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody';
30
+ import { IdentifyUserConflictResponse } from '../models/IdentifyUserConflictResponse';
31
+ import { InlineResponse200 } from '../models/InlineResponse200';
32
+ import { InlineResponse2003 } from '../models/InlineResponse2003';
33
+ import { InlineResponse201 } from '../models/InlineResponse201';
34
+ import { InlineResponse202 } from '../models/InlineResponse202';
30
35
  import { Notification } from '../models/Notification';
31
- import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse';
32
36
  import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
33
37
  import { NotificationSlice } from '../models/NotificationSlice';
34
38
  import { NotificationWithMeta } from '../models/NotificationWithMeta';
@@ -36,15 +40,87 @@ import { OutcomesData } from '../models/OutcomesData';
36
40
  import { Player } from '../models/Player';
37
41
  import { PlayerSlice } from '../models/PlayerSlice';
38
42
  import { Segment } from '../models/Segment';
43
+ import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody';
44
+ import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest';
45
+ import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse';
39
46
  import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse';
40
47
  import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody';
41
48
  import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse';
49
+ import { UpdateSubscriptionRequestBody } from '../models/UpdateSubscriptionRequestBody';
50
+ import { UpdateUserRequest } from '../models/UpdateUserRequest';
51
+ import { User } from '../models/User';
52
+ import { UserIdentityRequestBody } from '../models/UserIdentityRequestBody';
53
+ import { UserIdentityResponse } from '../models/UserIdentityResponse';
42
54
 
43
55
  /**
44
56
  * no description
45
57
  */
46
58
  export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
47
59
 
60
+ /**
61
+ * Starts a Live Activity
62
+ * Start Live Activity
63
+ * @param appId The OneSignal App ID for your app. Available in Keys & IDs.
64
+ * @param activityId Live Activity record ID
65
+ * @param beginLiveActivityRequest
66
+ */
67
+ public async beginLiveActivity(appId: string, activityId: string, beginLiveActivityRequest: BeginLiveActivityRequest, _options?: Configuration): Promise<RequestContext> {
68
+ let _config = _options || this.configuration;
69
+
70
+ // verify required parameter 'appId' is not null or undefined
71
+ if (appId === null || appId === undefined) {
72
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "appId");
73
+ }
74
+
75
+
76
+ // verify required parameter 'activityId' is not null or undefined
77
+ if (activityId === null || activityId === undefined) {
78
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "activityId");
79
+ }
80
+
81
+
82
+ // verify required parameter 'beginLiveActivityRequest' is not null or undefined
83
+ if (beginLiveActivityRequest === null || beginLiveActivityRequest === undefined) {
84
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "beginLiveActivityRequest");
85
+ }
86
+
87
+
88
+ // Path Params
89
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token'
90
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
91
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)));
92
+
93
+ // Make Request Context
94
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
95
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
96
+
97
+
98
+ // Body Params
99
+ const contentType = ObjectSerializer.getPreferredMediaType([
100
+ "application/json"
101
+ ]);
102
+ requestContext.setHeaderParam("Content-Type", contentType);
103
+ const serializedBody = ObjectSerializer.stringify(
104
+ ObjectSerializer.serialize(beginLiveActivityRequest, "BeginLiveActivityRequest", ""),
105
+ contentType
106
+ );
107
+ requestContext.setBody(serializedBody);
108
+
109
+ let authMethod: SecurityAuthentication | undefined;
110
+ // Apply auth methods
111
+ authMethod = _config.authMethods["app_key"]
112
+ if (authMethod?.applySecurityAuthentication) {
113
+ await authMethod?.applySecurityAuthentication(requestContext);
114
+ }
115
+
116
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
117
+ if (defaultAuth?.applySecurityAuthentication) {
118
+ await defaultAuth?.applySecurityAuthentication(requestContext);
119
+ }
120
+
121
+ return requestContext;
122
+ }
123
+
48
124
  /**
49
125
  * Used to stop a scheduled or currently outgoing notification
50
126
  * Stop a scheduled or currently outgoing notification
@@ -291,86 +367,61 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
291
367
  }
292
368
 
293
369
  /**
294
- * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
295
- * Delete a user record
296
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
297
- * @param playerId The OneSignal player_id
370
+ * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
371
+ * @param appId
372
+ * @param aliasLabel
373
+ * @param aliasId
374
+ * @param createSubscriptionRequestBody
298
375
  */
299
- public async deletePlayer(appId: string, playerId: string, _options?: Configuration): Promise<RequestContext> {
376
+ public async createSubscription(appId: string, aliasLabel: string, aliasId: string, createSubscriptionRequestBody: CreateSubscriptionRequestBody, _options?: Configuration): Promise<RequestContext> {
300
377
  let _config = _options || this.configuration;
301
378
 
302
379
  // verify required parameter 'appId' is not null or undefined
303
380
  if (appId === null || appId === undefined) {
304
- throw new RequiredError("DefaultApi", "deletePlayer", "appId");
305
- }
306
-
307
-
308
- // verify required parameter 'playerId' is not null or undefined
309
- if (playerId === null || playerId === undefined) {
310
- throw new RequiredError("DefaultApi", "deletePlayer", "playerId");
311
- }
312
-
313
-
314
- // Path Params
315
- const localVarPath = '/players/{player_id}'
316
- .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
317
-
318
- // Make Request Context
319
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
320
- requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
321
-
322
- // Query Params
323
- if (appId !== undefined) {
324
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
381
+ throw new RequiredError("DefaultApi", "createSubscription", "appId");
325
382
  }
326
383
 
327
384
 
328
- let authMethod: SecurityAuthentication | undefined;
329
- // Apply auth methods
330
- authMethod = _config.authMethods["app_key"]
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);
385
+ // verify required parameter 'aliasLabel' is not null or undefined
386
+ if (aliasLabel === null || aliasLabel === undefined) {
387
+ throw new RequiredError("DefaultApi", "createSubscription", "aliasLabel");
338
388
  }
339
389
 
340
- return requestContext;
341
- }
342
-
343
- /**
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.
345
- * Delete Segments
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.
348
- */
349
- public async deleteSegments(appId: string, segmentId: string, _options?: Configuration): Promise<RequestContext> {
350
- let _config = _options || this.configuration;
351
390
 
352
- // verify required parameter 'appId' is not null or undefined
353
- if (appId === null || appId === undefined) {
354
- throw new RequiredError("DefaultApi", "deleteSegments", "appId");
391
+ // verify required parameter 'aliasId' is not null or undefined
392
+ if (aliasId === null || aliasId === undefined) {
393
+ throw new RequiredError("DefaultApi", "createSubscription", "aliasId");
355
394
  }
356
395
 
357
396
 
358
- // verify required parameter 'segmentId' is not null or undefined
359
- if (segmentId === null || segmentId === undefined) {
360
- throw new RequiredError("DefaultApi", "deleteSegments", "segmentId");
397
+ // verify required parameter 'createSubscriptionRequestBody' is not null or undefined
398
+ if (createSubscriptionRequestBody === null || createSubscriptionRequestBody === undefined) {
399
+ throw new RequiredError("DefaultApi", "createSubscription", "createSubscriptionRequestBody");
361
400
  }
362
401
 
363
402
 
364
403
  // Path Params
365
- const localVarPath = '/apps/{app_id}/segments/{segment_id}'
404
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions'
366
405
  .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
367
- .replace('{' + 'segment_id' + '}', encodeURIComponent(String(segmentId)));
406
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
407
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
368
408
 
369
409
  // Make Request Context
370
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
410
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
371
411
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
372
412
 
373
413
 
414
+ // Body Params
415
+ const contentType = ObjectSerializer.getPreferredMediaType([
416
+ "application/json"
417
+ ]);
418
+ requestContext.setHeaderParam("Content-Type", contentType);
419
+ const serializedBody = ObjectSerializer.stringify(
420
+ ObjectSerializer.serialize(createSubscriptionRequestBody, "CreateSubscriptionRequestBody", ""),
421
+ contentType
422
+ );
423
+ requestContext.setBody(serializedBody);
424
+
374
425
  let authMethod: SecurityAuthentication | undefined;
375
426
  // Apply auth methods
376
427
  authMethod = _config.authMethods["app_key"]
@@ -387,23 +438,27 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
387
438
  }
388
439
 
389
440
  /**
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. |
391
- * CSV export
392
- * @param appId The app ID that you want to export devices from
393
- * @param exportPlayersRequestBody
441
+ * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
442
+ * @param appId
443
+ * @param user
394
444
  */
395
- public async exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _options?: Configuration): Promise<RequestContext> {
445
+ public async createUser(appId: string, user: User, _options?: Configuration): Promise<RequestContext> {
396
446
  let _config = _options || this.configuration;
397
447
 
398
448
  // verify required parameter 'appId' is not null or undefined
399
449
  if (appId === null || appId === undefined) {
400
- throw new RequiredError("DefaultApi", "exportPlayers", "appId");
450
+ throw new RequiredError("DefaultApi", "createUser", "appId");
401
451
  }
402
452
 
403
453
 
454
+ // verify required parameter 'user' is not null or undefined
455
+ if (user === null || user === undefined) {
456
+ throw new RequiredError("DefaultApi", "createUser", "user");
457
+ }
458
+
404
459
 
405
460
  // Path Params
406
- const localVarPath = '/players/csv_export?app_id={app_id}'
461
+ const localVarPath = '/apps/{app_id}/users'
407
462
  .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
408
463
 
409
464
  // Make Request Context
@@ -417,7 +472,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
417
472
  ]);
418
473
  requestContext.setHeaderParam("Content-Type", contentType);
419
474
  const serializedBody = ObjectSerializer.stringify(
420
- ObjectSerializer.serialize(exportPlayersRequestBody, "ExportPlayersRequestBody", ""),
475
+ ObjectSerializer.serialize(user, "User", ""),
421
476
  contentType
422
477
  );
423
478
  requestContext.setBody(serializedBody);
@@ -438,31 +493,54 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
438
493
  }
439
494
 
440
495
  /**
441
- * View the details of a single OneSignal app
442
- * View an app
443
- * @param appId An app id
496
+ * Deletes an alias by alias label
497
+ * @param appId
498
+ * @param aliasLabel
499
+ * @param aliasId
500
+ * @param aliasLabelToDelete
444
501
  */
445
- public async getApp(appId: string, _options?: Configuration): Promise<RequestContext> {
502
+ public async deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: string, _options?: Configuration): Promise<RequestContext> {
446
503
  let _config = _options || this.configuration;
447
504
 
448
505
  // verify required parameter 'appId' is not null or undefined
449
506
  if (appId === null || appId === undefined) {
450
- throw new RequiredError("DefaultApi", "getApp", "appId");
507
+ throw new RequiredError("DefaultApi", "deleteAlias", "appId");
508
+ }
509
+
510
+
511
+ // verify required parameter 'aliasLabel' is not null or undefined
512
+ if (aliasLabel === null || aliasLabel === undefined) {
513
+ throw new RequiredError("DefaultApi", "deleteAlias", "aliasLabel");
514
+ }
515
+
516
+
517
+ // verify required parameter 'aliasId' is not null or undefined
518
+ if (aliasId === null || aliasId === undefined) {
519
+ throw new RequiredError("DefaultApi", "deleteAlias", "aliasId");
520
+ }
521
+
522
+
523
+ // verify required parameter 'aliasLabelToDelete' is not null or undefined
524
+ if (aliasLabelToDelete === null || aliasLabelToDelete === undefined) {
525
+ throw new RequiredError("DefaultApi", "deleteAlias", "aliasLabelToDelete");
451
526
  }
452
527
 
453
528
 
454
529
  // Path Params
455
- const localVarPath = '/apps/{app_id}'
456
- .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
530
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'
531
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
532
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
533
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)))
534
+ .replace('{' + 'alias_label_to_delete' + '}', encodeURIComponent(String(aliasLabelToDelete)));
457
535
 
458
536
  // Make Request Context
459
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
537
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
460
538
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
461
539
 
462
540
 
463
541
  let authMethod: SecurityAuthentication | undefined;
464
542
  // Apply auth methods
465
- authMethod = _config.authMethods["user_key"]
543
+ authMethod = _config.authMethods["app_key"]
466
544
  if (authMethod?.applySecurityAuthentication) {
467
545
  await authMethod?.applySecurityAuthentication(requestContext);
468
546
  }
@@ -476,23 +554,43 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
476
554
  }
477
555
 
478
556
  /**
479
- * View the details of all of your current OneSignal apps
480
- * View apps
557
+ * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
558
+ * Delete a user record
559
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
560
+ * @param playerId The OneSignal player_id
481
561
  */
482
- public async getApps(_options?: Configuration): Promise<RequestContext> {
562
+ public async deletePlayer(appId: string, playerId: string, _options?: Configuration): Promise<RequestContext> {
483
563
  let _config = _options || this.configuration;
484
564
 
565
+ // verify required parameter 'appId' is not null or undefined
566
+ if (appId === null || appId === undefined) {
567
+ throw new RequiredError("DefaultApi", "deletePlayer", "appId");
568
+ }
569
+
570
+
571
+ // verify required parameter 'playerId' is not null or undefined
572
+ if (playerId === null || playerId === undefined) {
573
+ throw new RequiredError("DefaultApi", "deletePlayer", "playerId");
574
+ }
575
+
576
+
485
577
  // Path Params
486
- const localVarPath = '/apps';
578
+ const localVarPath = '/players/{player_id}'
579
+ .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
487
580
 
488
581
  // Make Request Context
489
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
582
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
490
583
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
491
584
 
585
+ // Query Params
586
+ if (appId !== undefined) {
587
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
588
+ }
589
+
492
590
 
493
591
  let authMethod: SecurityAuthentication | undefined;
494
592
  // Apply auth methods
495
- authMethod = _config.authMethods["user_key"]
593
+ authMethod = _config.authMethods["app_key"]
496
594
  if (authMethod?.applySecurityAuthentication) {
497
595
  await authMethod?.applySecurityAuthentication(requestContext);
498
596
  }
@@ -506,39 +604,35 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
506
604
  }
507
605
 
508
606
  /**
509
- * View the details of a single notification and outcomes associated with it
510
- * View notification
511
- * @param appId
512
- * @param notificationId
607
+ * 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.
608
+ * Delete Segments
609
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
610
+ * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard.
513
611
  */
514
- public async getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<RequestContext> {
612
+ public async deleteSegments(appId: string, segmentId: string, _options?: Configuration): Promise<RequestContext> {
515
613
  let _config = _options || this.configuration;
516
614
 
517
615
  // verify required parameter 'appId' is not null or undefined
518
616
  if (appId === null || appId === undefined) {
519
- throw new RequiredError("DefaultApi", "getNotification", "appId");
617
+ throw new RequiredError("DefaultApi", "deleteSegments", "appId");
520
618
  }
521
619
 
522
620
 
523
- // verify required parameter 'notificationId' is not null or undefined
524
- if (notificationId === null || notificationId === undefined) {
525
- throw new RequiredError("DefaultApi", "getNotification", "notificationId");
621
+ // verify required parameter 'segmentId' is not null or undefined
622
+ if (segmentId === null || segmentId === undefined) {
623
+ throw new RequiredError("DefaultApi", "deleteSegments", "segmentId");
526
624
  }
527
625
 
528
626
 
529
627
  // Path Params
530
- const localVarPath = '/notifications/{notification_id}'
531
- .replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
628
+ const localVarPath = '/apps/{app_id}/segments/{segment_id}'
629
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
630
+ .replace('{' + 'segment_id' + '}', encodeURIComponent(String(segmentId)));
532
631
 
533
632
  // Make Request Context
534
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
633
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
535
634
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
536
635
 
537
- // Query Params
538
- if (appId !== undefined) {
539
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
540
- }
541
-
542
636
 
543
637
  let authMethod: SecurityAuthentication | undefined;
544
638
  // Apply auth methods
@@ -556,46 +650,35 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
556
650
  }
557
651
 
558
652
  /**
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.
560
- * Notification History
561
- * @param notificationId The \&quot;id\&quot; of the message found in the Notification object
562
- * @param getNotificationRequestBody
653
+ * Deletes the Subscription.
654
+ * @param appId
655
+ * @param subscriptionId
563
656
  */
564
- public async getNotificationHistory(notificationId: string, getNotificationRequestBody: GetNotificationRequestBody, _options?: Configuration): Promise<RequestContext> {
657
+ public async deleteSubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise<RequestContext> {
565
658
  let _config = _options || this.configuration;
566
659
 
567
- // verify required parameter 'notificationId' is not null or undefined
568
- if (notificationId === null || notificationId === undefined) {
569
- throw new RequiredError("DefaultApi", "getNotificationHistory", "notificationId");
660
+ // verify required parameter 'appId' is not null or undefined
661
+ if (appId === null || appId === undefined) {
662
+ throw new RequiredError("DefaultApi", "deleteSubscription", "appId");
570
663
  }
571
664
 
572
665
 
573
- // verify required parameter 'getNotificationRequestBody' is not null or undefined
574
- if (getNotificationRequestBody === null || getNotificationRequestBody === undefined) {
575
- throw new RequiredError("DefaultApi", "getNotificationHistory", "getNotificationRequestBody");
666
+ // verify required parameter 'subscriptionId' is not null or undefined
667
+ if (subscriptionId === null || subscriptionId === undefined) {
668
+ throw new RequiredError("DefaultApi", "deleteSubscription", "subscriptionId");
576
669
  }
577
670
 
578
671
 
579
672
  // Path Params
580
- const localVarPath = '/notifications/{notification_id}/history'
581
- .replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
673
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}'
674
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
675
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
582
676
 
583
677
  // Make Request Context
584
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
678
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
585
679
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
586
680
 
587
681
 
588
- // Body Params
589
- const contentType = ObjectSerializer.getPreferredMediaType([
590
- "application/json"
591
- ]);
592
- requestContext.setHeaderParam("Content-Type", contentType);
593
- const serializedBody = ObjectSerializer.stringify(
594
- ObjectSerializer.serialize(getNotificationRequestBody, "GetNotificationRequestBody", ""),
595
- contentType
596
- );
597
- requestContext.setBody(serializedBody);
598
-
599
682
  let authMethod: SecurityAuthentication | undefined;
600
683
  // Apply auth methods
601
684
  authMethod = _config.authMethods["app_key"]
@@ -612,59 +695,43 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
612
695
  }
613
696
 
614
697
  /**
615
- * View the details of multiple notifications
616
- * View notifications
617
- * @param appId The app ID that you want to view notifications from
618
- * @param limit How many notifications to return. Max is 50. Default is 50.
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.
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
698
+ * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
699
+ * @param appId
700
+ * @param aliasLabel
701
+ * @param aliasId
621
702
  */
622
- public async getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<RequestContext> {
703
+ public async deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<RequestContext> {
623
704
  let _config = _options || this.configuration;
624
705
 
625
706
  // verify required parameter 'appId' is not null or undefined
626
707
  if (appId === null || appId === undefined) {
627
- throw new RequiredError("DefaultApi", "getNotifications", "appId");
708
+ throw new RequiredError("DefaultApi", "deleteUser", "appId");
628
709
  }
629
710
 
630
711
 
712
+ // verify required parameter 'aliasLabel' is not null or undefined
713
+ if (aliasLabel === null || aliasLabel === undefined) {
714
+ throw new RequiredError("DefaultApi", "deleteUser", "aliasLabel");
715
+ }
716
+
631
717
 
718
+ // verify required parameter 'aliasId' is not null or undefined
719
+ if (aliasId === null || aliasId === undefined) {
720
+ throw new RequiredError("DefaultApi", "deleteUser", "aliasId");
721
+ }
632
722
 
633
723
 
634
724
  // Path Params
635
- const localVarPath = '/notifications';
725
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
726
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
727
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
728
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
636
729
 
637
730
  // Make Request Context
638
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
731
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
639
732
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
640
733
 
641
- // Query Params
642
- if (appId !== undefined) {
643
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
644
- }
645
-
646
- // Query Params
647
- if (limit !== undefined) {
648
- requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
649
- }
650
-
651
- // Query Params
652
- if (offset !== undefined) {
653
- requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
654
- }
655
-
656
- // Query Params
657
- if (kind !== undefined) {
658
- requestContext.setQueryParam("kind", ObjectSerializer.serialize(kind, "0 | 1 | 3", ""));
659
- }
660
-
661
734
 
662
- let authMethod: SecurityAuthentication | undefined;
663
- // Apply auth methods
664
- authMethod = _config.authMethods["app_key"]
665
- if (authMethod?.applySecurityAuthentication) {
666
- await authMethod?.applySecurityAuthentication(requestContext);
667
- }
668
735
 
669
736
  const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
670
737
  if (defaultAuth?.applySecurityAuthentication) {
@@ -675,67 +742,43 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
675
742
  }
676
743
 
677
744
  /**
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.
679
- * View Outcomes
745
+ * Stops a Live Activity
746
+ * Stop Live Activity
680
747
  * @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.
748
+ * @param activityId Live Activity record ID
749
+ * @param subscriptionId Subscription ID
686
750
  */
687
- public async getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<RequestContext> {
751
+ public async endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Promise<RequestContext> {
688
752
  let _config = _options || this.configuration;
689
753
 
690
754
  // verify required parameter 'appId' is not null or undefined
691
755
  if (appId === null || appId === undefined) {
692
- throw new RequiredError("DefaultApi", "getOutcomes", "appId");
756
+ throw new RequiredError("DefaultApi", "endLiveActivity", "appId");
693
757
  }
694
758
 
695
759
 
696
- // verify required parameter 'outcomeNames' is not null or undefined
697
- if (outcomeNames === null || outcomeNames === undefined) {
698
- throw new RequiredError("DefaultApi", "getOutcomes", "outcomeNames");
760
+ // verify required parameter 'activityId' is not null or undefined
761
+ if (activityId === null || activityId === undefined) {
762
+ throw new RequiredError("DefaultApi", "endLiveActivity", "activityId");
699
763
  }
700
764
 
701
765
 
702
-
703
-
766
+ // verify required parameter 'subscriptionId' is not null or undefined
767
+ if (subscriptionId === null || subscriptionId === undefined) {
768
+ throw new RequiredError("DefaultApi", "endLiveActivity", "subscriptionId");
769
+ }
704
770
 
705
771
 
706
772
  // Path Params
707
- const localVarPath = '/apps/{app_id}/outcomes'
708
- .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
773
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'
774
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
775
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)))
776
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
709
777
 
710
778
  // Make Request Context
711
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
779
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
712
780
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
713
781
 
714
- // Query Params
715
- if (outcomeNames !== undefined) {
716
- requestContext.setQueryParam("outcome_names", ObjectSerializer.serialize(outcomeNames, "string", ""));
717
- }
718
-
719
- // Query Params
720
- if (outcomeNames2 !== undefined) {
721
- requestContext.setQueryParam("outcome_names[]", ObjectSerializer.serialize(outcomeNames2, "string", ""));
722
- }
723
-
724
- // Query Params
725
- if (outcomeTimeRange !== undefined) {
726
- requestContext.setQueryParam("outcome_time_range", ObjectSerializer.serialize(outcomeTimeRange, "string", ""));
727
- }
728
-
729
- // Query Params
730
- if (outcomePlatforms !== undefined) {
731
- requestContext.setQueryParam("outcome_platforms", ObjectSerializer.serialize(outcomePlatforms, "string", ""));
732
- }
733
-
734
- // Query Params
735
- if (outcomeAttribution !== undefined) {
736
- requestContext.setQueryParam("outcome_attribution", ObjectSerializer.serialize(outcomeAttribution, "string", ""));
737
- }
738
-
739
782
 
740
783
  let authMethod: SecurityAuthentication | undefined;
741
784
  // Apply auth methods
@@ -753,46 +796,40 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
753
796
  }
754
797
 
755
798
  /**
756
- * View the details of an existing device in one of your OneSignal apps
757
- * View device
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).
799
+ * 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. |
800
+ * CSV export
801
+ * @param appId The app ID that you want to export devices from
802
+ * @param exportPlayersRequestBody
761
803
  */
762
- public async getPlayer(appId: string, playerId: string, emailAuthHash?: string, _options?: Configuration): Promise<RequestContext> {
804
+ public async exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _options?: Configuration): Promise<RequestContext> {
763
805
  let _config = _options || this.configuration;
764
806
 
765
807
  // verify required parameter 'appId' is not null or undefined
766
808
  if (appId === null || appId === undefined) {
767
- throw new RequiredError("DefaultApi", "getPlayer", "appId");
768
- }
769
-
770
-
771
- // verify required parameter 'playerId' is not null or undefined
772
- if (playerId === null || playerId === undefined) {
773
- throw new RequiredError("DefaultApi", "getPlayer", "playerId");
809
+ throw new RequiredError("DefaultApi", "exportPlayers", "appId");
774
810
  }
775
811
 
776
812
 
777
813
 
778
814
  // Path Params
779
- const localVarPath = '/players/{player_id}'
780
- .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
815
+ const localVarPath = '/players/csv_export?app_id={app_id}'
816
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
781
817
 
782
818
  // Make Request Context
783
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
819
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
784
820
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
785
821
 
786
- // Query Params
787
- if (appId !== undefined) {
788
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
789
- }
790
-
791
- // Query Params
792
- if (emailAuthHash !== undefined) {
793
- requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(emailAuthHash, "string", ""));
794
- }
795
822
 
823
+ // Body Params
824
+ const contentType = ObjectSerializer.getPreferredMediaType([
825
+ "application/json"
826
+ ]);
827
+ requestContext.setHeaderParam("Content-Type", contentType);
828
+ const serializedBody = ObjectSerializer.stringify(
829
+ ObjectSerializer.serialize(exportPlayersRequestBody, "ExportPlayersRequestBody", ""),
830
+ contentType
831
+ );
832
+ requestContext.setBody(serializedBody);
796
833
 
797
834
  let authMethod: SecurityAuthentication | undefined;
798
835
  // Apply auth methods
@@ -810,45 +847,34 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
810
847
  }
811
848
 
812
849
  /**
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.
814
- * View devices
815
- * @param appId The app ID that you want to view players from
816
- * @param limit How many devices to return. Max is 300. Default is 300
817
- * @param offset Result offset. Default is 0. Results are sorted by id;
850
+ * Lists all Aliases for the User identified by :subscription_id.
851
+ * @param appId
852
+ * @param subscriptionId
818
853
  */
819
- public async getPlayers(appId: string, limit?: number, offset?: number, _options?: Configuration): Promise<RequestContext> {
854
+ public async fetchAliases(appId: string, subscriptionId: string, _options?: Configuration): Promise<RequestContext> {
820
855
  let _config = _options || this.configuration;
821
856
 
822
857
  // verify required parameter 'appId' is not null or undefined
823
858
  if (appId === null || appId === undefined) {
824
- throw new RequiredError("DefaultApi", "getPlayers", "appId");
859
+ throw new RequiredError("DefaultApi", "fetchAliases", "appId");
825
860
  }
826
861
 
827
862
 
863
+ // verify required parameter 'subscriptionId' is not null or undefined
864
+ if (subscriptionId === null || subscriptionId === undefined) {
865
+ throw new RequiredError("DefaultApi", "fetchAliases", "subscriptionId");
866
+ }
828
867
 
829
868
 
830
869
  // Path Params
831
- const localVarPath = '/players';
870
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'
871
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
872
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
832
873
 
833
874
  // Make Request Context
834
875
  const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
835
876
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
836
877
 
837
- // Query Params
838
- if (appId !== undefined) {
839
- requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
840
- }
841
-
842
- // Query Params
843
- if (limit !== undefined) {
844
- requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
845
- }
846
-
847
- // Query Params
848
- if (offset !== undefined) {
849
- requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
850
- }
851
-
852
878
 
853
879
  let authMethod: SecurityAuthentication | undefined;
854
880
  // Apply auth methods
@@ -866,49 +892,46 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
866
892
  }
867
893
 
868
894
  /**
869
- * Updates the name or configuration settings of an existing OneSignal app
870
- * Update an app
871
- * @param appId An app id
872
- * @param app
895
+ * Returns the User’s properties, Aliases, and Subscriptions.
896
+ * @param appId
897
+ * @param aliasLabel
898
+ * @param aliasId
873
899
  */
874
- public async updateApp(appId: string, app: App, _options?: Configuration): Promise<RequestContext> {
900
+ public async fetchUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<RequestContext> {
875
901
  let _config = _options || this.configuration;
876
902
 
877
903
  // verify required parameter 'appId' is not null or undefined
878
904
  if (appId === null || appId === undefined) {
879
- throw new RequiredError("DefaultApi", "updateApp", "appId");
905
+ throw new RequiredError("DefaultApi", "fetchUser", "appId");
880
906
  }
881
907
 
882
908
 
883
- // verify required parameter 'app' is not null or undefined
884
- if (app === null || app === undefined) {
885
- throw new RequiredError("DefaultApi", "updateApp", "app");
909
+ // verify required parameter 'aliasLabel' is not null or undefined
910
+ if (aliasLabel === null || aliasLabel === undefined) {
911
+ throw new RequiredError("DefaultApi", "fetchUser", "aliasLabel");
912
+ }
913
+
914
+
915
+ // verify required parameter 'aliasId' is not null or undefined
916
+ if (aliasId === null || aliasId === undefined) {
917
+ throw new RequiredError("DefaultApi", "fetchUser", "aliasId");
886
918
  }
887
919
 
888
920
 
889
921
  // Path Params
890
- const localVarPath = '/apps/{app_id}'
891
- .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
922
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
923
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
924
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
925
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
892
926
 
893
927
  // Make Request Context
894
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
928
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
895
929
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
896
930
 
897
931
 
898
- // Body Params
899
- const contentType = ObjectSerializer.getPreferredMediaType([
900
- "application/json"
901
- ]);
902
- requestContext.setHeaderParam("Content-Type", contentType);
903
- const serializedBody = ObjectSerializer.stringify(
904
- ObjectSerializer.serialize(app, "App", ""),
905
- contentType
906
- );
907
- requestContext.setBody(serializedBody);
908
-
909
932
  let authMethod: SecurityAuthentication | undefined;
910
933
  // Apply auth methods
911
- authMethod = _config.authMethods["user_key"]
934
+ authMethod = _config.authMethods["app_key"]
912
935
  if (authMethod?.applySecurityAuthentication) {
913
936
  await authMethod?.applySecurityAuthentication(requestContext);
914
937
  }
@@ -922,46 +945,43 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
922
945
  }
923
946
 
924
947
  /**
925
- * Update an existing device in one of your OneSignal apps
926
- * Edit device
927
- * @param playerId Player\&#39;s OneSignal ID
928
- * @param player
948
+ * Lists all Aliases for the User identified by (:alias_label, :alias_id).
949
+ * @param appId
950
+ * @param aliasLabel
951
+ * @param aliasId
929
952
  */
930
- public async updatePlayer(playerId: string, player: Player, _options?: Configuration): Promise<RequestContext> {
953
+ public async fetchUserIdentity(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<RequestContext> {
931
954
  let _config = _options || this.configuration;
932
955
 
933
- // verify required parameter 'playerId' is not null or undefined
934
- if (playerId === null || playerId === undefined) {
935
- throw new RequiredError("DefaultApi", "updatePlayer", "playerId");
956
+ // verify required parameter 'appId' is not null or undefined
957
+ if (appId === null || appId === undefined) {
958
+ throw new RequiredError("DefaultApi", "fetchUserIdentity", "appId");
936
959
  }
937
960
 
938
961
 
939
- // verify required parameter 'player' is not null or undefined
940
- if (player === null || player === undefined) {
941
- throw new RequiredError("DefaultApi", "updatePlayer", "player");
962
+ // verify required parameter 'aliasLabel' is not null or undefined
963
+ if (aliasLabel === null || aliasLabel === undefined) {
964
+ throw new RequiredError("DefaultApi", "fetchUserIdentity", "aliasLabel");
965
+ }
966
+
967
+
968
+ // verify required parameter 'aliasId' is not null or undefined
969
+ if (aliasId === null || aliasId === undefined) {
970
+ throw new RequiredError("DefaultApi", "fetchUserIdentity", "aliasId");
942
971
  }
943
972
 
944
973
 
945
974
  // Path Params
946
- const localVarPath = '/players/{player_id}'
947
- .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
975
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'
976
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
977
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
978
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
948
979
 
949
980
  // Make Request Context
950
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
981
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
951
982
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
952
983
 
953
984
 
954
- // Body Params
955
- const contentType = ObjectSerializer.getPreferredMediaType([
956
- "application/json"
957
- ]);
958
- requestContext.setHeaderParam("Content-Type", contentType);
959
- const serializedBody = ObjectSerializer.stringify(
960
- ObjectSerializer.serialize(player, "Player", ""),
961
- contentType
962
- );
963
- requestContext.setBody(serializedBody);
964
-
965
985
  let authMethod: SecurityAuthentication | undefined;
966
986
  // Apply auth methods
967
987
  authMethod = _config.authMethods["app_key"]
@@ -978,52 +998,31 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
978
998
  }
979
999
 
980
1000
  /**
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\" }
982
- * Edit tags with external user id
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
1001
+ * View the details of a single OneSignal app
1002
+ * View an app
1003
+ * @param appId An app id
986
1004
  */
987
- public async updatePlayerTags(appId: string, externalUserId: string, updatePlayerTagsRequestBody?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<RequestContext> {
1005
+ public async getApp(appId: string, _options?: Configuration): Promise<RequestContext> {
988
1006
  let _config = _options || this.configuration;
989
1007
 
990
1008
  // verify required parameter 'appId' is not null or undefined
991
1009
  if (appId === null || appId === undefined) {
992
- throw new RequiredError("DefaultApi", "updatePlayerTags", "appId");
993
- }
994
-
995
-
996
- // verify required parameter 'externalUserId' is not null or undefined
997
- if (externalUserId === null || externalUserId === undefined) {
998
- throw new RequiredError("DefaultApi", "updatePlayerTags", "externalUserId");
1010
+ throw new RequiredError("DefaultApi", "getApp", "appId");
999
1011
  }
1000
1012
 
1001
1013
 
1002
-
1003
1014
  // Path Params
1004
- const localVarPath = '/apps/{app_id}/users/{external_user_id}'
1005
- .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1006
- .replace('{' + 'external_user_id' + '}', encodeURIComponent(String(externalUserId)));
1015
+ const localVarPath = '/apps/{app_id}'
1016
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
1007
1017
 
1008
1018
  // Make Request Context
1009
- const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
1019
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1010
1020
  requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1011
1021
 
1012
1022
 
1013
- // Body Params
1014
- const contentType = ObjectSerializer.getPreferredMediaType([
1015
- "application/json"
1016
- ]);
1017
- requestContext.setHeaderParam("Content-Type", contentType);
1018
- const serializedBody = ObjectSerializer.stringify(
1019
- ObjectSerializer.serialize(updatePlayerTagsRequestBody, "UpdatePlayerTagsRequestBody", ""),
1020
- contentType
1021
- );
1022
- requestContext.setBody(serializedBody);
1023
-
1024
1023
  let authMethod: SecurityAuthentication | undefined;
1025
1024
  // Apply auth methods
1026
- authMethod = _config.authMethods["app_key"]
1025
+ authMethod = _config.authMethods["user_key"]
1027
1026
  if (authMethod?.applySecurityAuthentication) {
1028
1027
  await authMethod?.applySecurityAuthentication(requestContext);
1029
1028
  }
@@ -1036,9 +1035,1047 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
1036
1035
  return requestContext;
1037
1036
  }
1038
1037
 
1039
- }
1038
+ /**
1039
+ * View the details of all of your current OneSignal apps
1040
+ * View apps
1041
+ */
1042
+ public async getApps(_options?: Configuration): Promise<RequestContext> {
1043
+ let _config = _options || this.configuration;
1040
1044
 
1041
- export class DefaultApiResponseProcessor {
1045
+ // Path Params
1046
+ const localVarPath = '/apps';
1047
+
1048
+ // Make Request Context
1049
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1050
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1051
+
1052
+
1053
+ let authMethod: SecurityAuthentication | undefined;
1054
+ // Apply auth methods
1055
+ authMethod = _config.authMethods["user_key"]
1056
+ if (authMethod?.applySecurityAuthentication) {
1057
+ await authMethod?.applySecurityAuthentication(requestContext);
1058
+ }
1059
+
1060
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1061
+ if (defaultAuth?.applySecurityAuthentication) {
1062
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1063
+ }
1064
+
1065
+ return requestContext;
1066
+ }
1067
+
1068
+ /**
1069
+ * Manifest of In-App Messages the Subscription is eligible to display by the SDK.
1070
+ * @param appId
1071
+ * @param subscriptionId
1072
+ */
1073
+ public async getEligibleIams(appId: string, subscriptionId: string, _options?: Configuration): Promise<RequestContext> {
1074
+ let _config = _options || this.configuration;
1075
+
1076
+ // verify required parameter 'appId' is not null or undefined
1077
+ if (appId === null || appId === undefined) {
1078
+ throw new RequiredError("DefaultApi", "getEligibleIams", "appId");
1079
+ }
1080
+
1081
+
1082
+ // verify required parameter 'subscriptionId' is not null or undefined
1083
+ if (subscriptionId === null || subscriptionId === undefined) {
1084
+ throw new RequiredError("DefaultApi", "getEligibleIams", "subscriptionId");
1085
+ }
1086
+
1087
+
1088
+ // Path Params
1089
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/iams'
1090
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1091
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
1092
+
1093
+ // Make Request Context
1094
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1095
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1096
+
1097
+
1098
+ let authMethod: SecurityAuthentication | undefined;
1099
+ // Apply auth methods
1100
+ authMethod = _config.authMethods["app_key"]
1101
+ if (authMethod?.applySecurityAuthentication) {
1102
+ await authMethod?.applySecurityAuthentication(requestContext);
1103
+ }
1104
+
1105
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1106
+ if (defaultAuth?.applySecurityAuthentication) {
1107
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1108
+ }
1109
+
1110
+ return requestContext;
1111
+ }
1112
+
1113
+ /**
1114
+ * View the details of a single notification and outcomes associated with it
1115
+ * View notification
1116
+ * @param appId
1117
+ * @param notificationId
1118
+ */
1119
+ public async getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<RequestContext> {
1120
+ let _config = _options || this.configuration;
1121
+
1122
+ // verify required parameter 'appId' is not null or undefined
1123
+ if (appId === null || appId === undefined) {
1124
+ throw new RequiredError("DefaultApi", "getNotification", "appId");
1125
+ }
1126
+
1127
+
1128
+ // verify required parameter 'notificationId' is not null or undefined
1129
+ if (notificationId === null || notificationId === undefined) {
1130
+ throw new RequiredError("DefaultApi", "getNotification", "notificationId");
1131
+ }
1132
+
1133
+
1134
+ // Path Params
1135
+ const localVarPath = '/notifications/{notification_id}'
1136
+ .replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
1137
+
1138
+ // Make Request Context
1139
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1140
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1141
+
1142
+ // Query Params
1143
+ if (appId !== undefined) {
1144
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
1145
+ }
1146
+
1147
+
1148
+ let authMethod: SecurityAuthentication | undefined;
1149
+ // Apply auth methods
1150
+ authMethod = _config.authMethods["app_key"]
1151
+ if (authMethod?.applySecurityAuthentication) {
1152
+ await authMethod?.applySecurityAuthentication(requestContext);
1153
+ }
1154
+
1155
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1156
+ if (defaultAuth?.applySecurityAuthentication) {
1157
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1158
+ }
1159
+
1160
+ return requestContext;
1161
+ }
1162
+
1163
+ /**
1164
+ * -> 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.
1165
+ * Notification History
1166
+ * @param notificationId The \&quot;id\&quot; of the message found in the Notification object
1167
+ * @param getNotificationRequestBody
1168
+ */
1169
+ public async getNotificationHistory(notificationId: string, getNotificationRequestBody: GetNotificationRequestBody, _options?: Configuration): Promise<RequestContext> {
1170
+ let _config = _options || this.configuration;
1171
+
1172
+ // verify required parameter 'notificationId' is not null or undefined
1173
+ if (notificationId === null || notificationId === undefined) {
1174
+ throw new RequiredError("DefaultApi", "getNotificationHistory", "notificationId");
1175
+ }
1176
+
1177
+
1178
+ // verify required parameter 'getNotificationRequestBody' is not null or undefined
1179
+ if (getNotificationRequestBody === null || getNotificationRequestBody === undefined) {
1180
+ throw new RequiredError("DefaultApi", "getNotificationHistory", "getNotificationRequestBody");
1181
+ }
1182
+
1183
+
1184
+ // Path Params
1185
+ const localVarPath = '/notifications/{notification_id}/history'
1186
+ .replace('{' + 'notification_id' + '}', encodeURIComponent(String(notificationId)));
1187
+
1188
+ // Make Request Context
1189
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
1190
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1191
+
1192
+
1193
+ // Body Params
1194
+ const contentType = ObjectSerializer.getPreferredMediaType([
1195
+ "application/json"
1196
+ ]);
1197
+ requestContext.setHeaderParam("Content-Type", contentType);
1198
+ const serializedBody = ObjectSerializer.stringify(
1199
+ ObjectSerializer.serialize(getNotificationRequestBody, "GetNotificationRequestBody", ""),
1200
+ contentType
1201
+ );
1202
+ requestContext.setBody(serializedBody);
1203
+
1204
+ let authMethod: SecurityAuthentication | undefined;
1205
+ // Apply auth methods
1206
+ authMethod = _config.authMethods["app_key"]
1207
+ if (authMethod?.applySecurityAuthentication) {
1208
+ await authMethod?.applySecurityAuthentication(requestContext);
1209
+ }
1210
+
1211
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1212
+ if (defaultAuth?.applySecurityAuthentication) {
1213
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1214
+ }
1215
+
1216
+ return requestContext;
1217
+ }
1218
+
1219
+ /**
1220
+ * View the details of multiple notifications
1221
+ * View notifications
1222
+ * @param appId The app ID that you want to view notifications from
1223
+ * @param limit How many notifications to return. Max is 50. Default is 50.
1224
+ * @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.
1225
+ * @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
1226
+ */
1227
+ public async getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<RequestContext> {
1228
+ let _config = _options || this.configuration;
1229
+
1230
+ // verify required parameter 'appId' is not null or undefined
1231
+ if (appId === null || appId === undefined) {
1232
+ throw new RequiredError("DefaultApi", "getNotifications", "appId");
1233
+ }
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+ // Path Params
1240
+ const localVarPath = '/notifications';
1241
+
1242
+ // Make Request Context
1243
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1244
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1245
+
1246
+ // Query Params
1247
+ if (appId !== undefined) {
1248
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
1249
+ }
1250
+
1251
+ // Query Params
1252
+ if (limit !== undefined) {
1253
+ requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
1254
+ }
1255
+
1256
+ // Query Params
1257
+ if (offset !== undefined) {
1258
+ requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
1259
+ }
1260
+
1261
+ // Query Params
1262
+ if (kind !== undefined) {
1263
+ requestContext.setQueryParam("kind", ObjectSerializer.serialize(kind, "0 | 1 | 3", ""));
1264
+ }
1265
+
1266
+
1267
+ let authMethod: SecurityAuthentication | undefined;
1268
+ // Apply auth methods
1269
+ authMethod = _config.authMethods["app_key"]
1270
+ if (authMethod?.applySecurityAuthentication) {
1271
+ await authMethod?.applySecurityAuthentication(requestContext);
1272
+ }
1273
+
1274
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1275
+ if (defaultAuth?.applySecurityAuthentication) {
1276
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1277
+ }
1278
+
1279
+ return requestContext;
1280
+ }
1281
+
1282
+ /**
1283
+ * 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.
1284
+ * View Outcomes
1285
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
1286
+ * @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
1287
+ * @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.
1288
+ * @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.
1289
+ * @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.
1290
+ * @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.
1291
+ */
1292
+ public async getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<RequestContext> {
1293
+ let _config = _options || this.configuration;
1294
+
1295
+ // verify required parameter 'appId' is not null or undefined
1296
+ if (appId === null || appId === undefined) {
1297
+ throw new RequiredError("DefaultApi", "getOutcomes", "appId");
1298
+ }
1299
+
1300
+
1301
+ // verify required parameter 'outcomeNames' is not null or undefined
1302
+ if (outcomeNames === null || outcomeNames === undefined) {
1303
+ throw new RequiredError("DefaultApi", "getOutcomes", "outcomeNames");
1304
+ }
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+ // Path Params
1312
+ const localVarPath = '/apps/{app_id}/outcomes'
1313
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
1314
+
1315
+ // Make Request Context
1316
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1317
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1318
+
1319
+ // Query Params
1320
+ if (outcomeNames !== undefined) {
1321
+ requestContext.setQueryParam("outcome_names", ObjectSerializer.serialize(outcomeNames, "string", ""));
1322
+ }
1323
+
1324
+ // Query Params
1325
+ if (outcomeNames2 !== undefined) {
1326
+ requestContext.setQueryParam("outcome_names[]", ObjectSerializer.serialize(outcomeNames2, "string", ""));
1327
+ }
1328
+
1329
+ // Query Params
1330
+ if (outcomeTimeRange !== undefined) {
1331
+ requestContext.setQueryParam("outcome_time_range", ObjectSerializer.serialize(outcomeTimeRange, "string", ""));
1332
+ }
1333
+
1334
+ // Query Params
1335
+ if (outcomePlatforms !== undefined) {
1336
+ requestContext.setQueryParam("outcome_platforms", ObjectSerializer.serialize(outcomePlatforms, "string", ""));
1337
+ }
1338
+
1339
+ // Query Params
1340
+ if (outcomeAttribution !== undefined) {
1341
+ requestContext.setQueryParam("outcome_attribution", ObjectSerializer.serialize(outcomeAttribution, "string", ""));
1342
+ }
1343
+
1344
+
1345
+ let authMethod: SecurityAuthentication | undefined;
1346
+ // Apply auth methods
1347
+ authMethod = _config.authMethods["app_key"]
1348
+ if (authMethod?.applySecurityAuthentication) {
1349
+ await authMethod?.applySecurityAuthentication(requestContext);
1350
+ }
1351
+
1352
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1353
+ if (defaultAuth?.applySecurityAuthentication) {
1354
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1355
+ }
1356
+
1357
+ return requestContext;
1358
+ }
1359
+
1360
+ /**
1361
+ * View the details of an existing device in one of your OneSignal apps
1362
+ * View device
1363
+ * @param appId Your app_id for this device
1364
+ * @param playerId Player\&#39;s OneSignal ID
1365
+ * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11).
1366
+ */
1367
+ public async getPlayer(appId: string, playerId: string, emailAuthHash?: string, _options?: Configuration): Promise<RequestContext> {
1368
+ let _config = _options || this.configuration;
1369
+
1370
+ // verify required parameter 'appId' is not null or undefined
1371
+ if (appId === null || appId === undefined) {
1372
+ throw new RequiredError("DefaultApi", "getPlayer", "appId");
1373
+ }
1374
+
1375
+
1376
+ // verify required parameter 'playerId' is not null or undefined
1377
+ if (playerId === null || playerId === undefined) {
1378
+ throw new RequiredError("DefaultApi", "getPlayer", "playerId");
1379
+ }
1380
+
1381
+
1382
+
1383
+ // Path Params
1384
+ const localVarPath = '/players/{player_id}'
1385
+ .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
1386
+
1387
+ // Make Request Context
1388
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1389
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1390
+
1391
+ // Query Params
1392
+ if (appId !== undefined) {
1393
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
1394
+ }
1395
+
1396
+ // Query Params
1397
+ if (emailAuthHash !== undefined) {
1398
+ requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(emailAuthHash, "string", ""));
1399
+ }
1400
+
1401
+
1402
+ let authMethod: SecurityAuthentication | undefined;
1403
+ // Apply auth methods
1404
+ authMethod = _config.authMethods["app_key"]
1405
+ if (authMethod?.applySecurityAuthentication) {
1406
+ await authMethod?.applySecurityAuthentication(requestContext);
1407
+ }
1408
+
1409
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1410
+ if (defaultAuth?.applySecurityAuthentication) {
1411
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1412
+ }
1413
+
1414
+ return requestContext;
1415
+ }
1416
+
1417
+ /**
1418
+ * 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.
1419
+ * View devices
1420
+ * @param appId The app ID that you want to view players from
1421
+ * @param limit How many devices to return. Max is 300. Default is 300
1422
+ * @param offset Result offset. Default is 0. Results are sorted by id;
1423
+ */
1424
+ public async getPlayers(appId: string, limit?: number, offset?: number, _options?: Configuration): Promise<RequestContext> {
1425
+ let _config = _options || this.configuration;
1426
+
1427
+ // verify required parameter 'appId' is not null or undefined
1428
+ if (appId === null || appId === undefined) {
1429
+ throw new RequiredError("DefaultApi", "getPlayers", "appId");
1430
+ }
1431
+
1432
+
1433
+
1434
+
1435
+ // Path Params
1436
+ const localVarPath = '/players';
1437
+
1438
+ // Make Request Context
1439
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
1440
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1441
+
1442
+ // Query Params
1443
+ if (appId !== undefined) {
1444
+ requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", ""));
1445
+ }
1446
+
1447
+ // Query Params
1448
+ if (limit !== undefined) {
1449
+ requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", ""));
1450
+ }
1451
+
1452
+ // Query Params
1453
+ if (offset !== undefined) {
1454
+ requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", ""));
1455
+ }
1456
+
1457
+
1458
+ let authMethod: SecurityAuthentication | undefined;
1459
+ // Apply auth methods
1460
+ authMethod = _config.authMethods["app_key"]
1461
+ if (authMethod?.applySecurityAuthentication) {
1462
+ await authMethod?.applySecurityAuthentication(requestContext);
1463
+ }
1464
+
1465
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1466
+ if (defaultAuth?.applySecurityAuthentication) {
1467
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1468
+ }
1469
+
1470
+ return requestContext;
1471
+ }
1472
+
1473
+ /**
1474
+ * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
1475
+ * @param appId
1476
+ * @param aliasLabel
1477
+ * @param aliasId
1478
+ * @param userIdentityRequestBody
1479
+ */
1480
+ public async identifyUserByAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Promise<RequestContext> {
1481
+ let _config = _options || this.configuration;
1482
+
1483
+ // verify required parameter 'appId' is not null or undefined
1484
+ if (appId === null || appId === undefined) {
1485
+ throw new RequiredError("DefaultApi", "identifyUserByAlias", "appId");
1486
+ }
1487
+
1488
+
1489
+ // verify required parameter 'aliasLabel' is not null or undefined
1490
+ if (aliasLabel === null || aliasLabel === undefined) {
1491
+ throw new RequiredError("DefaultApi", "identifyUserByAlias", "aliasLabel");
1492
+ }
1493
+
1494
+
1495
+ // verify required parameter 'aliasId' is not null or undefined
1496
+ if (aliasId === null || aliasId === undefined) {
1497
+ throw new RequiredError("DefaultApi", "identifyUserByAlias", "aliasId");
1498
+ }
1499
+
1500
+
1501
+ // verify required parameter 'userIdentityRequestBody' is not null or undefined
1502
+ if (userIdentityRequestBody === null || userIdentityRequestBody === undefined) {
1503
+ throw new RequiredError("DefaultApi", "identifyUserByAlias", "userIdentityRequestBody");
1504
+ }
1505
+
1506
+
1507
+ // Path Params
1508
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'
1509
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1510
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
1511
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
1512
+
1513
+ // Make Request Context
1514
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
1515
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1516
+
1517
+
1518
+ // Body Params
1519
+ const contentType = ObjectSerializer.getPreferredMediaType([
1520
+ "application/json"
1521
+ ]);
1522
+ requestContext.setHeaderParam("Content-Type", contentType);
1523
+ const serializedBody = ObjectSerializer.stringify(
1524
+ ObjectSerializer.serialize(userIdentityRequestBody, "UserIdentityRequestBody", ""),
1525
+ contentType
1526
+ );
1527
+ requestContext.setBody(serializedBody);
1528
+
1529
+ let authMethod: SecurityAuthentication | undefined;
1530
+ // Apply auth methods
1531
+ authMethod = _config.authMethods["app_key"]
1532
+ if (authMethod?.applySecurityAuthentication) {
1533
+ await authMethod?.applySecurityAuthentication(requestContext);
1534
+ }
1535
+
1536
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1537
+ if (defaultAuth?.applySecurityAuthentication) {
1538
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1539
+ }
1540
+
1541
+ return requestContext;
1542
+ }
1543
+
1544
+ /**
1545
+ * Upserts one or more Aliases for the User identified by :subscription_id.
1546
+ * @param appId
1547
+ * @param subscriptionId
1548
+ * @param userIdentityRequestBody
1549
+ */
1550
+ public async identifyUserBySubscriptionId(appId: string, subscriptionId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Promise<RequestContext> {
1551
+ let _config = _options || this.configuration;
1552
+
1553
+ // verify required parameter 'appId' is not null or undefined
1554
+ if (appId === null || appId === undefined) {
1555
+ throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "appId");
1556
+ }
1557
+
1558
+
1559
+ // verify required parameter 'subscriptionId' is not null or undefined
1560
+ if (subscriptionId === null || subscriptionId === undefined) {
1561
+ throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "subscriptionId");
1562
+ }
1563
+
1564
+
1565
+ // verify required parameter 'userIdentityRequestBody' is not null or undefined
1566
+ if (userIdentityRequestBody === null || userIdentityRequestBody === undefined) {
1567
+ throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "userIdentityRequestBody");
1568
+ }
1569
+
1570
+
1571
+ // Path Params
1572
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'
1573
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1574
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
1575
+
1576
+ // Make Request Context
1577
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
1578
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1579
+
1580
+
1581
+ // Body Params
1582
+ const contentType = ObjectSerializer.getPreferredMediaType([
1583
+ "application/json"
1584
+ ]);
1585
+ requestContext.setHeaderParam("Content-Type", contentType);
1586
+ const serializedBody = ObjectSerializer.stringify(
1587
+ ObjectSerializer.serialize(userIdentityRequestBody, "UserIdentityRequestBody", ""),
1588
+ contentType
1589
+ );
1590
+ requestContext.setBody(serializedBody);
1591
+
1592
+ let authMethod: SecurityAuthentication | undefined;
1593
+ // Apply auth methods
1594
+ authMethod = _config.authMethods["app_key"]
1595
+ if (authMethod?.applySecurityAuthentication) {
1596
+ await authMethod?.applySecurityAuthentication(requestContext);
1597
+ }
1598
+
1599
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1600
+ if (defaultAuth?.applySecurityAuthentication) {
1601
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1602
+ }
1603
+
1604
+ return requestContext;
1605
+ }
1606
+
1607
+ /**
1608
+ * Transfers this Subscription to the User identified by the identity in the payload.
1609
+ * @param appId
1610
+ * @param subscriptionId
1611
+ * @param transferSubscriptionRequestBody
1612
+ */
1613
+ public async transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _options?: Configuration): Promise<RequestContext> {
1614
+ let _config = _options || this.configuration;
1615
+
1616
+ // verify required parameter 'appId' is not null or undefined
1617
+ if (appId === null || appId === undefined) {
1618
+ throw new RequiredError("DefaultApi", "transferSubscription", "appId");
1619
+ }
1620
+
1621
+
1622
+ // verify required parameter 'subscriptionId' is not null or undefined
1623
+ if (subscriptionId === null || subscriptionId === undefined) {
1624
+ throw new RequiredError("DefaultApi", "transferSubscription", "subscriptionId");
1625
+ }
1626
+
1627
+
1628
+ // verify required parameter 'transferSubscriptionRequestBody' is not null or undefined
1629
+ if (transferSubscriptionRequestBody === null || transferSubscriptionRequestBody === undefined) {
1630
+ throw new RequiredError("DefaultApi", "transferSubscription", "transferSubscriptionRequestBody");
1631
+ }
1632
+
1633
+
1634
+ // Path Params
1635
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/owner'
1636
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1637
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
1638
+
1639
+ // Make Request Context
1640
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
1641
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1642
+
1643
+
1644
+ // Body Params
1645
+ const contentType = ObjectSerializer.getPreferredMediaType([
1646
+ "application/json"
1647
+ ]);
1648
+ requestContext.setHeaderParam("Content-Type", contentType);
1649
+ const serializedBody = ObjectSerializer.stringify(
1650
+ ObjectSerializer.serialize(transferSubscriptionRequestBody, "TransferSubscriptionRequestBody", ""),
1651
+ contentType
1652
+ );
1653
+ requestContext.setBody(serializedBody);
1654
+
1655
+ let authMethod: SecurityAuthentication | undefined;
1656
+ // Apply auth methods
1657
+ authMethod = _config.authMethods["app_key"]
1658
+ if (authMethod?.applySecurityAuthentication) {
1659
+ await authMethod?.applySecurityAuthentication(requestContext);
1660
+ }
1661
+
1662
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1663
+ if (defaultAuth?.applySecurityAuthentication) {
1664
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1665
+ }
1666
+
1667
+ return requestContext;
1668
+ }
1669
+
1670
+ /**
1671
+ * Updates the name or configuration settings of an existing OneSignal app
1672
+ * Update an app
1673
+ * @param appId An app id
1674
+ * @param app
1675
+ */
1676
+ public async updateApp(appId: string, app: App, _options?: Configuration): Promise<RequestContext> {
1677
+ let _config = _options || this.configuration;
1678
+
1679
+ // verify required parameter 'appId' is not null or undefined
1680
+ if (appId === null || appId === undefined) {
1681
+ throw new RequiredError("DefaultApi", "updateApp", "appId");
1682
+ }
1683
+
1684
+
1685
+ // verify required parameter 'app' is not null or undefined
1686
+ if (app === null || app === undefined) {
1687
+ throw new RequiredError("DefaultApi", "updateApp", "app");
1688
+ }
1689
+
1690
+
1691
+ // Path Params
1692
+ const localVarPath = '/apps/{app_id}'
1693
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)));
1694
+
1695
+ // Make Request Context
1696
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
1697
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1698
+
1699
+
1700
+ // Body Params
1701
+ const contentType = ObjectSerializer.getPreferredMediaType([
1702
+ "application/json"
1703
+ ]);
1704
+ requestContext.setHeaderParam("Content-Type", contentType);
1705
+ const serializedBody = ObjectSerializer.stringify(
1706
+ ObjectSerializer.serialize(app, "App", ""),
1707
+ contentType
1708
+ );
1709
+ requestContext.setBody(serializedBody);
1710
+
1711
+ let authMethod: SecurityAuthentication | undefined;
1712
+ // Apply auth methods
1713
+ authMethod = _config.authMethods["user_key"]
1714
+ if (authMethod?.applySecurityAuthentication) {
1715
+ await authMethod?.applySecurityAuthentication(requestContext);
1716
+ }
1717
+
1718
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1719
+ if (defaultAuth?.applySecurityAuthentication) {
1720
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1721
+ }
1722
+
1723
+ return requestContext;
1724
+ }
1725
+
1726
+ /**
1727
+ * Updates a specified live activity.
1728
+ * Update a Live Activity via Push
1729
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
1730
+ * @param activityId Live Activity record ID
1731
+ * @param updateLiveActivityRequest
1732
+ */
1733
+ public async updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise<RequestContext> {
1734
+ let _config = _options || this.configuration;
1735
+
1736
+ // verify required parameter 'appId' is not null or undefined
1737
+ if (appId === null || appId === undefined) {
1738
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "appId");
1739
+ }
1740
+
1741
+
1742
+ // verify required parameter 'activityId' is not null or undefined
1743
+ if (activityId === null || activityId === undefined) {
1744
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "activityId");
1745
+ }
1746
+
1747
+
1748
+ // verify required parameter 'updateLiveActivityRequest' is not null or undefined
1749
+ if (updateLiveActivityRequest === null || updateLiveActivityRequest === undefined) {
1750
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "updateLiveActivityRequest");
1751
+ }
1752
+
1753
+
1754
+ // Path Params
1755
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/notifications'
1756
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1757
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)));
1758
+
1759
+ // Make Request Context
1760
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
1761
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1762
+
1763
+
1764
+ // Body Params
1765
+ const contentType = ObjectSerializer.getPreferredMediaType([
1766
+ "application/json"
1767
+ ]);
1768
+ requestContext.setHeaderParam("Content-Type", contentType);
1769
+ const serializedBody = ObjectSerializer.stringify(
1770
+ ObjectSerializer.serialize(updateLiveActivityRequest, "UpdateLiveActivityRequest", ""),
1771
+ contentType
1772
+ );
1773
+ requestContext.setBody(serializedBody);
1774
+
1775
+ let authMethod: SecurityAuthentication | undefined;
1776
+ // Apply auth methods
1777
+ authMethod = _config.authMethods["app_key"]
1778
+ if (authMethod?.applySecurityAuthentication) {
1779
+ await authMethod?.applySecurityAuthentication(requestContext);
1780
+ }
1781
+
1782
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1783
+ if (defaultAuth?.applySecurityAuthentication) {
1784
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1785
+ }
1786
+
1787
+ return requestContext;
1788
+ }
1789
+
1790
+ /**
1791
+ * Update an existing device in one of your OneSignal apps
1792
+ * Edit device
1793
+ * @param playerId Player\&#39;s OneSignal ID
1794
+ * @param player
1795
+ */
1796
+ public async updatePlayer(playerId: string, player: Player, _options?: Configuration): Promise<RequestContext> {
1797
+ let _config = _options || this.configuration;
1798
+
1799
+ // verify required parameter 'playerId' is not null or undefined
1800
+ if (playerId === null || playerId === undefined) {
1801
+ throw new RequiredError("DefaultApi", "updatePlayer", "playerId");
1802
+ }
1803
+
1804
+
1805
+ // verify required parameter 'player' is not null or undefined
1806
+ if (player === null || player === undefined) {
1807
+ throw new RequiredError("DefaultApi", "updatePlayer", "player");
1808
+ }
1809
+
1810
+
1811
+ // Path Params
1812
+ const localVarPath = '/players/{player_id}'
1813
+ .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId)));
1814
+
1815
+ // Make Request Context
1816
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
1817
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1818
+
1819
+
1820
+ // Body Params
1821
+ const contentType = ObjectSerializer.getPreferredMediaType([
1822
+ "application/json"
1823
+ ]);
1824
+ requestContext.setHeaderParam("Content-Type", contentType);
1825
+ const serializedBody = ObjectSerializer.stringify(
1826
+ ObjectSerializer.serialize(player, "Player", ""),
1827
+ contentType
1828
+ );
1829
+ requestContext.setBody(serializedBody);
1830
+
1831
+ let authMethod: SecurityAuthentication | undefined;
1832
+ // Apply auth methods
1833
+ authMethod = _config.authMethods["app_key"]
1834
+ if (authMethod?.applySecurityAuthentication) {
1835
+ await authMethod?.applySecurityAuthentication(requestContext);
1836
+ }
1837
+
1838
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1839
+ if (defaultAuth?.applySecurityAuthentication) {
1840
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1841
+ }
1842
+
1843
+ return requestContext;
1844
+ }
1845
+
1846
+ /**
1847
+ * 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\" }
1848
+ * Edit tags with external user id
1849
+ * @param appId The OneSignal App ID the user record is found under.
1850
+ * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
1851
+ * @param updatePlayerTagsRequestBody
1852
+ */
1853
+ public async updatePlayerTags(appId: string, externalUserId: string, updatePlayerTagsRequestBody?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<RequestContext> {
1854
+ let _config = _options || this.configuration;
1855
+
1856
+ // verify required parameter 'appId' is not null or undefined
1857
+ if (appId === null || appId === undefined) {
1858
+ throw new RequiredError("DefaultApi", "updatePlayerTags", "appId");
1859
+ }
1860
+
1861
+
1862
+ // verify required parameter 'externalUserId' is not null or undefined
1863
+ if (externalUserId === null || externalUserId === undefined) {
1864
+ throw new RequiredError("DefaultApi", "updatePlayerTags", "externalUserId");
1865
+ }
1866
+
1867
+
1868
+
1869
+ // Path Params
1870
+ const localVarPath = '/apps/{app_id}/users/{external_user_id}'
1871
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1872
+ .replace('{' + 'external_user_id' + '}', encodeURIComponent(String(externalUserId)));
1873
+
1874
+ // Make Request Context
1875
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
1876
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1877
+
1878
+
1879
+ // Body Params
1880
+ const contentType = ObjectSerializer.getPreferredMediaType([
1881
+ "application/json"
1882
+ ]);
1883
+ requestContext.setHeaderParam("Content-Type", contentType);
1884
+ const serializedBody = ObjectSerializer.stringify(
1885
+ ObjectSerializer.serialize(updatePlayerTagsRequestBody, "UpdatePlayerTagsRequestBody", ""),
1886
+ contentType
1887
+ );
1888
+ requestContext.setBody(serializedBody);
1889
+
1890
+ let authMethod: SecurityAuthentication | undefined;
1891
+ // Apply auth methods
1892
+ authMethod = _config.authMethods["app_key"]
1893
+ if (authMethod?.applySecurityAuthentication) {
1894
+ await authMethod?.applySecurityAuthentication(requestContext);
1895
+ }
1896
+
1897
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1898
+ if (defaultAuth?.applySecurityAuthentication) {
1899
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1900
+ }
1901
+
1902
+ return requestContext;
1903
+ }
1904
+
1905
+ /**
1906
+ * Updates an existing Subscription’s properties.
1907
+ * @param appId
1908
+ * @param subscriptionId
1909
+ * @param updateSubscriptionRequestBody
1910
+ */
1911
+ public async updateSubscription(appId: string, subscriptionId: string, updateSubscriptionRequestBody: UpdateSubscriptionRequestBody, _options?: Configuration): Promise<RequestContext> {
1912
+ let _config = _options || this.configuration;
1913
+
1914
+ // verify required parameter 'appId' is not null or undefined
1915
+ if (appId === null || appId === undefined) {
1916
+ throw new RequiredError("DefaultApi", "updateSubscription", "appId");
1917
+ }
1918
+
1919
+
1920
+ // verify required parameter 'subscriptionId' is not null or undefined
1921
+ if (subscriptionId === null || subscriptionId === undefined) {
1922
+ throw new RequiredError("DefaultApi", "updateSubscription", "subscriptionId");
1923
+ }
1924
+
1925
+
1926
+ // verify required parameter 'updateSubscriptionRequestBody' is not null or undefined
1927
+ if (updateSubscriptionRequestBody === null || updateSubscriptionRequestBody === undefined) {
1928
+ throw new RequiredError("DefaultApi", "updateSubscription", "updateSubscriptionRequestBody");
1929
+ }
1930
+
1931
+
1932
+ // Path Params
1933
+ const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}'
1934
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1935
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
1936
+
1937
+ // Make Request Context
1938
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
1939
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1940
+
1941
+
1942
+ // Body Params
1943
+ const contentType = ObjectSerializer.getPreferredMediaType([
1944
+ "application/json"
1945
+ ]);
1946
+ requestContext.setHeaderParam("Content-Type", contentType);
1947
+ const serializedBody = ObjectSerializer.stringify(
1948
+ ObjectSerializer.serialize(updateSubscriptionRequestBody, "UpdateSubscriptionRequestBody", ""),
1949
+ contentType
1950
+ );
1951
+ requestContext.setBody(serializedBody);
1952
+
1953
+ let authMethod: SecurityAuthentication | undefined;
1954
+ // Apply auth methods
1955
+ authMethod = _config.authMethods["app_key"]
1956
+ if (authMethod?.applySecurityAuthentication) {
1957
+ await authMethod?.applySecurityAuthentication(requestContext);
1958
+ }
1959
+
1960
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1961
+ if (defaultAuth?.applySecurityAuthentication) {
1962
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1963
+ }
1964
+
1965
+ return requestContext;
1966
+ }
1967
+
1968
+ /**
1969
+ * Updates an existing User’s properties.
1970
+ * @param appId
1971
+ * @param aliasLabel
1972
+ * @param aliasId
1973
+ * @param updateUserRequest
1974
+ * @param subscriptionId
1975
+ */
1976
+ public async updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, subscriptionId?: string, _options?: Configuration): Promise<RequestContext> {
1977
+ let _config = _options || this.configuration;
1978
+
1979
+ // verify required parameter 'appId' is not null or undefined
1980
+ if (appId === null || appId === undefined) {
1981
+ throw new RequiredError("DefaultApi", "updateUser", "appId");
1982
+ }
1983
+
1984
+
1985
+ // verify required parameter 'aliasLabel' is not null or undefined
1986
+ if (aliasLabel === null || aliasLabel === undefined) {
1987
+ throw new RequiredError("DefaultApi", "updateUser", "aliasLabel");
1988
+ }
1989
+
1990
+
1991
+ // verify required parameter 'aliasId' is not null or undefined
1992
+ if (aliasId === null || aliasId === undefined) {
1993
+ throw new RequiredError("DefaultApi", "updateUser", "aliasId");
1994
+ }
1995
+
1996
+
1997
+ // verify required parameter 'updateUserRequest' is not null or undefined
1998
+ if (updateUserRequest === null || updateUserRequest === undefined) {
1999
+ throw new RequiredError("DefaultApi", "updateUser", "updateUserRequest");
2000
+ }
2001
+
2002
+
2003
+
2004
+ // Path Params
2005
+ const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
2006
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
2007
+ .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel)))
2008
+ .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId)));
2009
+
2010
+ // Make Request Context
2011
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
2012
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
2013
+
2014
+ // Header Params
2015
+ requestContext.setHeaderParam("subscription_id", ObjectSerializer.serialize(subscriptionId, "string", ""));
2016
+
2017
+
2018
+ // Body Params
2019
+ const contentType = ObjectSerializer.getPreferredMediaType([
2020
+ "application/json"
2021
+ ]);
2022
+ requestContext.setHeaderParam("Content-Type", contentType);
2023
+ const serializedBody = ObjectSerializer.stringify(
2024
+ ObjectSerializer.serialize(updateUserRequest, "UpdateUserRequest", ""),
2025
+ contentType
2026
+ );
2027
+ requestContext.setBody(serializedBody);
2028
+
2029
+ let authMethod: SecurityAuthentication | undefined;
2030
+ // Apply auth methods
2031
+ authMethod = _config.authMethods["app_key"]
2032
+ if (authMethod?.applySecurityAuthentication) {
2033
+ await authMethod?.applySecurityAuthentication(requestContext);
2034
+ }
2035
+
2036
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
2037
+ if (defaultAuth?.applySecurityAuthentication) {
2038
+ await defaultAuth?.applySecurityAuthentication(requestContext);
2039
+ }
2040
+
2041
+ return requestContext;
2042
+ }
2043
+
2044
+ }
2045
+
2046
+ export class DefaultApiResponseProcessor {
2047
+
2048
+ /**
2049
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2050
+ * to the expected objects
2051
+ *
2052
+ * @params response Response returned by the server for a request to beginLiveActivity
2053
+ * @throws ApiException if the response code was not in [200, 299]
2054
+ */
2055
+ public async beginLiveActivity(response: ResponseContext): Promise<void > {
2056
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2057
+ if (isCodeInRange("204", response.httpStatusCode)) {
2058
+ return;
2059
+ }
2060
+ if (isCodeInRange("400", response.httpStatusCode)) {
2061
+ const body: BadRequestError = ObjectSerializer.deserialize(
2062
+ ObjectSerializer.parse(await response.body.text(), contentType),
2063
+ "BadRequestError", ""
2064
+ ) as BadRequestError;
2065
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2066
+ }
2067
+
2068
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2069
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2070
+ const body: void = ObjectSerializer.deserialize(
2071
+ ObjectSerializer.parse(await response.body.text(), contentType),
2072
+ "void", ""
2073
+ ) as void;
2074
+ return body;
2075
+ }
2076
+
2077
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2078
+ }
1042
2079
 
1043
2080
  /**
1044
2081
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
@@ -1056,6 +2093,13 @@ export class DefaultApiResponseProcessor {
1056
2093
  ) as CancelNotificationSuccessResponse;
1057
2094
  return body;
1058
2095
  }
2096
+ if (isCodeInRange("400", response.httpStatusCode)) {
2097
+ const body: BadRequestError = ObjectSerializer.deserialize(
2098
+ ObjectSerializer.parse(await response.body.text(), contentType),
2099
+ "BadRequestError", ""
2100
+ ) as BadRequestError;
2101
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2102
+ }
1059
2103
 
1060
2104
  // Work around for missing responses in specification, e.g. for petstore.yaml
1061
2105
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1085,6 +2129,13 @@ export class DefaultApiResponseProcessor {
1085
2129
  ) as App;
1086
2130
  return body;
1087
2131
  }
2132
+ if (isCodeInRange("400", response.httpStatusCode)) {
2133
+ const body: BadRequestError = ObjectSerializer.deserialize(
2134
+ ObjectSerializer.parse(await response.body.text(), contentType),
2135
+ "BadRequestError", ""
2136
+ ) as BadRequestError;
2137
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2138
+ }
1088
2139
 
1089
2140
  // Work around for missing responses in specification, e.g. for petstore.yaml
1090
2141
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1115,11 +2166,11 @@ export class DefaultApiResponseProcessor {
1115
2166
  return body;
1116
2167
  }
1117
2168
  if (isCodeInRange("400", response.httpStatusCode)) {
1118
- const body: CreateNotificationBadRequestResponse = ObjectSerializer.deserialize(
2169
+ const body: BadRequestError = ObjectSerializer.deserialize(
1119
2170
  ObjectSerializer.parse(await response.body.text(), contentType),
1120
- "CreateNotificationBadRequestResponse", ""
1121
- ) as CreateNotificationBadRequestResponse;
1122
- throw new ApiException<CreateNotificationBadRequestResponse>(400, "Bad Request", body, response.headers);
2171
+ "BadRequestError", ""
2172
+ ) as BadRequestError;
2173
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1123
2174
  }
1124
2175
 
1125
2176
  // Work around for missing responses in specification, e.g. for petstore.yaml
@@ -1150,13 +2201,339 @@ export class DefaultApiResponseProcessor {
1150
2201
  ) as CreatePlayerSuccessResponse;
1151
2202
  return body;
1152
2203
  }
2204
+ if (isCodeInRange("400", response.httpStatusCode)) {
2205
+ const body: BadRequestError = ObjectSerializer.deserialize(
2206
+ ObjectSerializer.parse(await response.body.text(), contentType),
2207
+ "BadRequestError", ""
2208
+ ) as BadRequestError;
2209
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2210
+ }
2211
+
2212
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2213
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2214
+ const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
2215
+ ObjectSerializer.parse(await response.body.text(), contentType),
2216
+ "CreatePlayerSuccessResponse", ""
2217
+ ) as CreatePlayerSuccessResponse;
2218
+ return body;
2219
+ }
2220
+
2221
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2222
+ }
2223
+
2224
+ /**
2225
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2226
+ * to the expected objects
2227
+ *
2228
+ * @params response Response returned by the server for a request to createSegments
2229
+ * @throws ApiException if the response code was not in [200, 299]
2230
+ */
2231
+ public async createSegments(response: ResponseContext): Promise<CreateSegmentSuccessResponse > {
2232
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2233
+ if (isCodeInRange("201", response.httpStatusCode)) {
2234
+ const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
2235
+ ObjectSerializer.parse(await response.body.text(), contentType),
2236
+ "CreateSegmentSuccessResponse", ""
2237
+ ) as CreateSegmentSuccessResponse;
2238
+ return body;
2239
+ }
2240
+ if (isCodeInRange("400", response.httpStatusCode)) {
2241
+ const body: BadRequestError = ObjectSerializer.deserialize(
2242
+ ObjectSerializer.parse(await response.body.text(), contentType),
2243
+ "BadRequestError", ""
2244
+ ) as BadRequestError;
2245
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2246
+ }
2247
+ if (isCodeInRange("409", response.httpStatusCode)) {
2248
+ const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize(
2249
+ ObjectSerializer.parse(await response.body.text(), contentType),
2250
+ "CreateSegmentConflictResponse", ""
2251
+ ) as CreateSegmentConflictResponse;
2252
+ throw new ApiException<CreateSegmentConflictResponse>(409, "Conflict", body, response.headers);
2253
+ }
2254
+
2255
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2256
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2257
+ const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
2258
+ ObjectSerializer.parse(await response.body.text(), contentType),
2259
+ "CreateSegmentSuccessResponse", ""
2260
+ ) as CreateSegmentSuccessResponse;
2261
+ return body;
2262
+ }
2263
+
2264
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2265
+ }
2266
+
2267
+ /**
2268
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2269
+ * to the expected objects
2270
+ *
2271
+ * @params response Response returned by the server for a request to createSubscription
2272
+ * @throws ApiException if the response code was not in [200, 299]
2273
+ */
2274
+ public async createSubscription(response: ResponseContext): Promise<InlineResponse201 > {
2275
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2276
+ if (isCodeInRange("201", response.httpStatusCode)) {
2277
+ const body: InlineResponse201 = ObjectSerializer.deserialize(
2278
+ ObjectSerializer.parse(await response.body.text(), contentType),
2279
+ "InlineResponse201", ""
2280
+ ) as InlineResponse201;
2281
+ return body;
2282
+ }
2283
+ if (isCodeInRange("202", response.httpStatusCode)) {
2284
+ const body: InlineResponse201 = ObjectSerializer.deserialize(
2285
+ ObjectSerializer.parse(await response.body.text(), contentType),
2286
+ "InlineResponse201", ""
2287
+ ) as InlineResponse201;
2288
+ return body;
2289
+ }
2290
+
2291
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2292
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2293
+ const body: InlineResponse201 = ObjectSerializer.deserialize(
2294
+ ObjectSerializer.parse(await response.body.text(), contentType),
2295
+ "InlineResponse201", ""
2296
+ ) as InlineResponse201;
2297
+ return body;
2298
+ }
2299
+
2300
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2301
+ }
2302
+
2303
+ /**
2304
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2305
+ * to the expected objects
2306
+ *
2307
+ * @params response Response returned by the server for a request to createUser
2308
+ * @throws ApiException if the response code was not in [200, 299]
2309
+ */
2310
+ public async createUser(response: ResponseContext): Promise<User > {
2311
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2312
+ if (isCodeInRange("201", response.httpStatusCode)) {
2313
+ const body: User = ObjectSerializer.deserialize(
2314
+ ObjectSerializer.parse(await response.body.text(), contentType),
2315
+ "User", ""
2316
+ ) as User;
2317
+ return body;
2318
+ }
2319
+ if (isCodeInRange("202", response.httpStatusCode)) {
2320
+ const body: User = ObjectSerializer.deserialize(
2321
+ ObjectSerializer.parse(await response.body.text(), contentType),
2322
+ "User", ""
2323
+ ) as User;
2324
+ return body;
2325
+ }
2326
+ if (isCodeInRange("409", response.httpStatusCode)) {
2327
+ const body: CreateUserConflictResponse = ObjectSerializer.deserialize(
2328
+ ObjectSerializer.parse(await response.body.text(), contentType),
2329
+ "CreateUserConflictResponse", ""
2330
+ ) as CreateUserConflictResponse;
2331
+ throw new ApiException<CreateUserConflictResponse>(409, "Multiple User Identity Conflict", body, response.headers);
2332
+ }
2333
+
2334
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2335
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2336
+ const body: User = ObjectSerializer.deserialize(
2337
+ ObjectSerializer.parse(await response.body.text(), contentType),
2338
+ "User", ""
2339
+ ) as User;
2340
+ return body;
2341
+ }
2342
+
2343
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2344
+ }
2345
+
2346
+ /**
2347
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2348
+ * to the expected objects
2349
+ *
2350
+ * @params response Response returned by the server for a request to deleteAlias
2351
+ * @throws ApiException if the response code was not in [200, 299]
2352
+ */
2353
+ public async deleteAlias(response: ResponseContext): Promise<InlineResponse200 > {
2354
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2355
+ if (isCodeInRange("200", response.httpStatusCode)) {
2356
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
2357
+ ObjectSerializer.parse(await response.body.text(), contentType),
2358
+ "InlineResponse200", ""
2359
+ ) as InlineResponse200;
2360
+ return body;
2361
+ }
2362
+
2363
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2364
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2365
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
2366
+ ObjectSerializer.parse(await response.body.text(), contentType),
2367
+ "InlineResponse200", ""
2368
+ ) as InlineResponse200;
2369
+ return body;
2370
+ }
2371
+
2372
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2373
+ }
2374
+
2375
+ /**
2376
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2377
+ * to the expected objects
2378
+ *
2379
+ * @params response Response returned by the server for a request to deletePlayer
2380
+ * @throws ApiException if the response code was not in [200, 299]
2381
+ */
2382
+ public async deletePlayer(response: ResponseContext): Promise<DeletePlayerSuccessResponse > {
2383
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2384
+ if (isCodeInRange("200", response.httpStatusCode)) {
2385
+ const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
2386
+ ObjectSerializer.parse(await response.body.text(), contentType),
2387
+ "DeletePlayerSuccessResponse", ""
2388
+ ) as DeletePlayerSuccessResponse;
2389
+ return body;
2390
+ }
2391
+ if (isCodeInRange("400", response.httpStatusCode)) {
2392
+ const body: BadRequestError = ObjectSerializer.deserialize(
2393
+ ObjectSerializer.parse(await response.body.text(), contentType),
2394
+ "BadRequestError", ""
2395
+ ) as BadRequestError;
2396
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2397
+ }
2398
+ if (isCodeInRange("404", response.httpStatusCode)) {
2399
+ const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize(
2400
+ ObjectSerializer.parse(await response.body.text(), contentType),
2401
+ "DeletePlayerNotFoundResponse", ""
2402
+ ) as DeletePlayerNotFoundResponse;
2403
+ throw new ApiException<DeletePlayerNotFoundResponse>(404, "Not Found", body, response.headers);
2404
+ }
2405
+
2406
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2407
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2408
+ const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
2409
+ ObjectSerializer.parse(await response.body.text(), contentType),
2410
+ "DeletePlayerSuccessResponse", ""
2411
+ ) as DeletePlayerSuccessResponse;
2412
+ return body;
2413
+ }
2414
+
2415
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2416
+ }
2417
+
2418
+ /**
2419
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2420
+ * to the expected objects
2421
+ *
2422
+ * @params response Response returned by the server for a request to deleteSegments
2423
+ * @throws ApiException if the response code was not in [200, 299]
2424
+ */
2425
+ public async deleteSegments(response: ResponseContext): Promise<DeleteSegmentSuccessResponse > {
2426
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2427
+ if (isCodeInRange("200", response.httpStatusCode)) {
2428
+ const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
2429
+ ObjectSerializer.parse(await response.body.text(), contentType),
2430
+ "DeleteSegmentSuccessResponse", ""
2431
+ ) as DeleteSegmentSuccessResponse;
2432
+ return body;
2433
+ }
2434
+ if (isCodeInRange("400", response.httpStatusCode)) {
2435
+ const body: BadRequestError = ObjectSerializer.deserialize(
2436
+ ObjectSerializer.parse(await response.body.text(), contentType),
2437
+ "BadRequestError", ""
2438
+ ) as BadRequestError;
2439
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2440
+ }
2441
+ if (isCodeInRange("404", response.httpStatusCode)) {
2442
+ const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize(
2443
+ ObjectSerializer.parse(await response.body.text(), contentType),
2444
+ "DeleteSegmentNotFoundResponse", ""
2445
+ ) as DeleteSegmentNotFoundResponse;
2446
+ throw new ApiException<DeleteSegmentNotFoundResponse>(404, "Not Found", body, response.headers);
2447
+ }
2448
+
2449
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2450
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2451
+ const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
2452
+ ObjectSerializer.parse(await response.body.text(), contentType),
2453
+ "DeleteSegmentSuccessResponse", ""
2454
+ ) as DeleteSegmentSuccessResponse;
2455
+ return body;
2456
+ }
2457
+
2458
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2459
+ }
2460
+
2461
+ /**
2462
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2463
+ * to the expected objects
2464
+ *
2465
+ * @params response Response returned by the server for a request to deleteSubscription
2466
+ * @throws ApiException if the response code was not in [200, 299]
2467
+ */
2468
+ public async deleteSubscription(response: ResponseContext): Promise<void > {
2469
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2470
+ if (isCodeInRange("202", response.httpStatusCode)) {
2471
+ return;
2472
+ }
2473
+
2474
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2475
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2476
+ const body: void = ObjectSerializer.deserialize(
2477
+ ObjectSerializer.parse(await response.body.text(), contentType),
2478
+ "void", ""
2479
+ ) as void;
2480
+ return body;
2481
+ }
2482
+
2483
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2484
+ }
2485
+
2486
+ /**
2487
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2488
+ * to the expected objects
2489
+ *
2490
+ * @params response Response returned by the server for a request to deleteUser
2491
+ * @throws ApiException if the response code was not in [200, 299]
2492
+ */
2493
+ public async deleteUser(response: ResponseContext): Promise<void > {
2494
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2495
+ if (isCodeInRange("200", response.httpStatusCode)) {
2496
+ return;
2497
+ }
2498
+
2499
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2500
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2501
+ const body: void = ObjectSerializer.deserialize(
2502
+ ObjectSerializer.parse(await response.body.text(), contentType),
2503
+ "void", ""
2504
+ ) as void;
2505
+ return body;
2506
+ }
2507
+
2508
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2509
+ }
2510
+
2511
+ /**
2512
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2513
+ * to the expected objects
2514
+ *
2515
+ * @params response Response returned by the server for a request to endLiveActivity
2516
+ * @throws ApiException if the response code was not in [200, 299]
2517
+ */
2518
+ public async endLiveActivity(response: ResponseContext): Promise<void > {
2519
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2520
+ if (isCodeInRange("204", response.httpStatusCode)) {
2521
+ return;
2522
+ }
2523
+ if (isCodeInRange("400", response.httpStatusCode)) {
2524
+ const body: BadRequestError = ObjectSerializer.deserialize(
2525
+ ObjectSerializer.parse(await response.body.text(), contentType),
2526
+ "BadRequestError", ""
2527
+ ) as BadRequestError;
2528
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2529
+ }
1153
2530
 
1154
2531
  // Work around for missing responses in specification, e.g. for petstore.yaml
1155
2532
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1156
- const body: CreatePlayerSuccessResponse = ObjectSerializer.deserialize(
2533
+ const body: void = ObjectSerializer.deserialize(
1157
2534
  ObjectSerializer.parse(await response.body.text(), contentType),
1158
- "CreatePlayerSuccessResponse", ""
1159
- ) as CreatePlayerSuccessResponse;
2535
+ "void", ""
2536
+ ) as void;
1160
2537
  return body;
1161
2538
  }
1162
2539
 
@@ -1167,39 +2544,32 @@ export class DefaultApiResponseProcessor {
1167
2544
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1168
2545
  * to the expected objects
1169
2546
  *
1170
- * @params response Response returned by the server for a request to createSegments
2547
+ * @params response Response returned by the server for a request to exportPlayers
1171
2548
  * @throws ApiException if the response code was not in [200, 299]
1172
2549
  */
1173
- public async createSegments(response: ResponseContext): Promise<CreateSegmentSuccessResponse > {
2550
+ public async exportPlayers(response: ResponseContext): Promise<ExportPlayersSuccessResponse > {
1174
2551
  const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1175
- if (isCodeInRange("201", response.httpStatusCode)) {
1176
- const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
2552
+ if (isCodeInRange("200", response.httpStatusCode)) {
2553
+ const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
1177
2554
  ObjectSerializer.parse(await response.body.text(), contentType),
1178
- "CreateSegmentSuccessResponse", ""
1179
- ) as CreateSegmentSuccessResponse;
2555
+ "ExportPlayersSuccessResponse", ""
2556
+ ) as ExportPlayersSuccessResponse;
1180
2557
  return body;
1181
2558
  }
1182
2559
  if (isCodeInRange("400", response.httpStatusCode)) {
1183
- const body: CreateSegmentBadRequestResponse = ObjectSerializer.deserialize(
1184
- ObjectSerializer.parse(await response.body.text(), contentType),
1185
- "CreateSegmentBadRequestResponse", ""
1186
- ) as CreateSegmentBadRequestResponse;
1187
- throw new ApiException<CreateSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1188
- }
1189
- if (isCodeInRange("409", response.httpStatusCode)) {
1190
- const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize(
2560
+ const body: BadRequestError = ObjectSerializer.deserialize(
1191
2561
  ObjectSerializer.parse(await response.body.text(), contentType),
1192
- "CreateSegmentConflictResponse", ""
1193
- ) as CreateSegmentConflictResponse;
1194
- throw new ApiException<CreateSegmentConflictResponse>(409, "Conflict", body, response.headers);
2562
+ "BadRequestError", ""
2563
+ ) as BadRequestError;
2564
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1195
2565
  }
1196
2566
 
1197
2567
  // Work around for missing responses in specification, e.g. for petstore.yaml
1198
2568
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1199
- const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize(
2569
+ const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
1200
2570
  ObjectSerializer.parse(await response.body.text(), contentType),
1201
- "CreateSegmentSuccessResponse", ""
1202
- ) as CreateSegmentSuccessResponse;
2571
+ "ExportPlayersSuccessResponse", ""
2572
+ ) as ExportPlayersSuccessResponse;
1203
2573
  return body;
1204
2574
  }
1205
2575
 
@@ -1210,39 +2580,25 @@ export class DefaultApiResponseProcessor {
1210
2580
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1211
2581
  * to the expected objects
1212
2582
  *
1213
- * @params response Response returned by the server for a request to deletePlayer
2583
+ * @params response Response returned by the server for a request to fetchAliases
1214
2584
  * @throws ApiException if the response code was not in [200, 299]
1215
2585
  */
1216
- public async deletePlayer(response: ResponseContext): Promise<DeletePlayerSuccessResponse > {
2586
+ public async fetchAliases(response: ResponseContext): Promise<UserIdentityResponse > {
1217
2587
  const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1218
2588
  if (isCodeInRange("200", response.httpStatusCode)) {
1219
- const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
2589
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
1220
2590
  ObjectSerializer.parse(await response.body.text(), contentType),
1221
- "DeletePlayerSuccessResponse", ""
1222
- ) as DeletePlayerSuccessResponse;
2591
+ "UserIdentityResponse", ""
2592
+ ) as UserIdentityResponse;
1223
2593
  return body;
1224
2594
  }
1225
- if (isCodeInRange("400", response.httpStatusCode)) {
1226
- const body: DeletePlayerBadRequestResponse = ObjectSerializer.deserialize(
1227
- ObjectSerializer.parse(await response.body.text(), contentType),
1228
- "DeletePlayerBadRequestResponse", ""
1229
- ) as DeletePlayerBadRequestResponse;
1230
- throw new ApiException<DeletePlayerBadRequestResponse>(400, "Bad Request", body, response.headers);
1231
- }
1232
- if (isCodeInRange("404", response.httpStatusCode)) {
1233
- const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize(
1234
- ObjectSerializer.parse(await response.body.text(), contentType),
1235
- "DeletePlayerNotFoundResponse", ""
1236
- ) as DeletePlayerNotFoundResponse;
1237
- throw new ApiException<DeletePlayerNotFoundResponse>(404, "Not Found", body, response.headers);
1238
- }
1239
2595
 
1240
2596
  // Work around for missing responses in specification, e.g. for petstore.yaml
1241
2597
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1242
- const body: DeletePlayerSuccessResponse = ObjectSerializer.deserialize(
2598
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
1243
2599
  ObjectSerializer.parse(await response.body.text(), contentType),
1244
- "DeletePlayerSuccessResponse", ""
1245
- ) as DeletePlayerSuccessResponse;
2600
+ "UserIdentityResponse", ""
2601
+ ) as UserIdentityResponse;
1246
2602
  return body;
1247
2603
  }
1248
2604
 
@@ -1253,39 +2609,25 @@ export class DefaultApiResponseProcessor {
1253
2609
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1254
2610
  * to the expected objects
1255
2611
  *
1256
- * @params response Response returned by the server for a request to deleteSegments
2612
+ * @params response Response returned by the server for a request to fetchUser
1257
2613
  * @throws ApiException if the response code was not in [200, 299]
1258
2614
  */
1259
- public async deleteSegments(response: ResponseContext): Promise<DeleteSegmentSuccessResponse > {
2615
+ public async fetchUser(response: ResponseContext): Promise<User > {
1260
2616
  const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1261
2617
  if (isCodeInRange("200", response.httpStatusCode)) {
1262
- const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
2618
+ const body: User = ObjectSerializer.deserialize(
1263
2619
  ObjectSerializer.parse(await response.body.text(), contentType),
1264
- "DeleteSegmentSuccessResponse", ""
1265
- ) as DeleteSegmentSuccessResponse;
2620
+ "User", ""
2621
+ ) as User;
1266
2622
  return body;
1267
2623
  }
1268
- if (isCodeInRange("400", response.httpStatusCode)) {
1269
- const body: DeleteSegmentBadRequestResponse = ObjectSerializer.deserialize(
1270
- ObjectSerializer.parse(await response.body.text(), contentType),
1271
- "DeleteSegmentBadRequestResponse", ""
1272
- ) as DeleteSegmentBadRequestResponse;
1273
- throw new ApiException<DeleteSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1274
- }
1275
- if (isCodeInRange("404", response.httpStatusCode)) {
1276
- const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize(
1277
- ObjectSerializer.parse(await response.body.text(), contentType),
1278
- "DeleteSegmentNotFoundResponse", ""
1279
- ) as DeleteSegmentNotFoundResponse;
1280
- throw new ApiException<DeleteSegmentNotFoundResponse>(404, "Not Found", body, response.headers);
1281
- }
1282
2624
 
1283
2625
  // Work around for missing responses in specification, e.g. for petstore.yaml
1284
2626
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1285
- const body: DeleteSegmentSuccessResponse = ObjectSerializer.deserialize(
2627
+ const body: User = ObjectSerializer.deserialize(
1286
2628
  ObjectSerializer.parse(await response.body.text(), contentType),
1287
- "DeleteSegmentSuccessResponse", ""
1288
- ) as DeleteSegmentSuccessResponse;
2629
+ "User", ""
2630
+ ) as User;
1289
2631
  return body;
1290
2632
  }
1291
2633
 
@@ -1296,32 +2638,25 @@ export class DefaultApiResponseProcessor {
1296
2638
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1297
2639
  * to the expected objects
1298
2640
  *
1299
- * @params response Response returned by the server for a request to exportPlayers
2641
+ * @params response Response returned by the server for a request to fetchUserIdentity
1300
2642
  * @throws ApiException if the response code was not in [200, 299]
1301
2643
  */
1302
- public async exportPlayers(response: ResponseContext): Promise<ExportPlayersSuccessResponse > {
2644
+ public async fetchUserIdentity(response: ResponseContext): Promise<InlineResponse200 > {
1303
2645
  const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1304
2646
  if (isCodeInRange("200", response.httpStatusCode)) {
1305
- const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
2647
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
1306
2648
  ObjectSerializer.parse(await response.body.text(), contentType),
1307
- "ExportPlayersSuccessResponse", ""
1308
- ) as ExportPlayersSuccessResponse;
2649
+ "InlineResponse200", ""
2650
+ ) as InlineResponse200;
1309
2651
  return body;
1310
2652
  }
1311
- if (isCodeInRange("400", response.httpStatusCode)) {
1312
- const body: object = ObjectSerializer.deserialize(
1313
- ObjectSerializer.parse(await response.body.text(), contentType),
1314
- "object", ""
1315
- ) as object;
1316
- throw new ApiException<object>(400, "Bad Request", body, response.headers);
1317
- }
1318
2653
 
1319
2654
  // Work around for missing responses in specification, e.g. for petstore.yaml
1320
2655
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1321
- const body: ExportPlayersSuccessResponse = ObjectSerializer.deserialize(
2656
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
1322
2657
  ObjectSerializer.parse(await response.body.text(), contentType),
1323
- "ExportPlayersSuccessResponse", ""
1324
- ) as ExportPlayersSuccessResponse;
2658
+ "InlineResponse200", ""
2659
+ ) as InlineResponse200;
1325
2660
  return body;
1326
2661
  }
1327
2662
 
@@ -1344,6 +2679,13 @@ export class DefaultApiResponseProcessor {
1344
2679
  ) as App;
1345
2680
  return body;
1346
2681
  }
2682
+ if (isCodeInRange("400", response.httpStatusCode)) {
2683
+ const body: BadRequestError = ObjectSerializer.deserialize(
2684
+ ObjectSerializer.parse(await response.body.text(), contentType),
2685
+ "BadRequestError", ""
2686
+ ) as BadRequestError;
2687
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2688
+ }
1347
2689
 
1348
2690
  // Work around for missing responses in specification, e.g. for petstore.yaml
1349
2691
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1373,6 +2715,13 @@ export class DefaultApiResponseProcessor {
1373
2715
  ) as Array<App>;
1374
2716
  return body;
1375
2717
  }
2718
+ if (isCodeInRange("400", response.httpStatusCode)) {
2719
+ const body: BadRequestError = ObjectSerializer.deserialize(
2720
+ ObjectSerializer.parse(await response.body.text(), contentType),
2721
+ "BadRequestError", ""
2722
+ ) as BadRequestError;
2723
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2724
+ }
1376
2725
 
1377
2726
  // Work around for missing responses in specification, e.g. for petstore.yaml
1378
2727
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1386,6 +2735,35 @@ export class DefaultApiResponseProcessor {
1386
2735
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1387
2736
  }
1388
2737
 
2738
+ /**
2739
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2740
+ * to the expected objects
2741
+ *
2742
+ * @params response Response returned by the server for a request to getEligibleIams
2743
+ * @throws ApiException if the response code was not in [200, 299]
2744
+ */
2745
+ public async getEligibleIams(response: ResponseContext): Promise<InlineResponse2003 > {
2746
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2747
+ if (isCodeInRange("200", response.httpStatusCode)) {
2748
+ const body: InlineResponse2003 = ObjectSerializer.deserialize(
2749
+ ObjectSerializer.parse(await response.body.text(), contentType),
2750
+ "InlineResponse2003", ""
2751
+ ) as InlineResponse2003;
2752
+ return body;
2753
+ }
2754
+
2755
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2756
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2757
+ const body: InlineResponse2003 = ObjectSerializer.deserialize(
2758
+ ObjectSerializer.parse(await response.body.text(), contentType),
2759
+ "InlineResponse2003", ""
2760
+ ) as InlineResponse2003;
2761
+ return body;
2762
+ }
2763
+
2764
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
2765
+ }
2766
+
1389
2767
  /**
1390
2768
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1391
2769
  * to the expected objects
@@ -1402,6 +2780,13 @@ export class DefaultApiResponseProcessor {
1402
2780
  ) as NotificationWithMeta;
1403
2781
  return body;
1404
2782
  }
2783
+ if (isCodeInRange("400", response.httpStatusCode)) {
2784
+ const body: BadRequestError = ObjectSerializer.deserialize(
2785
+ ObjectSerializer.parse(await response.body.text(), contentType),
2786
+ "BadRequestError", ""
2787
+ ) as BadRequestError;
2788
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2789
+ }
1405
2790
 
1406
2791
  // Work around for missing responses in specification, e.g. for petstore.yaml
1407
2792
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1432,11 +2817,11 @@ export class DefaultApiResponseProcessor {
1432
2817
  return body;
1433
2818
  }
1434
2819
  if (isCodeInRange("400", response.httpStatusCode)) {
1435
- const body: NotificationHistoryBadRequestResponse = ObjectSerializer.deserialize(
2820
+ const body: BadRequestError = ObjectSerializer.deserialize(
1436
2821
  ObjectSerializer.parse(await response.body.text(), contentType),
1437
- "NotificationHistoryBadRequestResponse", ""
1438
- ) as NotificationHistoryBadRequestResponse;
1439
- throw new ApiException<NotificationHistoryBadRequestResponse>(400, "Bad Request", body, response.headers);
2822
+ "BadRequestError", ""
2823
+ ) as BadRequestError;
2824
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1440
2825
  }
1441
2826
 
1442
2827
  // Work around for missing responses in specification, e.g. for petstore.yaml
@@ -1467,6 +2852,13 @@ export class DefaultApiResponseProcessor {
1467
2852
  ) as NotificationSlice;
1468
2853
  return body;
1469
2854
  }
2855
+ if (isCodeInRange("400", response.httpStatusCode)) {
2856
+ const body: BadRequestError = ObjectSerializer.deserialize(
2857
+ ObjectSerializer.parse(await response.body.text(), contentType),
2858
+ "BadRequestError", ""
2859
+ ) as BadRequestError;
2860
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2861
+ }
1470
2862
 
1471
2863
  // Work around for missing responses in specification, e.g. for petstore.yaml
1472
2864
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1496,6 +2888,13 @@ export class DefaultApiResponseProcessor {
1496
2888
  ) as OutcomesData;
1497
2889
  return body;
1498
2890
  }
2891
+ if (isCodeInRange("400", response.httpStatusCode)) {
2892
+ const body: BadRequestError = ObjectSerializer.deserialize(
2893
+ ObjectSerializer.parse(await response.body.text(), contentType),
2894
+ "BadRequestError", ""
2895
+ ) as BadRequestError;
2896
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2897
+ }
1499
2898
 
1500
2899
  // Work around for missing responses in specification, e.g. for petstore.yaml
1501
2900
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1525,6 +2924,13 @@ export class DefaultApiResponseProcessor {
1525
2924
  ) as Player;
1526
2925
  return body;
1527
2926
  }
2927
+ if (isCodeInRange("400", response.httpStatusCode)) {
2928
+ const body: BadRequestError = ObjectSerializer.deserialize(
2929
+ ObjectSerializer.parse(await response.body.text(), contentType),
2930
+ "BadRequestError", ""
2931
+ ) as BadRequestError;
2932
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2933
+ }
1528
2934
 
1529
2935
  // Work around for missing responses in specification, e.g. for petstore.yaml
1530
2936
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1554,6 +2960,13 @@ export class DefaultApiResponseProcessor {
1554
2960
  ) as PlayerSlice;
1555
2961
  return body;
1556
2962
  }
2963
+ if (isCodeInRange("400", response.httpStatusCode)) {
2964
+ const body: BadRequestError = ObjectSerializer.deserialize(
2965
+ ObjectSerializer.parse(await response.body.text(), contentType),
2966
+ "BadRequestError", ""
2967
+ ) as BadRequestError;
2968
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2969
+ }
1557
2970
 
1558
2971
  // Work around for missing responses in specification, e.g. for petstore.yaml
1559
2972
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1567,6 +2980,107 @@ export class DefaultApiResponseProcessor {
1567
2980
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1568
2981
  }
1569
2982
 
2983
+ /**
2984
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2985
+ * to the expected objects
2986
+ *
2987
+ * @params response Response returned by the server for a request to identifyUserByAlias
2988
+ * @throws ApiException if the response code was not in [200, 299]
2989
+ */
2990
+ public async identifyUserByAlias(response: ResponseContext): Promise<InlineResponse200 > {
2991
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2992
+ if (isCodeInRange("200", response.httpStatusCode)) {
2993
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
2994
+ ObjectSerializer.parse(await response.body.text(), contentType),
2995
+ "InlineResponse200", ""
2996
+ ) as InlineResponse200;
2997
+ return body;
2998
+ }
2999
+ if (isCodeInRange("409", response.httpStatusCode)) {
3000
+ const body: IdentifyUserConflictResponse = ObjectSerializer.deserialize(
3001
+ ObjectSerializer.parse(await response.body.text(), contentType),
3002
+ "IdentifyUserConflictResponse", ""
3003
+ ) as IdentifyUserConflictResponse;
3004
+ throw new ApiException<IdentifyUserConflictResponse>(409, "Conflict", body, response.headers);
3005
+ }
3006
+
3007
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3008
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3009
+ const body: InlineResponse200 = ObjectSerializer.deserialize(
3010
+ ObjectSerializer.parse(await response.body.text(), contentType),
3011
+ "InlineResponse200", ""
3012
+ ) as InlineResponse200;
3013
+ return body;
3014
+ }
3015
+
3016
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3017
+ }
3018
+
3019
+ /**
3020
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
3021
+ * to the expected objects
3022
+ *
3023
+ * @params response Response returned by the server for a request to identifyUserBySubscriptionId
3024
+ * @throws ApiException if the response code was not in [200, 299]
3025
+ */
3026
+ public async identifyUserBySubscriptionId(response: ResponseContext): Promise<UserIdentityResponse > {
3027
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3028
+ if (isCodeInRange("200", response.httpStatusCode)) {
3029
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
3030
+ ObjectSerializer.parse(await response.body.text(), contentType),
3031
+ "UserIdentityResponse", ""
3032
+ ) as UserIdentityResponse;
3033
+ return body;
3034
+ }
3035
+ if (isCodeInRange("409", response.httpStatusCode)) {
3036
+ const body: IdentifyUserConflictResponse = ObjectSerializer.deserialize(
3037
+ ObjectSerializer.parse(await response.body.text(), contentType),
3038
+ "IdentifyUserConflictResponse", ""
3039
+ ) as IdentifyUserConflictResponse;
3040
+ throw new ApiException<IdentifyUserConflictResponse>(409, "Conflict", body, response.headers);
3041
+ }
3042
+
3043
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3044
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3045
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
3046
+ ObjectSerializer.parse(await response.body.text(), contentType),
3047
+ "UserIdentityResponse", ""
3048
+ ) as UserIdentityResponse;
3049
+ return body;
3050
+ }
3051
+
3052
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3053
+ }
3054
+
3055
+ /**
3056
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
3057
+ * to the expected objects
3058
+ *
3059
+ * @params response Response returned by the server for a request to transferSubscription
3060
+ * @throws ApiException if the response code was not in [200, 299]
3061
+ */
3062
+ public async transferSubscription(response: ResponseContext): Promise<UserIdentityResponse > {
3063
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3064
+ if (isCodeInRange("200", response.httpStatusCode)) {
3065
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
3066
+ ObjectSerializer.parse(await response.body.text(), contentType),
3067
+ "UserIdentityResponse", ""
3068
+ ) as UserIdentityResponse;
3069
+ return body;
3070
+ }
3071
+
3072
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3073
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3074
+ const body: UserIdentityResponse = ObjectSerializer.deserialize(
3075
+ ObjectSerializer.parse(await response.body.text(), contentType),
3076
+ "UserIdentityResponse", ""
3077
+ ) as UserIdentityResponse;
3078
+ return body;
3079
+ }
3080
+
3081
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3082
+ }
3083
+
1570
3084
  /**
1571
3085
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1572
3086
  * to the expected objects
@@ -1583,6 +3097,13 @@ export class DefaultApiResponseProcessor {
1583
3097
  ) as App;
1584
3098
  return body;
1585
3099
  }
3100
+ if (isCodeInRange("400", response.httpStatusCode)) {
3101
+ const body: BadRequestError = ObjectSerializer.deserialize(
3102
+ ObjectSerializer.parse(await response.body.text(), contentType),
3103
+ "BadRequestError", ""
3104
+ ) as BadRequestError;
3105
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
3106
+ }
1586
3107
 
1587
3108
  // Work around for missing responses in specification, e.g. for petstore.yaml
1588
3109
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1596,6 +3117,42 @@ export class DefaultApiResponseProcessor {
1596
3117
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1597
3118
  }
1598
3119
 
3120
+ /**
3121
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
3122
+ * to the expected objects
3123
+ *
3124
+ * @params response Response returned by the server for a request to updateLiveActivity
3125
+ * @throws ApiException if the response code was not in [200, 299]
3126
+ */
3127
+ public async updateLiveActivity(response: ResponseContext): Promise<UpdateLiveActivitySuccessResponse > {
3128
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3129
+ if (isCodeInRange("200", response.httpStatusCode)) {
3130
+ const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize(
3131
+ ObjectSerializer.parse(await response.body.text(), contentType),
3132
+ "UpdateLiveActivitySuccessResponse", ""
3133
+ ) as UpdateLiveActivitySuccessResponse;
3134
+ return body;
3135
+ }
3136
+ if (isCodeInRange("400", response.httpStatusCode)) {
3137
+ const body: BadRequestError = ObjectSerializer.deserialize(
3138
+ ObjectSerializer.parse(await response.body.text(), contentType),
3139
+ "BadRequestError", ""
3140
+ ) as BadRequestError;
3141
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
3142
+ }
3143
+
3144
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3145
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3146
+ const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize(
3147
+ ObjectSerializer.parse(await response.body.text(), contentType),
3148
+ "UpdateLiveActivitySuccessResponse", ""
3149
+ ) as UpdateLiveActivitySuccessResponse;
3150
+ return body;
3151
+ }
3152
+
3153
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3154
+ }
3155
+
1599
3156
  /**
1600
3157
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1601
3158
  * to the expected objects
@@ -1612,6 +3169,13 @@ export class DefaultApiResponseProcessor {
1612
3169
  ) as UpdatePlayerSuccessResponse;
1613
3170
  return body;
1614
3171
  }
3172
+ if (isCodeInRange("400", response.httpStatusCode)) {
3173
+ const body: BadRequestError = ObjectSerializer.deserialize(
3174
+ ObjectSerializer.parse(await response.body.text(), contentType),
3175
+ "BadRequestError", ""
3176
+ ) as BadRequestError;
3177
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
3178
+ }
1615
3179
 
1616
3180
  // Work around for missing responses in specification, e.g. for petstore.yaml
1617
3181
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1654,4 +3218,58 @@ export class DefaultApiResponseProcessor {
1654
3218
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1655
3219
  }
1656
3220
 
3221
+ /**
3222
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
3223
+ * to the expected objects
3224
+ *
3225
+ * @params response Response returned by the server for a request to updateSubscription
3226
+ * @throws ApiException if the response code was not in [200, 299]
3227
+ */
3228
+ public async updateSubscription(response: ResponseContext): Promise<void > {
3229
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3230
+ if (isCodeInRange("202", response.httpStatusCode)) {
3231
+ return;
3232
+ }
3233
+
3234
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3235
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3236
+ const body: void = ObjectSerializer.deserialize(
3237
+ ObjectSerializer.parse(await response.body.text(), contentType),
3238
+ "void", ""
3239
+ ) as void;
3240
+ return body;
3241
+ }
3242
+
3243
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3244
+ }
3245
+
3246
+ /**
3247
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
3248
+ * to the expected objects
3249
+ *
3250
+ * @params response Response returned by the server for a request to updateUser
3251
+ * @throws ApiException if the response code was not in [200, 299]
3252
+ */
3253
+ public async updateUser(response: ResponseContext): Promise<InlineResponse202 > {
3254
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3255
+ if (isCodeInRange("202", response.httpStatusCode)) {
3256
+ const body: InlineResponse202 = ObjectSerializer.deserialize(
3257
+ ObjectSerializer.parse(await response.body.text(), contentType),
3258
+ "InlineResponse202", ""
3259
+ ) as InlineResponse202;
3260
+ return body;
3261
+ }
3262
+
3263
+ // Work around for missing responses in specification, e.g. for petstore.yaml
3264
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3265
+ const body: InlineResponse202 = ObjectSerializer.deserialize(
3266
+ ObjectSerializer.parse(await response.body.text(), contentType),
3267
+ "InlineResponse202", ""
3268
+ ) as InlineResponse202;
3269
+ return body;
3270
+ }
3271
+
3272
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
3273
+ }
3274
+
1657
3275
  }