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

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 (106) hide show
  1. package/.github/workflows/npm_deploy.yml +6 -7
  2. package/CHANGELOG.md +4 -0
  3. package/DefaultApi.md +215 -0
  4. package/README.md +41 -0
  5. package/apis/DefaultApi.ts +401 -29
  6. package/dist/apis/DefaultApi.d.ts +9 -0
  7. package/dist/apis/DefaultApi.js +496 -132
  8. package/dist/apis/DefaultApi.js.map +1 -1
  9. package/dist/auth/auth.d.ts +6 -6
  10. package/dist/auth/auth.js +1 -1
  11. package/dist/http/http.d.ts +2 -2
  12. package/dist/http/http.js +1 -1
  13. package/dist/models/App.d.ts +5 -1
  14. package/dist/models/App.js +24 -0
  15. package/dist/models/App.js.map +1 -1
  16. package/dist/models/BadRequestError.d.ts +17 -0
  17. package/dist/models/BadRequestError.js +22 -0
  18. package/dist/models/BadRequestError.js.map +1 -0
  19. package/dist/models/BasicNotification.d.ts +1 -1
  20. package/dist/models/BasicNotificationAllOf.d.ts +1 -1
  21. package/dist/models/BeginLiveActivityRequest.d.ts +18 -0
  22. package/dist/models/BeginLiveActivityRequest.js +28 -0
  23. package/dist/models/BeginLiveActivityRequest.js.map +1 -0
  24. package/dist/models/Filter.d.ts +1 -1
  25. package/dist/models/FilterExpressions.d.ts +2 -2
  26. package/dist/models/GetNotificationRequestBody.d.ts +1 -1
  27. package/dist/models/Notification.d.ts +1 -1
  28. package/dist/models/NotificationWithMeta.d.ts +1 -1
  29. package/dist/models/ObjectSerializer.d.ts +4 -5
  30. package/dist/models/ObjectSerializer.js +14 -15
  31. package/dist/models/ObjectSerializer.js.map +1 -1
  32. package/dist/models/Operator.d.ts +1 -1
  33. package/dist/models/OutcomeData.d.ts +1 -1
  34. package/dist/models/UpdateLiveActivityRequest.d.ts +22 -0
  35. package/dist/models/UpdateLiveActivityRequest.js +40 -0
  36. package/dist/models/UpdateLiveActivityRequest.js.map +1 -0
  37. package/dist/models/UpdateLiveActivitySuccessResponse.d.ts +19 -0
  38. package/dist/models/UpdateLiveActivitySuccessResponse.js +28 -0
  39. package/dist/models/UpdateLiveActivitySuccessResponse.js.map +1 -0
  40. package/dist/models/all.d.ts +4 -5
  41. package/dist/models/all.js +4 -5
  42. package/dist/models/all.js.map +1 -1
  43. package/dist/types/ObjectParamAPI.d.ts +21 -0
  44. package/dist/types/ObjectParamAPI.js +9 -0
  45. package/dist/types/ObjectParamAPI.js.map +1 -1
  46. package/dist/types/ObservableAPI.d.ts +6 -0
  47. package/dist/types/ObservableAPI.js +128 -56
  48. package/dist/types/ObservableAPI.js.map +1 -1
  49. package/dist/types/PromiseAPI.d.ts +6 -0
  50. package/dist/types/PromiseAPI.js +12 -0
  51. package/dist/types/PromiseAPI.js.map +1 -1
  52. package/models/App.ts +41 -1
  53. package/models/BadRequestError.ts +31 -0
  54. package/models/BasicNotification.ts +1 -1
  55. package/models/BasicNotificationAllOf.ts +1 -1
  56. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
  57. package/models/BeginLiveActivityRequest.ts +38 -0
  58. package/models/Button.ts +1 -1
  59. package/models/CancelNotificationSuccessResponse.ts +1 -1
  60. package/models/CreateNotificationSuccessResponse.ts +1 -1
  61. package/models/CreatePlayerSuccessResponse.ts +1 -1
  62. package/models/CreateSegmentConflictResponse.ts +1 -1
  63. package/models/CreateSegmentSuccessResponse.ts +1 -1
  64. package/models/DeletePlayerNotFoundResponse.ts +1 -1
  65. package/models/DeletePlayerSuccessResponse.ts +1 -1
  66. package/models/DeleteSegmentNotFoundResponse.ts +1 -1
  67. package/models/DeleteSegmentSuccessResponse.ts +1 -1
  68. package/models/DeliveryData.ts +1 -1
  69. package/models/ExportPlayersRequestBody.ts +1 -1
  70. package/models/ExportPlayersSuccessResponse.ts +1 -1
  71. package/models/Filter.ts +1 -1
  72. package/models/FilterExpressions.ts +1 -1
  73. package/models/GetNotificationRequestBody.ts +1 -1
  74. package/models/InvalidIdentifierError.ts +1 -1
  75. package/models/Notification.ts +1 -1
  76. package/models/Notification200Errors.ts +1 -1
  77. package/models/NotificationAllOf.ts +1 -1
  78. package/models/NotificationHistorySuccessResponse.ts +1 -1
  79. package/models/NotificationSlice.ts +1 -1
  80. package/models/NotificationTarget.ts +1 -1
  81. package/models/NotificationWithMeta.ts +1 -1
  82. package/models/NotificationWithMetaAllOf.ts +1 -1
  83. package/models/ObjectSerializer.ts +15 -16
  84. package/models/Operator.ts +1 -1
  85. package/models/OutcomeData.ts +1 -1
  86. package/models/OutcomesData.ts +1 -1
  87. package/models/PlatformDeliveryData.ts +1 -1
  88. package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
  89. package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
  90. package/models/Player.ts +1 -1
  91. package/models/PlayerNotificationTarget.ts +1 -1
  92. package/models/PlayerSlice.ts +1 -1
  93. package/models/Purchase.ts +1 -1
  94. package/models/Segment.ts +1 -1
  95. package/models/SegmentNotificationTarget.ts +1 -1
  96. package/models/StringMap.ts +1 -1
  97. package/models/UpdateLiveActivityRequest.ts +62 -0
  98. package/models/UpdateLiveActivitySuccessResponse.ts +39 -0
  99. package/models/UpdatePlayerSuccessResponse.ts +1 -1
  100. package/models/UpdatePlayerTagsRequestBody.ts +1 -1
  101. package/models/UpdatePlayerTagsSuccessResponse.ts +1 -1
  102. package/models/all.ts +4 -5
  103. package/package.json +3 -3
  104. package/types/ObjectParamAPI.ts +94 -5
  105. package/types/ObservableAPI.ts +82 -5
  106. package/types/PromiseAPI.ts +40 -5
