diff --git a/CHANGELOG.md b/CHANGELOG.md index 483d45d..9737320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## December 2022 +### `1.0.0-beta8` - 11/14/2022 +- Added Live Activity endpoints +- Fixed various bugs ## November 2022 ### `1.0.0-beta5` - 11/14/2022 diff --git a/DefaultApi.md b/DefaultApi.md index 6e0b842..c872bf8 100644 --- a/DefaultApi.md +++ b/DefaultApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://onesignal.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**beginLiveActivity**](DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity [**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification @@ -11,6 +12,7 @@ Method | HTTP request | Description [**createSegments**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments [**deletePlayer**](DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record [**deleteSegments**](DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +[**endLiveActivity**](DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity [**exportPlayers**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | CSV export [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps @@ -21,10 +23,75 @@ Method | HTTP request | Description [**getPlayer**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device [**getPlayers**](DefaultApi.md#getPlayers) | **GET** /players | View devices [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app +[**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push [**updatePlayer**](DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device [**updatePlayerTags**](DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id +# **beginLiveActivity** +> void beginLiveActivity(beginLiveActivityRequest) + +Starts a Live Activity + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiBeginLiveActivityRequest = { + // string | The OneSignal App ID for your app. Available in Keys & IDs. + appId: "app_id_example", + // string | Live Activity record ID + activityId: "activity_id_example", + // BeginLiveActivityRequest + beginLiveActivityRequest: { + push_token: "push_token_example", + subscription_id: "subscription_id_example", + }, +}; + +apiInstance.beginLiveActivity(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **beginLiveActivityRequest** | **BeginLiveActivityRequest**| | + **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined + **activityId** | [**string**] | Live Activity record ID | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[app_key](README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | OK | - | +**400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **cancelNotification** > CancelNotificationSuccessResponse cancelNotification() @@ -79,6 +146,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -112,6 +180,10 @@ let body:.DefaultApiCreateAppRequest = { apns_p12_password: "apns_p12_password_example", safari_apns_p12: "safari_apns_p12_example", safari_apns_p12_password: "safari_apns_p12_password_example", + apns_key_id: "apns_key_id_example", + apns_team_id: "apns_team_id_example", + apns_bundle_id: "apns_bundle_id_example", + apns_p8: "apns_p8_example", safari_site_origin: "safari_site_origin_example", safari_icon_256_256: "safari_icon_256_256_example", site_name: "site_name_example", @@ -151,6 +223,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -286,6 +359,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -472,6 +546,67 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **endLiveActivity** +> void endLiveActivity() + +Stops a Live Activity + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiEndLiveActivityRequest = { + // string | The OneSignal App ID for your app. Available in Keys & IDs. + appId: "app_id_example", + // string | Live Activity record ID + activityId: "activity_id_example", + // string | Subscription ID + subscriptionId: "subscription_id_example", +}; + +apiInstance.endLiveActivity(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined + **activityId** | [**string**] | Live Activity record ID | defaults to undefined + **subscriptionId** | [**string**] | Subscription ID | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[app_key](README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | OK | - | +**400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **exportPlayers** > ExportPlayersSuccessResponse exportPlayers() @@ -587,6 +722,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -635,6 +771,7 @@ This endpoint does not need any parameter. | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -692,6 +829,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -817,6 +955,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -886,6 +1025,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -946,6 +1086,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -1006,6 +1147,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -1041,6 +1183,10 @@ let body:.DefaultApiUpdateAppRequest = { apns_p12_password: "apns_p12_password_example", safari_apns_p12: "safari_apns_p12_example", safari_apns_p12_password: "safari_apns_p12_password_example", + apns_key_id: "apns_key_id_example", + apns_team_id: "apns_team_id_example", + apns_bundle_id: "apns_bundle_id_example", + apns_p8: "apns_p8_example", safari_site_origin: "safari_site_origin_example", safari_icon_256_256: "safari_icon_256_256_example", site_name: "site_name_example", @@ -1081,6 +1227,73 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **updateLiveActivity** +> UpdateLiveActivitySuccessResponse updateLiveActivity(updateLiveActivityRequest) + +Updates a specified live activity. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiUpdateLiveActivityRequest = { + // string | The OneSignal App ID for your app. Available in Keys & IDs. + appId: "app_id_example", + // string | Live Activity record ID + activityId: "activity_id_example", + // UpdateLiveActivityRequest + updateLiveActivityRequest: { + name: "headings", + event: "update", + event_updates: {}, + dismiss_at: 3.14, + }, +}; + +apiInstance.updateLiveActivity(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateLiveActivityRequest** | **UpdateLiveActivityRequest**| | + **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined + **activityId** | [**string**] | Live Activity record ID | defaults to undefined + + +### Return type + +**UpdateLiveActivitySuccessResponse** + +### Authorization + +[app_key](README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -1164,6 +1377,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -1226,6 +1440,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) diff --git a/README.md b/README.md index 4a4f3b9..4efa0e0 100644 --- a/README.md +++ b/README.md @@ -399,6 +399,47 @@ Outcome data are accessible for 30 days before being deleted from our servers. Y const outcomes = await client.getOutcomes(app.id, 'os__click.count,os_session_duration.count,my_outcome.sum'); ``` +### Begin Live Activity +Starts a Live Activity event +```js +// Create a player first +const player = new OneSignal.Player(); +player.device_type = 0; +player.app_id = ''; +const playerResponse = await api.createPlayer(player); + +// Prepare a request +const beginLiveActivityRequest: BeginLiveActivityRequest = { + push_token: '', + subscription_id: playerResponse.id!, +}; +const activityId = ''; // any string + +// Begin activity +await api.beginLiveActivity('', activityId, beginLiveActivityRequest); +``` + +### Update Live Activity +Updates a Live Activity event +```js +const updateLiveActivityRequest: UpdateLiveActivityRequest = { + event_updates: { + data: 'test' + }, + event: "update", + name: "contents" +}; + +await api.updateLiveActivity('', '', updateLiveActivityRequest); +``` + +### End Live Activity +Stops a Live Activity event +```js +const subscriptionId = ''; // player id +await api.endLiveActivity('', '', subscriptionId); +``` + ## Author * Website: https://onesignal.com diff --git a/apis/DefaultApi.ts b/apis/DefaultApi.ts index 95813ab..b318e1b 100644 --- a/apis/DefaultApi.ts +++ b/apis/DefaultApi.ts @@ -11,24 +11,21 @@ import {SecurityAuthentication} from '../auth/auth'; import { App } from '../models/App'; +import { BadRequestError } from '../models/BadRequestError'; +import { BeginLiveActivityRequest } from '../models/BeginLiveActivityRequest'; import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse'; -import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse'; import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse'; import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; -import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; -import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; -import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse'; import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody'; import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse'; import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody'; import { Notification } from '../models/Notification'; -import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse'; import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse'; import { NotificationSlice } from '../models/NotificationSlice'; import { NotificationWithMeta } from '../models/NotificationWithMeta'; @@ -36,6 +33,8 @@ import { OutcomesData } from '../models/OutcomesData'; import { Player } from '../models/Player'; import { PlayerSlice } from '../models/PlayerSlice'; import { Segment } from '../models/Segment'; +import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest'; +import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse'; @@ -45,6 +44,70 @@ import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSucce */ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { + /** + * Starts a Live Activity + * Start Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param beginLiveActivityRequest + */ + public async beginLiveActivity(appId: string, activityId: string, beginLiveActivityRequest: BeginLiveActivityRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("DefaultApi", "beginLiveActivity", "appId"); + } + + + // verify required parameter 'activityId' is not null or undefined + if (activityId === null || activityId === undefined) { + throw new RequiredError("DefaultApi", "beginLiveActivity", "activityId"); + } + + + // verify required parameter 'beginLiveActivityRequest' is not null or undefined + if (beginLiveActivityRequest === null || beginLiveActivityRequest === undefined) { + throw new RequiredError("DefaultApi", "beginLiveActivity", "beginLiveActivityRequest"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(beginLiveActivityRequest, "BeginLiveActivityRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["app_key"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Used to stop a scheduled or currently outgoing notification * Stop a scheduled or currently outgoing notification @@ -386,6 +449,60 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Stops a Live Activity + * Stop Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param subscriptionId Subscription ID + */ + public async endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("DefaultApi", "endLiveActivity", "appId"); + } + + + // verify required parameter 'activityId' is not null or undefined + if (activityId === null || activityId === undefined) { + throw new RequiredError("DefaultApi", "endLiveActivity", "activityId"); + } + + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "endLiveActivity", "subscriptionId"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId))) + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["app_key"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | * CSV export @@ -921,6 +1038,70 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Updates a specified live activity. + * Update a Live Activity via Push + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param updateLiveActivityRequest + */ + public async updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("DefaultApi", "updateLiveActivity", "appId"); + } + + + // verify required parameter 'activityId' is not null or undefined + if (activityId === null || activityId === undefined) { + throw new RequiredError("DefaultApi", "updateLiveActivity", "activityId"); + } + + + // verify required parameter 'updateLiveActivityRequest' is not null or undefined + if (updateLiveActivityRequest === null || updateLiveActivityRequest === undefined) { + throw new RequiredError("DefaultApi", "updateLiveActivity", "updateLiveActivityRequest"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/notifications' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(updateLiveActivityRequest, "UpdateLiveActivityRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["app_key"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Update an existing device in one of your OneSignal apps * Edit device @@ -1040,6 +1221,38 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { export class DefaultApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to beginLiveActivity + * @throws ApiException if the response code was not in [200, 299] + */ + public async beginLiveActivity(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return; + } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1056,6 +1269,13 @@ export class DefaultApiResponseProcessor { ) as CancelNotificationSuccessResponse; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1085,6 +1305,13 @@ export class DefaultApiResponseProcessor { ) as App; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1115,11 +1342,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: CreateNotificationBadRequestResponse = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CreateNotificationBadRequestResponse", "" - ) as CreateNotificationBadRequestResponse; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1150,6 +1377,13 @@ export class DefaultApiResponseProcessor { ) as CreatePlayerSuccessResponse; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1180,11 +1414,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: CreateSegmentBadRequestResponse = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CreateSegmentBadRequestResponse", "" - ) as CreateSegmentBadRequestResponse; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } if (isCodeInRange("409", response.httpStatusCode)) { const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize( @@ -1223,11 +1457,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: DeletePlayerBadRequestResponse = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DeletePlayerBadRequestResponse", "" - ) as DeletePlayerBadRequestResponse; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { const body: DeletePlayerNotFoundResponse = ObjectSerializer.deserialize( @@ -1266,11 +1500,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: DeleteSegmentBadRequestResponse = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DeleteSegmentBadRequestResponse", "" - ) as DeleteSegmentBadRequestResponse; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { const body: DeleteSegmentNotFoundResponse = ObjectSerializer.deserialize( @@ -1292,6 +1526,38 @@ export class DefaultApiResponseProcessor { throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to endLiveActivity + * @throws ApiException if the response code was not in [200, 299] + */ + public async endLiveActivity(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return; + } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1309,11 +1575,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: object = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "object", "" - ) as object; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1344,6 +1610,13 @@ export class DefaultApiResponseProcessor { ) as App; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1373,6 +1646,13 @@ export class DefaultApiResponseProcessor { ) as Array; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1402,6 +1682,13 @@ export class DefaultApiResponseProcessor { ) as NotificationWithMeta; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1432,11 +1719,11 @@ export class DefaultApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - const body: NotificationHistoryBadRequestResponse = ObjectSerializer.deserialize( + const body: BadRequestError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "NotificationHistoryBadRequestResponse", "" - ) as NotificationHistoryBadRequestResponse; - throw new ApiException(400, "Bad Request", body, response.headers); + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1467,6 +1754,13 @@ export class DefaultApiResponseProcessor { ) as NotificationSlice; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1496,6 +1790,13 @@ export class DefaultApiResponseProcessor { ) as OutcomesData; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1525,6 +1826,13 @@ export class DefaultApiResponseProcessor { ) as Player; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1554,6 +1862,13 @@ export class DefaultApiResponseProcessor { ) as PlayerSlice; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1583,6 +1898,13 @@ export class DefaultApiResponseProcessor { ) as App; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1596,6 +1918,42 @@ export class DefaultApiResponseProcessor { throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateLiveActivity + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateLiveActivity(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpdateLiveActivitySuccessResponse", "" + ) as UpdateLiveActivitySuccessResponse; + return body; + } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UpdateLiveActivitySuccessResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpdateLiveActivitySuccessResponse", "" + ) as UpdateLiveActivitySuccessResponse; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1612,6 +1970,13 @@ export class DefaultApiResponseProcessor { ) as UpdatePlayerSuccessResponse; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { @@ -1641,6 +2006,13 @@ export class DefaultApiResponseProcessor { ) as UpdatePlayerTagsSuccessResponse; return body; } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: BadRequestError = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "BadRequestError", "" + ) as BadRequestError; + throw new ApiException(400, "Bad Request", body, response.headers); + } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { diff --git a/models/App.ts b/models/App.ts index 55ee9dc..885c527 100644 --- a/models/App.ts +++ b/models/App.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ @@ -65,6 +65,22 @@ export class App { */ 'safari_apns_p12_password'?: string; /** + * iOS: Required if using p8. Unique identifier for the p8 authentication key. + */ + 'apns_key_id'?: string; + /** + * iOS: Required if using p8. Team ID generated by Apple for your developer account. + */ + 'apns_team_id'?: string; + /** + * iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. + */ + 'apns_bundle_id'?: string; + /** + * iOS: Required if using p8. Base64 encoded p8 key + */ + 'apns_p8'?: string; + /** * Safari (Recommended): The hostname to your website including http(s):// */ 'safari_site_origin'?: string; @@ -208,6 +224,30 @@ export class App { "type": "string", "format": "" }, + { + "name": "apns_key_id", + "baseName": "apns_key_id", + "type": "string", + "format": "" + }, + { + "name": "apns_team_id", + "baseName": "apns_team_id", + "type": "string", + "format": "" + }, + { + "name": "apns_bundle_id", + "baseName": "apns_bundle_id", + "type": "string", + "format": "" + }, + { + "name": "apns_p8", + "baseName": "apns_p8", + "type": "string", + "format": "" + }, { "name": "safari_site_origin", "baseName": "safari_site_origin", diff --git a/models/BadRequestError.ts b/models/BadRequestError.ts new file mode 100644 index 0000000..167656f --- /dev/null +++ b/models/BadRequestError.ts @@ -0,0 +1,31 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.0.2 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class BadRequestError { + 'errors'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "errors", + "baseName": "errors", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BadRequestError.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/BasicNotification.ts b/models/BasicNotification.ts index 2d955a3..8023438 100644 --- a/models/BasicNotification.ts +++ b/models/BasicNotification.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotificationAllOf.ts b/models/BasicNotificationAllOf.ts index 399fb7d..f95f7d9 100644 --- a/models/BasicNotificationAllOf.ts +++ b/models/BasicNotificationAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotificationAllOfAndroidBackgroundLayout.ts b/models/BasicNotificationAllOfAndroidBackgroundLayout.ts index d7191c5..2e3243f 100644 --- a/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +++ b/models/BasicNotificationAllOfAndroidBackgroundLayout.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/BeginLiveActivityRequest.ts b/models/BeginLiveActivityRequest.ts new file mode 100644 index 0000000..d8cd263 --- /dev/null +++ b/models/BeginLiveActivityRequest.ts @@ -0,0 +1,38 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.0.2 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class BeginLiveActivityRequest { + 'push_token': string; + 'subscription_id': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "push_token", + "baseName": "push_token", + "type": "string", + "format": "" + }, + { + "name": "subscription_id", + "baseName": "subscription_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BeginLiveActivityRequest.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/Button.ts b/models/Button.ts index b11b941..a167a38 100644 --- a/models/Button.ts +++ b/models/Button.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/CancelNotificationSuccessResponse.ts b/models/CancelNotificationSuccessResponse.ts index 86ded5b..d40149d 100644 --- a/models/CancelNotificationSuccessResponse.ts +++ b/models/CancelNotificationSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/CreateNotificationSuccessResponse.ts b/models/CreateNotificationSuccessResponse.ts index 33cecbe..9e952a5 100644 --- a/models/CreateNotificationSuccessResponse.ts +++ b/models/CreateNotificationSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/CreatePlayerSuccessResponse.ts b/models/CreatePlayerSuccessResponse.ts index 5d90b13..073e6c8 100644 --- a/models/CreatePlayerSuccessResponse.ts +++ b/models/CreatePlayerSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentConflictResponse.ts b/models/CreateSegmentConflictResponse.ts index 1fc9b5b..8c3ee0f 100644 --- a/models/CreateSegmentConflictResponse.ts +++ b/models/CreateSegmentConflictResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentSuccessResponse.ts b/models/CreateSegmentSuccessResponse.ts index 1fd8266..2fa0dac 100644 --- a/models/CreateSegmentSuccessResponse.ts +++ b/models/CreateSegmentSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/DeletePlayerNotFoundResponse.ts b/models/DeletePlayerNotFoundResponse.ts index e385178..fa158d8 100644 --- a/models/DeletePlayerNotFoundResponse.ts +++ b/models/DeletePlayerNotFoundResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/DeletePlayerSuccessResponse.ts b/models/DeletePlayerSuccessResponse.ts index 6c5d6c1..1427eae 100644 --- a/models/DeletePlayerSuccessResponse.ts +++ b/models/DeletePlayerSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/DeleteSegmentNotFoundResponse.ts b/models/DeleteSegmentNotFoundResponse.ts index 7b2caae..141450b 100644 --- a/models/DeleteSegmentNotFoundResponse.ts +++ b/models/DeleteSegmentNotFoundResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/DeleteSegmentSuccessResponse.ts b/models/DeleteSegmentSuccessResponse.ts index dbfb3fd..fdb1863 100644 --- a/models/DeleteSegmentSuccessResponse.ts +++ b/models/DeleteSegmentSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/DeliveryData.ts b/models/DeliveryData.ts index 1bb3841..5692f1a 100644 --- a/models/DeliveryData.ts +++ b/models/DeliveryData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/ExportPlayersRequestBody.ts b/models/ExportPlayersRequestBody.ts index 85292f1..2d7fe98 100644 --- a/models/ExportPlayersRequestBody.ts +++ b/models/ExportPlayersRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/ExportPlayersSuccessResponse.ts b/models/ExportPlayersSuccessResponse.ts index 391a39c..7040266 100644 --- a/models/ExportPlayersSuccessResponse.ts +++ b/models/ExportPlayersSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Filter.ts b/models/Filter.ts index 788b3fd..e3b9a16 100644 --- a/models/Filter.ts +++ b/models/Filter.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/FilterExpressions.ts b/models/FilterExpressions.ts index a960790..7a8adab 100644 --- a/models/FilterExpressions.ts +++ b/models/FilterExpressions.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/GetNotificationRequestBody.ts b/models/GetNotificationRequestBody.ts index 17269b4..b7f6cd7 100644 --- a/models/GetNotificationRequestBody.ts +++ b/models/GetNotificationRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/InvalidIdentifierError.ts b/models/InvalidIdentifierError.ts index 954d082..8d7acec 100644 --- a/models/InvalidIdentifierError.ts +++ b/models/InvalidIdentifierError.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Notification.ts b/models/Notification.ts index 1d3ca84..ff35446 100644 --- a/models/Notification.ts +++ b/models/Notification.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Notification200Errors.ts b/models/Notification200Errors.ts index bbd45d0..e05e883 100644 --- a/models/Notification200Errors.ts +++ b/models/Notification200Errors.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationAllOf.ts b/models/NotificationAllOf.ts index cd2ff0c..7d32332 100644 --- a/models/NotificationAllOf.ts +++ b/models/NotificationAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationHistorySuccessResponse.ts b/models/NotificationHistorySuccessResponse.ts index 662363b..23c1f6c 100644 --- a/models/NotificationHistorySuccessResponse.ts +++ b/models/NotificationHistorySuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationSlice.ts b/models/NotificationSlice.ts index 309ad94..0cb179d 100644 --- a/models/NotificationSlice.ts +++ b/models/NotificationSlice.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationTarget.ts b/models/NotificationTarget.ts index 24f1247..3a581ea 100644 --- a/models/NotificationTarget.ts +++ b/models/NotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationWithMeta.ts b/models/NotificationWithMeta.ts index 72cf8d3..2f9d45c 100644 --- a/models/NotificationWithMeta.ts +++ b/models/NotificationWithMeta.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationWithMetaAllOf.ts b/models/NotificationWithMetaAllOf.ts index 79a6636..58f115c 100644 --- a/models/NotificationWithMetaAllOf.ts +++ b/models/NotificationWithMetaAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/ObjectSerializer.ts b/models/ObjectSerializer.ts index c382942..1f0edec 100644 --- a/models/ObjectSerializer.ts +++ b/models/ObjectSerializer.ts @@ -1,19 +1,17 @@ export * from './App'; +export * from './BadRequestError'; export * from './BasicNotification'; export * from './BasicNotificationAllOf'; export * from './BasicNotificationAllOfAndroidBackgroundLayout'; +export * from './BeginLiveActivityRequest'; export * from './Button'; export * from './CancelNotificationSuccessResponse'; -export * from './CreateNotificationBadRequestResponse'; export * from './CreateNotificationSuccessResponse'; export * from './CreatePlayerSuccessResponse'; -export * from './CreateSegmentBadRequestResponse'; export * from './CreateSegmentConflictResponse'; export * from './CreateSegmentSuccessResponse'; -export * from './DeletePlayerBadRequestResponse'; export * from './DeletePlayerNotFoundResponse'; export * from './DeletePlayerSuccessResponse'; -export * from './DeleteSegmentBadRequestResponse'; export * from './DeleteSegmentNotFoundResponse'; export * from './DeleteSegmentSuccessResponse'; export * from './DeliveryData'; @@ -26,7 +24,6 @@ export * from './InvalidIdentifierError'; export * from './Notification'; export * from './Notification200Errors'; export * from './NotificationAllOf'; -export * from './NotificationHistoryBadRequestResponse'; export * from './NotificationHistorySuccessResponse'; export * from './NotificationSlice'; export * from './NotificationTarget'; @@ -45,26 +42,26 @@ export * from './Purchase'; export * from './Segment'; export * from './SegmentNotificationTarget'; export * from './StringMap'; +export * from './UpdateLiveActivityRequest'; +export * from './UpdateLiveActivitySuccessResponse'; export * from './UpdatePlayerSuccessResponse'; export * from './UpdatePlayerTagsRequestBody'; export * from './UpdatePlayerTagsSuccessResponse'; -import { App , AppApnsEnvEnum } from './App'; +import { App , AppApnsEnvEnum } from './App'; +import { BadRequestError } from './BadRequestError'; import { BasicNotification , BasicNotificationAggregationEnum } from './BasicNotification'; import { BasicNotificationAllOf , BasicNotificationAllOfAggregationEnum } from './BasicNotificationAllOf'; import { BasicNotificationAllOfAndroidBackgroundLayout } from './BasicNotificationAllOfAndroidBackgroundLayout'; +import { BeginLiveActivityRequest } from './BeginLiveActivityRequest'; import { Button } from './Button'; import { CancelNotificationSuccessResponse } from './CancelNotificationSuccessResponse'; -import { CreateNotificationBadRequestResponse } from './CreateNotificationBadRequestResponse'; import { CreateNotificationSuccessResponse } from './CreateNotificationSuccessResponse'; import { CreatePlayerSuccessResponse } from './CreatePlayerSuccessResponse'; -import { CreateSegmentBadRequestResponse } from './CreateSegmentBadRequestResponse'; import { CreateSegmentConflictResponse } from './CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from './CreateSegmentSuccessResponse'; -import { DeletePlayerBadRequestResponse } from './DeletePlayerBadRequestResponse'; import { DeletePlayerNotFoundResponse } from './DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from './DeletePlayerSuccessResponse'; -import { DeleteSegmentBadRequestResponse } from './DeleteSegmentBadRequestResponse'; import { DeleteSegmentNotFoundResponse } from './DeleteSegmentNotFoundResponse'; import { DeleteSegmentSuccessResponse } from './DeleteSegmentSuccessResponse'; import { DeliveryData } from './DeliveryData'; @@ -77,7 +74,6 @@ import { InvalidIdentifierError } from './InvalidIdentifierError'; import { Notification , NotificationAggregationEnum } from './Notification'; import { Notification200Errors } from './Notification200Errors'; import { NotificationAllOf } from './NotificationAllOf'; -import { NotificationHistoryBadRequestResponse } from './NotificationHistoryBadRequestResponse'; import { NotificationHistorySuccessResponse } from './NotificationHistorySuccessResponse'; import { NotificationSlice } from './NotificationSlice'; import { NotificationTarget } from './NotificationTarget'; @@ -96,6 +92,8 @@ import { Purchase } from './Purchase'; import { Segment } from './Segment'; import { SegmentNotificationTarget } from './SegmentNotificationTarget'; import { StringMap } from './StringMap'; +import { UpdateLiveActivityRequest, UpdateLiveActivityRequestNameEnum , UpdateLiveActivityRequestEventEnum } from './UpdateLiveActivityRequest'; +import { UpdateLiveActivitySuccessResponse } from './UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from './UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from './UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from './UpdatePlayerTagsSuccessResponse'; @@ -131,25 +129,25 @@ let enumsMap: Set = new Set([ "NotificationWithMetaAggregationEnum", "OperatorOperatorEnum", "OutcomeDataAggregationEnum", + "UpdateLiveActivityRequestNameEnum", + "UpdateLiveActivityRequestEventEnum", ]); let typeMap: {[index: string]: any} = { "App": App, + "BadRequestError": BadRequestError, "BasicNotification": BasicNotification, "BasicNotificationAllOf": BasicNotificationAllOf, "BasicNotificationAllOfAndroidBackgroundLayout": BasicNotificationAllOfAndroidBackgroundLayout, + "BeginLiveActivityRequest": BeginLiveActivityRequest, "Button": Button, "CancelNotificationSuccessResponse": CancelNotificationSuccessResponse, - "CreateNotificationBadRequestResponse": CreateNotificationBadRequestResponse, "CreateNotificationSuccessResponse": CreateNotificationSuccessResponse, "CreatePlayerSuccessResponse": CreatePlayerSuccessResponse, - "CreateSegmentBadRequestResponse": CreateSegmentBadRequestResponse, "CreateSegmentConflictResponse": CreateSegmentConflictResponse, "CreateSegmentSuccessResponse": CreateSegmentSuccessResponse, - "DeletePlayerBadRequestResponse": DeletePlayerBadRequestResponse, "DeletePlayerNotFoundResponse": DeletePlayerNotFoundResponse, "DeletePlayerSuccessResponse": DeletePlayerSuccessResponse, - "DeleteSegmentBadRequestResponse": DeleteSegmentBadRequestResponse, "DeleteSegmentNotFoundResponse": DeleteSegmentNotFoundResponse, "DeleteSegmentSuccessResponse": DeleteSegmentSuccessResponse, "DeliveryData": DeliveryData, @@ -162,7 +160,6 @@ let typeMap: {[index: string]: any} = { "Notification": Notification, "Notification200Errors": Notification200Errors, "NotificationAllOf": NotificationAllOf, - "NotificationHistoryBadRequestResponse": NotificationHistoryBadRequestResponse, "NotificationHistorySuccessResponse": NotificationHistorySuccessResponse, "NotificationSlice": NotificationSlice, "NotificationTarget": NotificationTarget, @@ -181,6 +178,8 @@ let typeMap: {[index: string]: any} = { "Segment": Segment, "SegmentNotificationTarget": SegmentNotificationTarget, "StringMap": StringMap, + "UpdateLiveActivityRequest": UpdateLiveActivityRequest, + "UpdateLiveActivitySuccessResponse": UpdateLiveActivitySuccessResponse, "UpdatePlayerSuccessResponse": UpdatePlayerSuccessResponse, "UpdatePlayerTagsRequestBody": UpdatePlayerTagsRequestBody, "UpdatePlayerTagsSuccessResponse": UpdatePlayerTagsSuccessResponse, diff --git a/models/Operator.ts b/models/Operator.ts index 09700b4..6aabcdb 100644 --- a/models/Operator.ts +++ b/models/Operator.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomeData.ts b/models/OutcomeData.ts index 3c3e583..2c4b9d3 100644 --- a/models/OutcomeData.ts +++ b/models/OutcomeData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomesData.ts b/models/OutcomesData.ts index d670509..c4d3cef 100644 --- a/models/OutcomesData.ts +++ b/models/OutcomesData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryData.ts b/models/PlatformDeliveryData.ts index ea59728..cc6bd8c 100644 --- a/models/PlatformDeliveryData.ts +++ b/models/PlatformDeliveryData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataEmailAllOf.ts b/models/PlatformDeliveryDataEmailAllOf.ts index dc4be45..67dca22 100644 --- a/models/PlatformDeliveryDataEmailAllOf.ts +++ b/models/PlatformDeliveryDataEmailAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataSmsAllOf.ts b/models/PlatformDeliveryDataSmsAllOf.ts index ed7c0fb..3fe746e 100644 --- a/models/PlatformDeliveryDataSmsAllOf.ts +++ b/models/PlatformDeliveryDataSmsAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Player.ts b/models/Player.ts index 168a8b1..995f1cc 100644 --- a/models/Player.ts +++ b/models/Player.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/PlayerNotificationTarget.ts b/models/PlayerNotificationTarget.ts index e225ff5..7bd4867 100644 --- a/models/PlayerNotificationTarget.ts +++ b/models/PlayerNotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/PlayerSlice.ts b/models/PlayerSlice.ts index 0a597fe..5364d97 100644 --- a/models/PlayerSlice.ts +++ b/models/PlayerSlice.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Purchase.ts b/models/Purchase.ts index 32c70be..c958331 100644 --- a/models/Purchase.ts +++ b/models/Purchase.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/Segment.ts b/models/Segment.ts index b0e0eb9..a8114a8 100644 --- a/models/Segment.ts +++ b/models/Segment.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/SegmentNotificationTarget.ts b/models/SegmentNotificationTarget.ts index ff5e895..11ab223 100644 --- a/models/SegmentNotificationTarget.ts +++ b/models/SegmentNotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/StringMap.ts b/models/StringMap.ts index 447e965..c94f943 100644 --- a/models/StringMap.ts +++ b/models/StringMap.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateLiveActivityRequest.ts b/models/UpdateLiveActivityRequest.ts new file mode 100644 index 0000000..f338659 --- /dev/null +++ b/models/UpdateLiveActivityRequest.ts @@ -0,0 +1,62 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.0.2 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class UpdateLiveActivityRequest { + /** + * Type of live activity + */ + 'name': UpdateLiveActivityRequestNameEnum; + 'event': UpdateLiveActivityRequestEventEnum; + 'event_updates': object; + /** + * Timestamp; only allowed if event is \"end\" + */ + 'dismiss_at'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "UpdateLiveActivityRequestNameEnum", + "format": "" + }, + { + "name": "event", + "baseName": "event", + "type": "UpdateLiveActivityRequestEventEnum", + "format": "" + }, + { + "name": "event_updates", + "baseName": "event_updates", + "type": "object", + "format": "" + }, + { + "name": "dismiss_at", + "baseName": "dismiss_at", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateLiveActivityRequest.attributeTypeMap; + } + + public constructor() { + } +} + + +export type UpdateLiveActivityRequestNameEnum = "headings" | "contents" | "ios_sound" | "priority_level" ; +export type UpdateLiveActivityRequestEventEnum = "update" | "end" ; + diff --git a/models/UpdateLiveActivitySuccessResponse.ts b/models/UpdateLiveActivitySuccessResponse.ts new file mode 100644 index 0000000..8378ff6 --- /dev/null +++ b/models/UpdateLiveActivitySuccessResponse.ts @@ -0,0 +1,39 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.0.2 + * Contact: devrel@onesignal.com + */ + +import { Notification200Errors } from './Notification200Errors'; +import { HttpFile } from '../http/http'; + +export class UpdateLiveActivitySuccessResponse { + 'notification_id'?: string; + 'errors'?: Notification200Errors; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "notification_id", + "baseName": "notification_id", + "type": "string", + "format": "" + }, + { + "name": "errors", + "baseName": "errors", + "type": "Notification200Errors", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateLiveActivitySuccessResponse.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UpdatePlayerSuccessResponse.ts b/models/UpdatePlayerSuccessResponse.ts index e1842c2..0ac74e2 100644 --- a/models/UpdatePlayerSuccessResponse.ts +++ b/models/UpdatePlayerSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/UpdatePlayerTagsRequestBody.ts b/models/UpdatePlayerTagsRequestBody.ts index 22a74ab..0e67082 100644 --- a/models/UpdatePlayerTagsRequestBody.ts +++ b/models/UpdatePlayerTagsRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/UpdatePlayerTagsSuccessResponse.ts b/models/UpdatePlayerTagsSuccessResponse.ts index 019261b..a56f60c 100644 --- a/models/UpdatePlayerTagsSuccessResponse.ts +++ b/models/UpdatePlayerTagsSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 1.0.1 + * API Version: 1.0.2 * Contact: devrel@onesignal.com */ diff --git a/models/all.ts b/models/all.ts index cc3da1c..7a14528 100644 --- a/models/all.ts +++ b/models/all.ts @@ -1,19 +1,17 @@ export * from './App' +export * from './BadRequestError' export * from './BasicNotification' export * from './BasicNotificationAllOf' export * from './BasicNotificationAllOfAndroidBackgroundLayout' +export * from './BeginLiveActivityRequest' export * from './Button' export * from './CancelNotificationSuccessResponse' -export * from './CreateNotificationBadRequestResponse' export * from './CreateNotificationSuccessResponse' export * from './CreatePlayerSuccessResponse' -export * from './CreateSegmentBadRequestResponse' export * from './CreateSegmentConflictResponse' export * from './CreateSegmentSuccessResponse' -export * from './DeletePlayerBadRequestResponse' export * from './DeletePlayerNotFoundResponse' export * from './DeletePlayerSuccessResponse' -export * from './DeleteSegmentBadRequestResponse' export * from './DeleteSegmentNotFoundResponse' export * from './DeleteSegmentSuccessResponse' export * from './DeliveryData' @@ -26,7 +24,6 @@ export * from './InvalidIdentifierError' export * from './Notification' export * from './Notification200Errors' export * from './NotificationAllOf' -export * from './NotificationHistoryBadRequestResponse' export * from './NotificationHistorySuccessResponse' export * from './NotificationSlice' export * from './NotificationTarget' @@ -45,6 +42,8 @@ export * from './Purchase' export * from './Segment' export * from './SegmentNotificationTarget' export * from './StringMap' +export * from './UpdateLiveActivityRequest' +export * from './UpdateLiveActivitySuccessResponse' export * from './UpdatePlayerSuccessResponse' export * from './UpdatePlayerTagsRequestBody' export * from './UpdatePlayerTagsSuccessResponse' diff --git a/package.json b/package.json index 295cf99..f739bb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onesignal/node-onesignal", - "version": "1.0.0-beta7", + "version": "1.0.0-beta8", "description": "OpenAPI client for @onesignal/node-onesignal", "author": "OpenAPI-Generator Contributors", "keywords": [ @@ -9,7 +9,7 @@ "openapi-client", "openapi-generator" ], - "license": "Unlicense", + "license": "MIT", "main": "./dist/index.js", "type": "commonjs", "exports": { @@ -21,7 +21,7 @@ "prepare": "npm run build" }, "dependencies": { - "@types/node": "^18.11.9", + "@types/node": "^18.11.17", "@types/node-fetch": "^2.5.7", "btoa": "^1.2.1", "es6-promise": "^4.2.4", diff --git a/types/ObjectParamAPI.ts b/types/ObjectParamAPI.ts index 1c553fe..1bb8534 100644 --- a/types/ObjectParamAPI.ts +++ b/types/ObjectParamAPI.ts @@ -3,21 +3,19 @@ import * as models from '../models/all'; import { Configuration} from '../configuration' import { App } from '../models/App'; +import { BadRequestError } from '../models/BadRequestError'; import { BasicNotification } from '../models/BasicNotification'; import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf'; import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout'; +import { BeginLiveActivityRequest } from '../models/BeginLiveActivityRequest'; import { Button } from '../models/Button'; import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse'; -import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse'; import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse'; import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; -import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; -import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; -import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse'; import { DeliveryData } from '../models/DeliveryData'; @@ -30,7 +28,6 @@ import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; import { NotificationAllOf } from '../models/NotificationAllOf'; -import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse'; import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse'; import { NotificationSlice } from '../models/NotificationSlice'; import { NotificationTarget } from '../models/NotificationTarget'; @@ -49,6 +46,8 @@ import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest'; +import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse'; @@ -56,6 +55,27 @@ import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSucce import { ObservableDefaultApi } from "./ObservableAPI"; import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; +export interface DefaultApiBeginLiveActivityRequest { + /** + * The OneSignal App ID for your app. Available in Keys & IDs. + * @type string + * @memberof DefaultApibeginLiveActivity + */ + appId: string + /** + * Live Activity record ID + * @type string + * @memberof DefaultApibeginLiveActivity + */ + activityId: string + /** + * + * @type BeginLiveActivityRequest + * @memberof DefaultApibeginLiveActivity + */ + beginLiveActivityRequest: BeginLiveActivityRequest +} + export interface DefaultApiCancelNotificationRequest { /** * @@ -143,6 +163,27 @@ export interface DefaultApiDeleteSegmentsRequest { segmentId: string } +export interface DefaultApiEndLiveActivityRequest { + /** + * The OneSignal App ID for your app. Available in Keys & IDs. + * @type string + * @memberof DefaultApiendLiveActivity + */ + appId: string + /** + * Live Activity record ID + * @type string + * @memberof DefaultApiendLiveActivity + */ + activityId: string + /** + * Subscription ID + * @type string + * @memberof DefaultApiendLiveActivity + */ + subscriptionId: string +} + export interface DefaultApiExportPlayersRequest { /** * The app ID that you want to export devices from @@ -323,6 +364,27 @@ export interface DefaultApiUpdateAppRequest { app: App } +export interface DefaultApiUpdateLiveActivityRequest { + /** + * The OneSignal App ID for your app. Available in Keys & IDs. + * @type string + * @memberof DefaultApiupdateLiveActivity + */ + appId: string + /** + * Live Activity record ID + * @type string + * @memberof DefaultApiupdateLiveActivity + */ + activityId: string + /** + * + * @type UpdateLiveActivityRequest + * @memberof DefaultApiupdateLiveActivity + */ + updateLiveActivityRequest: UpdateLiveActivityRequest +} + export interface DefaultApiUpdatePlayerRequest { /** * Player\'s OneSignal ID @@ -366,6 +428,15 @@ export class ObjectDefaultApi { this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); } + /** + * Starts a Live Activity + * Start Live Activity + * @param param the request object + */ + public beginLiveActivity(param: DefaultApiBeginLiveActivityRequest, options?: Configuration): Promise { + return this.api.beginLiveActivity(param.appId, param.activityId, param.beginLiveActivityRequest, options).toPromise(); + } + /** * Used to stop a scheduled or currently outgoing notification * Stop a scheduled or currently outgoing notification @@ -429,6 +500,15 @@ export class ObjectDefaultApi { return this.api.deleteSegments(param.appId, param.segmentId, options).toPromise(); } + /** + * Stops a Live Activity + * Stop Live Activity + * @param param the request object + */ + public endLiveActivity(param: DefaultApiEndLiveActivityRequest, options?: Configuration): Promise { + return this.api.endLiveActivity(param.appId, param.activityId, param.subscriptionId, options).toPromise(); + } + /** * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | * CSV export @@ -519,6 +599,15 @@ export class ObjectDefaultApi { return this.api.updateApp(param.appId, param.app, options).toPromise(); } + /** + * Updates a specified live activity. + * Update a Live Activity via Push + * @param param the request object + */ + public updateLiveActivity(param: DefaultApiUpdateLiveActivityRequest, options?: Configuration): Promise { + return this.api.updateLiveActivity(param.appId, param.activityId, param.updateLiveActivityRequest, options).toPromise(); + } + /** * Update an existing device in one of your OneSignal apps * Edit device diff --git a/types/ObservableAPI.ts b/types/ObservableAPI.ts index 15dadeb..f696a9d 100644 --- a/types/ObservableAPI.ts +++ b/types/ObservableAPI.ts @@ -4,21 +4,19 @@ import { Configuration} from '../configuration' import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { App } from '../models/App'; +import { BadRequestError } from '../models/BadRequestError'; import { BasicNotification } from '../models/BasicNotification'; import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf'; import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout'; +import { BeginLiveActivityRequest } from '../models/BeginLiveActivityRequest'; import { Button } from '../models/Button'; import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse'; -import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse'; import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse'; import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; -import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; -import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; -import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse'; import { DeliveryData } from '../models/DeliveryData'; @@ -31,7 +29,6 @@ import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; import { NotificationAllOf } from '../models/NotificationAllOf'; -import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse'; import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse'; import { NotificationSlice } from '../models/NotificationSlice'; import { NotificationTarget } from '../models/NotificationTarget'; @@ -50,6 +47,8 @@ import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest'; +import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse'; @@ -70,6 +69,32 @@ export class ObservableDefaultApi { this.responseProcessor = responseProcessor || new DefaultApiResponseProcessor(); } + /** + * Starts a Live Activity + * Start Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param beginLiveActivityRequest + */ + public beginLiveActivity(appId: string, activityId: string, beginLiveActivityRequest: BeginLiveActivityRequest, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.beginLiveActivity(appId, activityId, beginLiveActivityRequest, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (let middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (let middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.beginLiveActivity(rsp))); + })); + } + /** * Used to stop a scheduled or currently outgoing notification * Stop a scheduled or currently outgoing notification @@ -242,6 +267,32 @@ export class ObservableDefaultApi { })); } + /** + * Stops a Live Activity + * Stop Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param subscriptionId Subscription ID + */ + public endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.endLiveActivity(appId, activityId, subscriptionId, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (let middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (let middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.endLiveActivity(rsp))); + })); + } + /** * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | * CSV export @@ -497,6 +548,32 @@ export class ObservableDefaultApi { })); } + /** + * Updates a specified live activity. + * Update a Live Activity via Push + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param updateLiveActivityRequest + */ + public updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.updateLiveActivity(appId, activityId, updateLiveActivityRequest, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (let middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (let middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateLiveActivity(rsp))); + })); + } + /** * Update an existing device in one of your OneSignal apps * Edit device diff --git a/types/PromiseAPI.ts b/types/PromiseAPI.ts index 334fd91..92fb087 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -3,21 +3,19 @@ import * as models from '../models/all'; import { Configuration} from '../configuration' import { App } from '../models/App'; +import { BadRequestError } from '../models/BadRequestError'; import { BasicNotification } from '../models/BasicNotification'; import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf'; import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout'; +import { BeginLiveActivityRequest } from '../models/BeginLiveActivityRequest'; import { Button } from '../models/Button'; import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse'; -import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse'; import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse'; import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; -import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; -import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; -import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse'; import { DeliveryData } from '../models/DeliveryData'; @@ -30,7 +28,6 @@ import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; import { NotificationAllOf } from '../models/NotificationAllOf'; -import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse'; import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse'; import { NotificationSlice } from '../models/NotificationSlice'; import { NotificationTarget } from '../models/NotificationTarget'; @@ -49,6 +46,8 @@ import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest'; +import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse'; @@ -66,6 +65,18 @@ export class PromiseDefaultApi { this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); } + /** + * Starts a Live Activity + * Start Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param beginLiveActivityRequest + */ + public beginLiveActivity(appId: string, activityId: string, beginLiveActivityRequest: BeginLiveActivityRequest, _options?: Configuration): Promise { + const result = this.api.beginLiveActivity(appId, activityId, beginLiveActivityRequest, _options); + return result.toPromise(); + } + /** * Used to stop a scheduled or currently outgoing notification * Stop a scheduled or currently outgoing notification @@ -140,6 +151,18 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Stops a Live Activity + * Stop Live Activity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param subscriptionId Subscription ID + */ + public endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Promise { + const result = this.api.endLiveActivity(appId, activityId, subscriptionId, _options); + return result.toPromise(); + } + /** * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | * CSV export @@ -255,6 +278,18 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Updates a specified live activity. + * Update a Live Activity via Push + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. + * @param activityId Live Activity record ID + * @param updateLiveActivityRequest + */ + public updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise { + const result = this.api.updateLiveActivity(appId, activityId, updateLiveActivityRequest, _options); + return result.toPromise(); + } + /** * Update an existing device in one of your OneSignal apps * Edit device diff --git a/yarn.lock b/yarn.lock index 8037afd..1bf85af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,10 +10,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^18.11.9": - version "18.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" - integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== +"@types/node@*", "@types/node@^18.11.17": + version "18.11.17" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.17.tgz#5c009e1d9c38f4a2a9d45c0b0c493fe6cdb4bcb5" + integrity sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng== "@types/url-parse@1.4.4": version "1.4.4" @@ -100,9 +100,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== typescript@^4.0: - version "4.9.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" - integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== url-parse@^1.4.3: version "1.5.10"