@@ -11,24 +11,21 @@ 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';
22
21
  import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse';
23
22
  import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse';
24
- import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse';
25
23
  import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse';
26
24
  import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse';
27
25
  import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody';
28
26
  import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse';
29
27
  import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody';
30
28
  import { Notification } from '../models/Notification';
31
- import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse';
32
29
  import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
33
30
  import { NotificationSlice } from '../models/NotificationSlice';
34
31
  import { NotificationWithMeta } from '../models/NotificationWithMeta';
@@ -36,6 +33,8 @@ import { OutcomesData } from '../models/OutcomesData';
36
33
  import { Player } from '../models/Player';
37
34
  import { PlayerSlice } from '../models/PlayerSlice';
38
35
  import { Segment } from '../models/Segment';
36
+ import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest';
37
+ import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse';
39
38
  import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse';
40
39
  import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody';
41
40
  import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse';
@@ -45,6 +44,70 @@ import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSucce
45
44
  */
46
45
  export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
47
46
 
47
+ /**
48
+ * Starts a Live Activity
49
+ * Start Live Activity
50
+ * @param appId The OneSignal App ID for your app. Available in Keys & IDs.
51
+ * @param activityId Live Activity record ID
52
+ * @param beginLiveActivityRequest
53
+ */
54
+ public async beginLiveActivity(appId: string, activityId: string, beginLiveActivityRequest: BeginLiveActivityRequest, _options?: Configuration): Promise<RequestContext> {
55
+ let _config = _options || this.configuration;
56
+
57
+ // verify required parameter 'appId' is not null or undefined
58
+ if (appId === null || appId === undefined) {
59
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "appId");
60
+ }
61
+
62
+
63
+ // verify required parameter 'activityId' is not null or undefined
64
+ if (activityId === null || activityId === undefined) {
65
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "activityId");
66
+ }
67
+
68
+
69
+ // verify required parameter 'beginLiveActivityRequest' is not null or undefined
70
+ if (beginLiveActivityRequest === null || beginLiveActivityRequest === undefined) {
71
+ throw new RequiredError("DefaultApi", "beginLiveActivity", "beginLiveActivityRequest");
72
+ }
73
+
74
+
75
+ // Path Params
76
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token'
77
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
78
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)));
79
+
80
+ // Make Request Context
81
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
82
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
83
+
84
+
85
+ // Body Params
86
+ const contentType = ObjectSerializer.getPreferredMediaType([
87
+ "application/json"
88
+ ]);
89
+ requestContext.setHeaderParam("Content-Type", contentType);
90
+ const serializedBody = ObjectSerializer.stringify(
91
+ ObjectSerializer.serialize(beginLiveActivityRequest, "BeginLiveActivityRequest", ""),
92
+ contentType
93
+ );
94
+ requestContext.setBody(serializedBody);
95
+
96
+ let authMethod: SecurityAuthentication | undefined;
97
+ // Apply auth methods
98
+ authMethod = _config.authMethods["app_key"]
99
+ if (authMethod?.applySecurityAuthentication) {
100
+ await authMethod?.applySecurityAuthentication(requestContext);
101
+ }
102
+
103
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
104
+ if (defaultAuth?.applySecurityAuthentication) {
105
+ await defaultAuth?.applySecurityAuthentication(requestContext);
106
+ }
107
+
108
+ return requestContext;
109
+ }
110
+
48
111
  /**
49
112
  * Used to stop a scheduled or currently outgoing notification
50
113
  * Stop a scheduled or currently outgoing notification
@@ -386,6 +449,60 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
386
449
  return requestContext;
387
450
  }
388
451
 
452
+ /**
453
+ * Stops a Live Activity
454
+ * Stop Live Activity
455
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
456
+ * @param activityId Live Activity record ID
457
+ * @param subscriptionId Subscription ID
458
+ */
459
+ public async endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Promise<RequestContext> {
460
+ let _config = _options || this.configuration;
461
+
462
+ // verify required parameter 'appId' is not null or undefined
463
+ if (appId === null || appId === undefined) {
464
+ throw new RequiredError("DefaultApi", "endLiveActivity", "appId");
465
+ }
466
+
467
+
468
+ // verify required parameter 'activityId' is not null or undefined
469
+ if (activityId === null || activityId === undefined) {
470
+ throw new RequiredError("DefaultApi", "endLiveActivity", "activityId");
471
+ }
472
+
473
+
474
+ // verify required parameter 'subscriptionId' is not null or undefined
475
+ if (subscriptionId === null || subscriptionId === undefined) {
476
+ throw new RequiredError("DefaultApi", "endLiveActivity", "subscriptionId");
477
+ }
478
+
479
+
480
+ // Path Params
481
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'
482
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
483
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)))
484
+ .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId)));
485
+
486
+ // Make Request Context
487
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
488
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
489
+
490
+
491
+ let authMethod: SecurityAuthentication | undefined;
492
+ // Apply auth methods
493
+ authMethod = _config.authMethods["app_key"]
494
+ if (authMethod?.applySecurityAuthentication) {
495
+ await authMethod?.applySecurityAuthentication(requestContext);
496
+ }
497
+
498
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
499
+ if (defaultAuth?.applySecurityAuthentication) {
500
+ await defaultAuth?.applySecurityAuthentication(requestContext);
501
+ }
502
+
503
+ return requestContext;
504
+ }
505
+
389
506
  /**
390
507
  * 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
508
  * CSV export
@@ -921,6 +1038,70 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
921
1038
  return requestContext;
922
1039
  }
923
1040
 
1041
+ /**
1042
+ * Updates a specified live activity.
1043
+ * Update a Live Activity via Push
1044
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
1045
+ * @param activityId Live Activity record ID
1046
+ * @param updateLiveActivityRequest
1047
+ */
1048
+ public async updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise<RequestContext> {
1049
+ let _config = _options || this.configuration;
1050
+
1051
+ // verify required parameter 'appId' is not null or undefined
1052
+ if (appId === null || appId === undefined) {
1053
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "appId");
1054
+ }
1055
+
1056
+
1057
+ // verify required parameter 'activityId' is not null or undefined
1058
+ if (activityId === null || activityId === undefined) {
1059
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "activityId");
1060
+ }
1061
+
1062
+
1063
+ // verify required parameter 'updateLiveActivityRequest' is not null or undefined
1064
+ if (updateLiveActivityRequest === null || updateLiveActivityRequest === undefined) {
1065
+ throw new RequiredError("DefaultApi", "updateLiveActivity", "updateLiveActivityRequest");
1066
+ }
1067
+
1068
+
1069
+ // Path Params
1070
+ const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/notifications'
1071
+ .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
1072
+ .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId)));
1073
+
1074
+ // Make Request Context
1075
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
1076
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
1077
+
1078
+
1079
+ // Body Params
1080
+ const contentType = ObjectSerializer.getPreferredMediaType([
1081
+ "application/json"
1082
+ ]);
1083
+ requestContext.setHeaderParam("Content-Type", contentType);
1084
+ const serializedBody = ObjectSerializer.stringify(
1085
+ ObjectSerializer.serialize(updateLiveActivityRequest, "UpdateLiveActivityRequest", ""),
1086
+ contentType
1087
+ );
1088
+ requestContext.setBody(serializedBody);
1089
+
1090
+ let authMethod: SecurityAuthentication | undefined;
1091
+ // Apply auth methods
1092
+ authMethod = _config.authMethods["app_key"]
1093
+ if (authMethod?.applySecurityAuthentication) {
1094
+ await authMethod?.applySecurityAuthentication(requestContext);
1095
+ }
1096
+
1097
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
1098
+ if (defaultAuth?.applySecurityAuthentication) {
1099
+ await defaultAuth?.applySecurityAuthentication(requestContext);
1100
+ }
1101
+
1102
+ return requestContext;
1103
+ }
1104
+
924
1105
  /**
925
1106
  * Update an existing device in one of your OneSignal apps
926
1107
  * Edit device
@@ -1040,6 +1221,38 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
1040
1221
 
1041
1222
  export class DefaultApiResponseProcessor {
1042
1223
 
1224
+ /**
1225
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
1226
+ * to the expected objects
1227
+ *
1228
+ * @params response Response returned by the server for a request to beginLiveActivity
1229
+ * @throws ApiException if the response code was not in [200, 299]
1230
+ */
1231
+ public async beginLiveActivity(response: ResponseContext): Promise<void > {
1232
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1233
+ if (isCodeInRange("204", response.httpStatusCode)) {
1234
+ return;
1235
+ }
1236
+ if (isCodeInRange("400", response.httpStatusCode)) {
1237
+ const body: BadRequestError = ObjectSerializer.deserialize(
1238
+ ObjectSerializer.parse(await response.body.text(), contentType),
1239
+ "BadRequestError", ""
1240
+ ) as BadRequestError;
1241
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1242
+ }
1243
+
1244
+ // Work around for missing responses in specification, e.g. for petstore.yaml
1245
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1246
+ const body: void = ObjectSerializer.deserialize(
1247
+ ObjectSerializer.parse(await response.body.text(), contentType),
1248
+ "void", ""
1249
+ ) as void;
1250
+ return body;
1251
+ }
1252
+
1253
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1254
+ }
1255
+
1043
1256
  /**
1044
1257
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1045
1258
  * to the expected objects
@@ -1056,6 +1269,13 @@ export class DefaultApiResponseProcessor {
1056
1269
  ) as CancelNotificationSuccessResponse;
1057
1270
  return body;
1058
1271
  }
1272
+ if (isCodeInRange("400", response.httpStatusCode)) {
1273
+ const body: BadRequestError = ObjectSerializer.deserialize(
1274
+ ObjectSerializer.parse(await response.body.text(), contentType),
1275
+ "BadRequestError", ""
1276
+ ) as BadRequestError;
1277
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1278
+ }
1059
1279
 
1060
1280
  // Work around for missing responses in specification, e.g. for petstore.yaml
1061
1281
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1085,6 +1305,13 @@ export class DefaultApiResponseProcessor {
1085
1305
  ) as App;
1086
1306
  return body;
1087
1307
  }
1308
+ if (isCodeInRange("400", response.httpStatusCode)) {
1309
+ const body: BadRequestError = ObjectSerializer.deserialize(
1310
+ ObjectSerializer.parse(await response.body.text(), contentType),
1311
+ "BadRequestError", ""
1312
+ ) as BadRequestError;
1313
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1314
+ }
1088
1315
 
1089
1316
  // Work around for missing responses in specification, e.g. for petstore.yaml
1090
1317
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1115,11 +1342,11 @@ export class DefaultApiResponseProcessor {
1115
1342
  return body;
1116
1343
  }
1117
1344
  if (isCodeInRange("400", response.httpStatusCode)) {
1118
- const body: CreateNotificationBadRequestResponse = ObjectSerializer.deserialize(
1345
+ const body: BadRequestError = ObjectSerializer.deserialize(
1119
1346
  ObjectSerializer.parse(await response.body.text(), contentType),
1120
- "CreateNotificationBadRequestResponse", ""
1121
- ) as CreateNotificationBadRequestResponse;
1122
- throw new ApiException<CreateNotificationBadRequestResponse>(400, "Bad Request", body, response.headers);
1347
+ "BadRequestError", ""
1348
+ ) as BadRequestError;
1349
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1123
1350
  }
1124
1351
 
1125
1352
  // Work around for missing responses in specification, e.g. for petstore.yaml
@@ -1150,6 +1377,13 @@ export class DefaultApiResponseProcessor {
1150
1377
  ) as CreatePlayerSuccessResponse;
1151
1378
  return body;
1152
1379
  }
1380
+ if (isCodeInRange("400", response.httpStatusCode)) {
1381
+ const body: BadRequestError = ObjectSerializer.deserialize(
1382
+ ObjectSerializer.parse(await response.body.text(), contentType),
1383
+ "BadRequestError", ""
1384
+ ) as BadRequestError;
1385
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1386
+ }
1153
1387
 
1154
1388
  // Work around for missing responses in specification, e.g. for petstore.yaml
1155
1389
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1180,11 +1414,11 @@ export class DefaultApiResponseProcessor {
1180
1414
  return body;
1181
1415
  }
1182
1416
  if (isCodeInRange("400", response.httpStatusCode)) {
1183
- const body: CreateSegmentBadRequestResponse = ObjectSerializer.deserialize(
1417
+ const body: BadRequestError = ObjectSerializer.deserialize(
1184
1418
  ObjectSerializer.parse(await response.body.text(), contentType),
1185
- "CreateSegmentBadRequestResponse", ""
1186
- ) as CreateSegmentBadRequestResponse;
1187
- throw new ApiException<CreateSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1419
+ "BadRequestError", ""
1420
+ ) as BadRequestError;
1421
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1188
1422
  }
1189
1423
  if (isCodeInRange("409", response.httpStatusCode)) {
1190
1424
  const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize(
@@ -1223,11 +1457,11 @@ export class DefaultApiResponseProcessor {
1223
1457
  return body;
1224
1458
  }
1225
1459
  if (isCodeInRange("400", response.httpStatusCode)) {
1226
- const body: DeletePlayerBadRequestResponse = ObjectSerializer.deserialize(
1460
+ const body: BadRequestError = ObjectSerializer.deserialize(
1227
1461
  ObjectSerializer.parse(await response.body.text(), contentType),
1228
- "DeletePlayerBadRequestResponse", ""
1229
- ) as DeletePlayerBadRequestResponse;
1230
- throw new ApiException<DeletePlayerBadRequestResponse>(400, "Bad Request", body, response.headers);
1462
+ "BadRequestError", ""
1463
+ ) as BadRequestError;
1464
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1231
1465
  }
1232
1466
  if (isCodeInRange("404", response.httpStatusCode)) {
1233
1467
  const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize(
@@ -1266,11 +1500,11 @@ export class DefaultApiResponseProcessor {
1266
1500
  return body;
1267
1501
  }
1268
1502
  if (isCodeInRange("400", response.httpStatusCode)) {
1269
- const body: DeleteSegmentBadRequestResponse = ObjectSerializer.deserialize(
1503
+ const body: BadRequestError = ObjectSerializer.deserialize(
1270
1504
  ObjectSerializer.parse(await response.body.text(), contentType),
1271
- "DeleteSegmentBadRequestResponse", ""
1272
- ) as DeleteSegmentBadRequestResponse;
1273
- throw new ApiException<DeleteSegmentBadRequestResponse>(400, "Bad Request", body, response.headers);
1505
+ "BadRequestError", ""
1506
+ ) as BadRequestError;
1507
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1274
1508
  }
1275
1509
  if (isCodeInRange("404", response.httpStatusCode)) {
1276
1510
  const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize(
@@ -1292,6 +1526,38 @@ export class DefaultApiResponseProcessor {
1292
1526
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1293
1527
  }
1294
1528
 
1529
+ /**
1530
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
1531
+ * to the expected objects
1532
+ *
1533
+ * @params response Response returned by the server for a request to endLiveActivity
1534
+ * @throws ApiException if the response code was not in [200, 299]
1535
+ */
1536
+ public async endLiveActivity(response: ResponseContext): Promise<void > {
1537
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1538
+ if (isCodeInRange("204", response.httpStatusCode)) {
1539
+ return;
1540
+ }
1541
+ if (isCodeInRange("400", response.httpStatusCode)) {
1542
+ const body: BadRequestError = ObjectSerializer.deserialize(
1543
+ ObjectSerializer.parse(await response.body.text(), contentType),
1544
+ "BadRequestError", ""
1545
+ ) as BadRequestError;
1546
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1547
+ }
1548
+
1549
+ // Work around for missing responses in specification, e.g. for petstore.yaml
1550
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1551
+ const body: void = ObjectSerializer.deserialize(
1552
+ ObjectSerializer.parse(await response.body.text(), contentType),
1553
+ "void", ""
1554
+ ) as void;
1555
+ return body;
1556
+ }
1557
+
1558
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1559
+ }
1560
+
1295
1561
  /**
1296
1562
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1297
1563
  * to the expected objects
@@ -1309,11 +1575,11 @@ export class DefaultApiResponseProcessor {
1309
1575
  return body;
1310
1576
  }
1311
1577
  if (isCodeInRange("400", response.httpStatusCode)) {
1312
- const body: object = ObjectSerializer.deserialize(
1578
+ const body: BadRequestError = ObjectSerializer.deserialize(
1313
1579
  ObjectSerializer.parse(await response.body.text(), contentType),
1314
- "object", ""
1315
- ) as object;
1316
- throw new ApiException<object>(400, "Bad Request", body, response.headers);
1580
+ "BadRequestError", ""
1581
+ ) as BadRequestError;
1582
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1317
1583
  }
1318
1584
 
1319
1585
  // Work around for missing responses in specification, e.g. for petstore.yaml
@@ -1344,6 +1610,13 @@ export class DefaultApiResponseProcessor {
1344
1610
  ) as App;
1345
1611
  return body;
1346
1612
  }
1613
+ if (isCodeInRange("400", response.httpStatusCode)) {
1614
+ const body: BadRequestError = ObjectSerializer.deserialize(
1615
+ ObjectSerializer.parse(await response.body.text(), contentType),
1616
+ "BadRequestError", ""
1617
+ ) as BadRequestError;
1618
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1619
+ }
1347
1620
 
1348
1621
  // Work around for missing responses in specification, e.g. for petstore.yaml
1349
1622
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1373,6 +1646,13 @@ export class DefaultApiResponseProcessor {
1373
1646
  ) as Array<App>;
1374
1647
  return body;
1375
1648
  }
1649
+ if (isCodeInRange("400", response.httpStatusCode)) {
1650
+ const body: BadRequestError = ObjectSerializer.deserialize(
1651
+ ObjectSerializer.parse(await response.body.text(), contentType),
1652
+ "BadRequestError", ""
1653
+ ) as BadRequestError;
1654
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1655
+ }
1376
1656
 
1377
1657
  // Work around for missing responses in specification, e.g. for petstore.yaml
1378
1658
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1402,6 +1682,13 @@ export class DefaultApiResponseProcessor {
1402
1682
  ) as NotificationWithMeta;
1403
1683
  return body;
1404
1684
  }
1685
+ if (isCodeInRange("400", response.httpStatusCode)) {
1686
+ const body: BadRequestError = ObjectSerializer.deserialize(
1687
+ ObjectSerializer.parse(await response.body.text(), contentType),
1688
+ "BadRequestError", ""
1689
+ ) as BadRequestError;
1690
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1691
+ }
1405
1692
 
1406
1693
  // Work around for missing responses in specification, e.g. for petstore.yaml
1407
1694
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1432,11 +1719,11 @@ export class DefaultApiResponseProcessor {
1432
1719
  return body;
1433
1720
  }
1434
1721
  if (isCodeInRange("400", response.httpStatusCode)) {
1435
- const body: NotificationHistoryBadRequestResponse = ObjectSerializer.deserialize(
1722
+ const body: BadRequestError = ObjectSerializer.deserialize(
1436
1723
  ObjectSerializer.parse(await response.body.text(), contentType),
1437
- "NotificationHistoryBadRequestResponse", ""
1438
- ) as NotificationHistoryBadRequestResponse;
1439
- throw new ApiException<NotificationHistoryBadRequestResponse>(400, "Bad Request", body, response.headers);
1724
+ "BadRequestError", ""
1725
+ ) as BadRequestError;
1726
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1440
1727
  }
1441
1728
 
1442
1729
  // Work around for missing responses in specification, e.g. for petstore.yaml
@@ -1467,6 +1754,13 @@ export class DefaultApiResponseProcessor {
1467
1754
  ) as NotificationSlice;
1468
1755
  return body;
1469
1756
  }
1757
+ if (isCodeInRange("400", response.httpStatusCode)) {
1758
+ const body: BadRequestError = ObjectSerializer.deserialize(
1759
+ ObjectSerializer.parse(await response.body.text(), contentType),
1760
+ "BadRequestError", ""
1761
+ ) as BadRequestError;
1762
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1763
+ }
1470
1764
 
1471
1765
  // Work around for missing responses in specification, e.g. for petstore.yaml
1472
1766
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1496,6 +1790,13 @@ export class DefaultApiResponseProcessor {
1496
1790
  ) as OutcomesData;
1497
1791
  return body;
1498
1792
  }
1793
+ if (isCodeInRange("400", response.httpStatusCode)) {
1794
+ const body: BadRequestError = ObjectSerializer.deserialize(
1795
+ ObjectSerializer.parse(await response.body.text(), contentType),
1796
+ "BadRequestError", ""
1797
+ ) as BadRequestError;
1798
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1799
+ }
1499
1800
 
1500
1801
  // Work around for missing responses in specification, e.g. for petstore.yaml
1501
1802
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1525,6 +1826,13 @@ export class DefaultApiResponseProcessor {
1525
1826
  ) as Player;
1526
1827
  return body;
1527
1828
  }
1829
+ if (isCodeInRange("400", response.httpStatusCode)) {
1830
+ const body: BadRequestError = ObjectSerializer.deserialize(
1831
+ ObjectSerializer.parse(await response.body.text(), contentType),
1832
+ "BadRequestError", ""
1833
+ ) as BadRequestError;
1834
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1835
+ }
1528
1836
 
1529
1837
  // Work around for missing responses in specification, e.g. for petstore.yaml
1530
1838
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1554,6 +1862,13 @@ export class DefaultApiResponseProcessor {
1554
1862
  ) as PlayerSlice;
1555
1863
  return body;
1556
1864
  }
1865
+ if (isCodeInRange("400", response.httpStatusCode)) {
1866
+ const body: BadRequestError = ObjectSerializer.deserialize(
1867
+ ObjectSerializer.parse(await response.body.text(), contentType),
1868
+ "BadRequestError", ""
1869
+ ) as BadRequestError;
1870
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1871
+ }
1557
1872
 
1558
1873
  // Work around for missing responses in specification, e.g. for petstore.yaml
1559
1874
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1583,6 +1898,13 @@ export class DefaultApiResponseProcessor {
1583
1898
  ) as App;
1584
1899
  return body;
1585
1900
  }
1901
+ if (isCodeInRange("400", response.httpStatusCode)) {
1902
+ const body: BadRequestError = ObjectSerializer.deserialize(
1903
+ ObjectSerializer.parse(await response.body.text(), contentType),
1904
+ "BadRequestError", ""
1905
+ ) as BadRequestError;
1906
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1907
+ }
1586
1908
 
1587
1909
  // Work around for missing responses in specification, e.g. for petstore.yaml
1588
1910
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1596,6 +1918,42 @@ export class DefaultApiResponseProcessor {
1596
1918
  throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1597
1919
  }
1598
1920
 
1921
+ /**
1922
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
1923
+ * to the expected objects
1924
+ *
1925
+ * @params response Response returned by the server for a request to updateLiveActivity
1926
+ * @throws ApiException if the response code was not in [200, 299]
1927
+ */
1928
+ public async updateLiveActivity(response: ResponseContext): Promise<UpdateLiveActivitySuccessResponse > {
1929
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
1930
+ if (isCodeInRange("200", response.httpStatusCode)) {
1931
+ const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize(
1932
+ ObjectSerializer.parse(await response.body.text(), contentType),
1933
+ "UpdateLiveActivitySuccessResponse", ""
1934
+ ) as UpdateLiveActivitySuccessResponse;
1935
+ return body;
1936
+ }
1937
+ if (isCodeInRange("400", response.httpStatusCode)) {
1938
+ const body: BadRequestError = ObjectSerializer.deserialize(
1939
+ ObjectSerializer.parse(await response.body.text(), contentType),
1940
+ "BadRequestError", ""
1941
+ ) as BadRequestError;
1942
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1943
+ }
1944
+
1945
+ // Work around for missing responses in specification, e.g. for petstore.yaml
1946
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1947
+ const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize(
1948
+ ObjectSerializer.parse(await response.body.text(), contentType),
1949
+ "UpdateLiveActivitySuccessResponse", ""
1950
+ ) as UpdateLiveActivitySuccessResponse;
1951
+ return body;
1952
+ }
1953
+
1954
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1955
+ }
1956
+
1599
1957
  /**
1600
1958
  * Unwraps the actual response sent by the server from the response context and deserializes the response content
1601
1959
  * to the expected objects
@@ -1612,6 +1970,13 @@ export class DefaultApiResponseProcessor {
1612
1970
  ) as UpdatePlayerSuccessResponse;
1613
1971
  return body;
1614
1972
  }
1973
+ if (isCodeInRange("400", response.httpStatusCode)) {
1974
+ const body: BadRequestError = ObjectSerializer.deserialize(
1975
+ ObjectSerializer.parse(await response.body.text(), contentType),
1976
+ "BadRequestError", ""
1977
+ ) as BadRequestError;
1978
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
1979
+ }
1615
1980
 
1616
1981
  // Work around for missing responses in specification, e.g. for petstore.yaml
1617
1982
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -1641,6 +2006,13 @@ export class DefaultApiResponseProcessor {
1641
2006
  ) as UpdatePlayerTagsSuccessResponse;
1642
2007
  return body;
1643
2008
  }
2009
+ if (isCodeInRange("400", response.httpStatusCode)) {
2010
+ const body: BadRequestError = ObjectSerializer.deserialize(
2011
+ ObjectSerializer.parse(await response.body.text(), contentType),
2012
+ "BadRequestError", ""
2013
+ ) as BadRequestError;
2014
+ throw new ApiException<BadRequestError>(400, "Bad Request", body, response.headers);
2015
+ }
1644
2016
 
1645
2017
  // Work around for missing responses in specification, e.g. for petstore.yaml
1646
2018
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {