diff --git a/CHANGELOG.md b/CHANGELOG.md index 9737320..1da14bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog All notable changes to this project will be documented in this file. + +## January 2023 +### `1.0.0-beta9` - 09/06/2023 +- Added User model endpoints + - Limitations + - Recommend using only in development and staging environments for Alpha releases. + - Aliases will be available in a future release + - Outcomes will be available in a future release + - Users are deleted when the last subscription is removed + - Known issues + - User properties may not update when Subscriptions are transferred + - Identity Verification + - We will be introducing JWT in follow up Alpha or Beta release + - Extra disabled subscriptions are created when switching Users in the SDK. + ## December 2022 ### `1.0.0-beta8` - 11/14/2022 - Added Live Activity endpoints diff --git a/DefaultApi.md b/DefaultApi.md index c872bf8..53b5825 100644 --- a/DefaultApi.md +++ b/DefaultApi.md @@ -10,22 +10,36 @@ Method | HTTP request | Description [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification [**createPlayer**](DefaultApi.md#createPlayer) | **POST** /players | Add a device [**createSegments**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments +[**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +[**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | +[**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | [**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 +[**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +[**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | [**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 +[**fetchAliases**](DefaultApi.md#fetchAliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +[**fetchUser**](DefaultApi.md#fetchUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**fetchUserIdentity**](DefaultApi.md#fetchUserIdentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps +[**getEligibleIams**](DefaultApi.md#getEligibleIams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes [**getPlayer**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device [**getPlayers**](DefaultApi.md#getPlayers) | **GET** /players | View devices +[**identifyUserByAlias**](DefaultApi.md#identifyUserByAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +[**identifyUserBySubscriptionId**](DefaultApi.md#identifyUserBySubscriptionId) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +[**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | [**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 +[**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +[**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | # **beginLiveActivity** @@ -322,7 +336,7 @@ let body:.DefaultApiCreatePlayerRequest = { last_active: 1, notification_types: 1, test_type: 1, - _long: 3.14, + long: 3.14, lat: 3.14, country: "country_example", }, @@ -428,6 +442,258 @@ 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) +# **createSubscription** +> InlineResponse201 createSubscription(createSubscriptionRequestBody) + +Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiCreateSubscriptionRequest = { + // string + appId: "app_id_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", + // CreateSubscriptionRequestBody + createSubscriptionRequestBody: { + subscription: { + id: "id_example", + type: "iOSPush", + token: "token_example", + enabled: true, + notification_types: 3.14, + session_time: 3.14, + session_count: 3.14, + sdk: "sdk_example", + device_model: "device_model_example", + device_os: "device_os_example", + rooted: true, + test_type: 3.14, + app_version: "app_version_example", + net_type: 3.14, + carrier: "carrier_example", + web_auth: "web_auth_example", + web_p256: "web_p256_example", + }, + retain_previous_owner: true, + }, +}; + +apiInstance.createSubscription(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createSubscriptionRequestBody** | **CreateSubscriptionRequestBody**| | + **appId** | [**string**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined + + +### Return type + +**InlineResponse201** + +### 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 | +|-------------|-------------|------------------| +**201** | CREATED | - | +**202** | ACCEPTED | - | + +[[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) + +# **createUser** +> User createUser(user) + +Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiCreateUserRequest = { + // string + appId: "app_id_example", + // User + user: { + properties: { + tags: {}, + language: "language_example", + timezone_id: "timezone_id_example", + lat: 3.14, + long: 3.14, + country: "country_example", + first_active: 3.14, + last_active: 3.14, + amount_spent: 3.14, + purchases: [ + { + sku: "sku_example", + amount: "amount_example", + iso: "iso_example", + }, + ], + ip: "ip_example", + }, + identity: {}, + subscriptions: [ + { + id: "id_example", + type: "iOSPush", + token: "token_example", + enabled: true, + notification_types: 3.14, + session_time: 3.14, + session_count: 3.14, + sdk: "sdk_example", + device_model: "device_model_example", + device_os: "device_os_example", + rooted: true, + test_type: 3.14, + app_version: "app_version_example", + net_type: 3.14, + carrier: "carrier_example", + web_auth: "web_auth_example", + web_p256: "web_p256_example", + }, + ], + subscription_options: { + retain_previous_owner: true, + }, + }, +}; + +apiInstance.createUser(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **User**| | + **appId** | [**string**] | | defaults to undefined + + +### Return type + +**User** + +### 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 | +|-------------|-------------|------------------| +**201** | CREATED | - | +**202** | ACCEPTED | - | +**409** | Multiple User Identity Conflict | - | + +[[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) + +# **deleteAlias** +> InlineResponse200 deleteAlias() + +Deletes an alias by alias label + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiDeleteAliasRequest = { + // string + appId: "app_id_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", + // string + aliasLabelToDelete: "alias_label_to_delete_example", +}; + +apiInstance.deleteAlias(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**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined + **aliasLabelToDelete** | [**string**] | | defaults to undefined + + +### Return type + +**InlineResponse200** + +### 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 | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + # **deletePlayer** > DeletePlayerSuccessResponse deletePlayer() @@ -546,10 +812,10 @@ 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() +# **deleteSubscription** +> void deleteSubscription() -Stops a Live Activity +Deletes the Subscription. ### Example @@ -561,16 +827,14 @@ 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. +let body:.DefaultApiDeleteSubscriptionRequest = { + // string appId: "app_id_example", - // string | Live Activity record ID - activityId: "activity_id_example", - // string | Subscription ID + // string subscriptionId: "subscription_id_example", }; -apiInstance.endLiveActivity(body).then((data:any) => { +apiInstance.deleteSubscription(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -580,9 +844,8 @@ apiInstance.endLiveActivity(body).then((data:any) => { 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 + **appId** | [**string**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined ### Return type @@ -596,21 +859,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | OK | - | -**400** | Bad Request | - | +**202** | ACCEPTED | - | [[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() +# **deleteUser** +> void deleteUser() -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. | +Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases ### Example @@ -622,20 +884,16 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiExportPlayersRequest = { - // string | The app ID that you want to export devices from +let body:.DefaultApiDeleteUserRequest = { + // string appId: "app_id_example", - // ExportPlayersRequestBody (optional) - exportPlayersRequestBody: { - extra_fields: [ - "extra_fields_example", - ], - last_active_since: "last_active_since_example", - segment_name: "segment_name_example", - }, + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", }; -apiInstance.exportPlayers(body).then((data:any) => { +apiInstance.deleteUser(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -645,36 +903,36 @@ apiInstance.exportPlayers(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **exportPlayersRequestBody** | **ExportPlayersRequestBody**| | - **appId** | [**string**] | The app ID that you want to export devices from | defaults to undefined + **appId** | [**string**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined ### Return type -**ExportPlayersSuccessResponse** +**void** ### Authorization -[app_key](README.md#app_key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined ### 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) -# **getApp** -> App getApp() +# **endLiveActivity** +> void endLiveActivity() -View the details of a single OneSignal app +Stops a Live Activity ### Example @@ -686,12 +944,16 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetAppRequest = { - // string | An app id +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.getApp(body).then((data:any) => { +apiInstance.endLiveActivity(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -701,16 +963,18 @@ apiInstance.getApp(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | An app id | defaults to undefined + **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 -**App** +**void** ### Authorization -[user_key](README.md#user_key) +[app_key](README.md#app_key) ### HTTP request headers @@ -721,15 +985,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**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) -# **getApps** -> Array getApps() +# **exportPlayers** +> ExportPlayersSuccessResponse exportPlayers() -View the details of all of your current OneSignal apps +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. | ### Example @@ -741,29 +1005,44 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:any = {}; +let body:.DefaultApiExportPlayersRequest = { + // string | The app ID that you want to export devices from + appId: "app_id_example", + // ExportPlayersRequestBody (optional) + exportPlayersRequestBody: { + extra_fields: [ + "extra_fields_example", + ], + last_active_since: "last_active_since_example", + segment_name: "segment_name_example", + }, +}; -apiInstance.getApps(body).then((data:any) => { +apiInstance.exportPlayers(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exportPlayersRequestBody** | **ExportPlayersRequestBody**| | + **appId** | [**string**] | The app ID that you want to export devices from | defaults to undefined ### Return type -**Array** +**ExportPlayersSuccessResponse** ### Authorization -[user_key](README.md#user_key) +[app_key](README.md#app_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json @@ -775,8 +1054,346 @@ This endpoint does not need any parameter. [[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) -# **getNotification** -> NotificationWithMeta getNotification() +# **fetchAliases** +> UserIdentityResponse fetchAliases() + +Lists all Aliases for the User identified by :subscription_id. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiFetchAliasesRequest = { + // string + appId: "app_id_example", + // string + subscriptionId: "subscription_id_example", +}; + +apiInstance.fetchAliases(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**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined + + +### Return type + +**UserIdentityResponse** + +### 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 | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fetchUser** +> User fetchUser() + +Returns the User’s properties, Aliases, and Subscriptions. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiFetchUserRequest = { + // string + appId: "app_id_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", +}; + +apiInstance.fetchUser(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**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined + + +### Return type + +**User** + +### 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 | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fetchUserIdentity** +> InlineResponse200 fetchUserIdentity() + +Lists all Aliases for the User identified by (:alias_label, :alias_id). + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiFetchUserIdentityRequest = { + // string + appId: "app_id_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", +}; + +apiInstance.fetchUserIdentity(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**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined + + +### Return type + +**InlineResponse200** + +### 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 | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **getApp** +> App getApp() + +View the details of a single OneSignal app + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiGetAppRequest = { + // string | An app id + appId: "app_id_example", +}; + +apiInstance.getApp(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**] | An app id | defaults to undefined + + +### Return type + +**App** + +### Authorization + +[user_key](README.md#user_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getApps** +> Array getApps() + +View the details of all of your current OneSignal apps + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:any = {}; + +apiInstance.getApps(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**Array** + +### Authorization + +[user_key](README.md#user_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **getEligibleIams** +> InlineResponse2003 getEligibleIams() + +Manifest of In-App Messages the Subscription is eligible to display by the SDK. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiGetEligibleIamsRequest = { + // string + appId: "app_id_example", + // string + subscriptionId: "subscription_id_example", +}; + +apiInstance.getEligibleIams(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**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined + + +### Return type + +**InlineResponse2003** + +### 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 | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **getNotification** +> NotificationWithMeta getNotification() View the details of a single notification and outcomes associated with it @@ -797,7 +1414,199 @@ let body:.DefaultApiGetNotificationRequest = { notificationId: "notification_id_example", }; -apiInstance.getNotification(body).then((data:any) => { +apiInstance.getNotification(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**] | | defaults to undefined + **notificationId** | [**string**] | | defaults to undefined + + +### Return type + +**NotificationWithMeta** + +### 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 | +|-------------|-------------|------------------| +**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) + +# **getNotificationHistory** +> NotificationHistorySuccessResponse getNotificationHistory(getNotificationRequestBody) + +-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App\'s REST API Key, available in Keys & IDs. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiGetNotificationHistoryRequest = { + // string | The \"id\" of the message found in the Notification object + notificationId: "notification_id_example", + // GetNotificationRequestBody + getNotificationRequestBody: { + events: "sent", + email: "email_example", + app_id: "app_id_example", + }, +}; + +apiInstance.getNotificationHistory(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getNotificationRequestBody** | **GetNotificationRequestBody**| | + **notificationId** | [**string**] | The \"id\" of the message found in the Notification object | defaults to undefined + + +### Return type + +**NotificationHistorySuccessResponse** + +### 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) + +# **getNotifications** +> NotificationSlice getNotifications() + +View the details of multiple notifications + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiGetNotificationsRequest = { + // string | The app ID that you want to view notifications from + appId: "app_id_example", + // number | How many notifications to return. Max is 50. Default is 50. (optional) + limit: 1, + // number | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + offset: 1, + // 0 | 1 | 3 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + kind: 0, +}; + +apiInstance.getNotifications(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 app ID that you want to view notifications from | defaults to undefined + **limit** | [**number**] | How many notifications to return. Max is 50. Default is 50. | (optional) defaults to undefined + **offset** | [**number**] | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | (optional) defaults to undefined + **kind** | [**0 | 1 | 3**]**Array<0 | 1 | 3>** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | (optional) defaults to undefined + + +### Return type + +**NotificationSlice** + +### 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 | +|-------------|-------------|------------------| +**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) + +# **getOutcomes** +> OutcomesData getOutcomes() + +View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiGetOutcomesRequest = { + // string | The OneSignal App ID for your app. Available in Keys & IDs. + appId: "app_id_example", + // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + outcomeNames: "outcome_names_example", + // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + outcomeNames2: "outcome_names[]_example", + // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + outcomeTimeRange: "outcome_time_range_example", + // string | Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + outcomePlatforms: "outcome_platforms_example", + // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + outcomeAttribution: "outcome_attribution_example", +}; + +apiInstance.getOutcomes(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -807,13 +1616,17 @@ apiInstance.getNotification(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | | defaults to undefined - **notificationId** | [**string**] | | defaults to undefined + **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined + **outcomeNames** | [**string**] | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | defaults to undefined + **outcomeNames2** | [**string**] | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | (optional) defaults to undefined + **outcomeTimeRange** | [**string**] | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | (optional) defaults to undefined + **outcomePlatforms** | [**string**] | Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | (optional) defaults to undefined + **outcomeAttribution** | [**string**] | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | (optional) defaults to undefined ### Return type -**NotificationWithMeta** +**OutcomesData** ### Authorization @@ -833,10 +1646,10 @@ 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) -# **getNotificationHistory** -> NotificationHistorySuccessResponse getNotificationHistory(getNotificationRequestBody) +# **getPlayer** +> Player getPlayer() --> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App\'s REST API Key, available in Keys & IDs. +View the details of an existing device in one of your OneSignal apps ### Example @@ -848,18 +1661,16 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetNotificationHistoryRequest = { - // string | The \"id\" of the message found in the Notification object - notificationId: "notification_id_example", - // GetNotificationRequestBody - getNotificationRequestBody: { - events: "sent", - email: "email_example", - app_id: "app_id_example", - }, +let body:.DefaultApiGetPlayerRequest = { + // string | Your app_id for this device + appId: "app_id_example", + // string | Player\'s OneSignal ID + playerId: "player_id_example", + // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + emailAuthHash: "email_auth_hash_example", }; -apiInstance.getNotificationHistory(body).then((data:any) => { +apiInstance.getPlayer(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -869,13 +1680,14 @@ apiInstance.getNotificationHistory(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **getNotificationRequestBody** | **GetNotificationRequestBody**| | - **notificationId** | [**string**] | The \"id\" of the message found in the Notification object | defaults to undefined + **appId** | [**string**] | Your app_id for this device | defaults to undefined + **playerId** | [**string**] | Player\'s OneSignal ID | defaults to undefined + **emailAuthHash** | [**string**] | Email - Only required if you have enabled Identity Verification and device_type is email (11). | (optional) defaults to undefined ### Return type -**NotificationHistorySuccessResponse** +**Player** ### Authorization @@ -883,7 +1695,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -895,10 +1707,10 @@ 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) -# **getNotifications** -> NotificationSlice getNotifications() +# **getPlayers** +> PlayerSlice getPlayers() -View the details of multiple notifications +View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. ### Example @@ -910,18 +1722,16 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetNotificationsRequest = { - // string | The app ID that you want to view notifications from +let body:.DefaultApiGetPlayersRequest = { + // string | The app ID that you want to view players from appId: "app_id_example", - // number | How many notifications to return. Max is 50. Default is 50. (optional) + // number | How many devices to return. Max is 300. Default is 300 (optional) limit: 1, - // number | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + // number | Result offset. Default is 0. Results are sorted by id; (optional) offset: 1, - // 0 | 1 | 3 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - kind: 0, }; -apiInstance.getNotifications(body).then((data:any) => { +apiInstance.getPlayers(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -931,15 +1741,14 @@ apiInstance.getNotifications(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | The app ID that you want to view notifications from | defaults to undefined - **limit** | [**number**] | How many notifications to return. Max is 50. Default is 50. | (optional) defaults to undefined - **offset** | [**number**] | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | (optional) defaults to undefined - **kind** | [**0 | 1 | 3**]**Array<0 | 1 | 3>** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | (optional) defaults to undefined + **appId** | [**string**] | The app ID that you want to view players from | defaults to undefined + **limit** | [**number**] | How many devices to return. Max is 300. Default is 300 | (optional) defaults to undefined + **offset** | [**number**] | Result offset. Default is 0. Results are sorted by id; | (optional) defaults to undefined ### Return type -**NotificationSlice** +**PlayerSlice** ### Authorization @@ -959,10 +1768,10 @@ 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) -# **getOutcomes** -> OutcomesData getOutcomes() +# **identifyUserByAlias** +> InlineResponse200 identifyUserByAlias(userIdentityRequestBody) -View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). ### Example @@ -974,22 +1783,20 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetOutcomesRequest = { - // string | The OneSignal App ID for your app. Available in Keys & IDs. +let body:.DefaultApiIdentifyUserByAliasRequest = { + // string appId: "app_id_example", - // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum - outcomeNames: "outcome_names_example", - // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - outcomeNames2: "outcome_names[]_example", - // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - outcomeTimeRange: "outcome_time_range_example", - // string | Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - outcomePlatforms: "outcome_platforms_example", - // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) - outcomeAttribution: "outcome_attribution_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", + // UserIdentityRequestBody + userIdentityRequestBody: { + identity: {}, + }, }; -apiInstance.getOutcomes(body).then((data:any) => { +apiInstance.identifyUserByAlias(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -999,17 +1806,15 @@ apiInstance.getOutcomes(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined - **outcomeNames** | [**string**] | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | defaults to undefined - **outcomeNames2** | [**string**] | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | (optional) defaults to undefined - **outcomeTimeRange** | [**string**] | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | (optional) defaults to undefined - **outcomePlatforms** | [**string**] | Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | (optional) defaults to undefined - **outcomeAttribution** | [**string**] | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | (optional) defaults to undefined + **userIdentityRequestBody** | **UserIdentityRequestBody**| | + **appId** | [**string**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined ### Return type -**OutcomesData** +**InlineResponse200** ### Authorization @@ -1017,7 +1822,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json @@ -1025,14 +1830,14 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**400** | Bad Request | - | +**409** | Conflict | - | [[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) -# **getPlayer** -> Player getPlayer() +# **identifyUserBySubscriptionId** +> UserIdentityResponse identifyUserBySubscriptionId(userIdentityRequestBody) -View the details of an existing device in one of your OneSignal apps +Upserts one or more Aliases for the User identified by :subscription_id. ### Example @@ -1044,16 +1849,18 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetPlayerRequest = { - // string | Your app_id for this device +let body:.DefaultApiIdentifyUserBySubscriptionIdRequest = { + // string appId: "app_id_example", - // string | Player\'s OneSignal ID - playerId: "player_id_example", - // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) - emailAuthHash: "email_auth_hash_example", + // string + subscriptionId: "subscription_id_example", + // UserIdentityRequestBody + userIdentityRequestBody: { + identity: {}, + }, }; -apiInstance.getPlayer(body).then((data:any) => { +apiInstance.identifyUserBySubscriptionId(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -1063,14 +1870,14 @@ apiInstance.getPlayer(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | Your app_id for this device | defaults to undefined - **playerId** | [**string**] | Player\'s OneSignal ID | defaults to undefined - **emailAuthHash** | [**string**] | Email - Only required if you have enabled Identity Verification and device_type is email (11). | (optional) defaults to undefined + **userIdentityRequestBody** | **UserIdentityRequestBody**| | + **appId** | [**string**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined ### Return type -**Player** +**UserIdentityResponse** ### Authorization @@ -1078,7 +1885,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json @@ -1086,14 +1893,14 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**400** | Bad Request | - | +**409** | Conflict | - | [[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) -# **getPlayers** -> PlayerSlice getPlayers() +# **transferSubscription** +> UserIdentityResponse transferSubscription(transferSubscriptionRequestBody) -View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. +Transfers this Subscription to the User identified by the identity in the payload. ### Example @@ -1105,16 +1912,18 @@ import * as fs from 'fs'; const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); -let body:.DefaultApiGetPlayersRequest = { - // string | The app ID that you want to view players from +let body:.DefaultApiTransferSubscriptionRequest = { + // string appId: "app_id_example", - // number | How many devices to return. Max is 300. Default is 300 (optional) - limit: 1, - // number | Result offset. Default is 0. Results are sorted by id; (optional) - offset: 1, + // string + subscriptionId: "subscription_id_example", + // TransferSubscriptionRequestBody + transferSubscriptionRequestBody: { + identity: {}, + }, }; -apiInstance.getPlayers(body).then((data:any) => { +apiInstance.transferSubscription(body).then((data:any) => { console.log('API called successfully. Returned data: ' + data); }).catch((error:any) => console.error(error)); ``` @@ -1124,14 +1933,14 @@ apiInstance.getPlayers(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | [**string**] | The app ID that you want to view players from | defaults to undefined - **limit** | [**number**] | How many devices to return. Max is 300. Default is 300 | (optional) defaults to undefined - **offset** | [**number**] | Result offset. Default is 0. Results are sorted by id; | (optional) defaults to undefined + **transferSubscriptionRequestBody** | **TransferSubscriptionRequestBody**| | + **appId** | [**string**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined ### Return type -**PlayerSlice** +**UserIdentityResponse** ### Authorization @@ -1139,7 +1948,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json @@ -1147,7 +1956,6 @@ 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) @@ -1339,7 +2147,7 @@ let body:.DefaultApiUpdatePlayerRequest = { last_active: 1, notification_types: 1, test_type: 1, - _long: 3.14, + long: 3.14, lat: 3.14, country: "country_example", }, @@ -1440,7 +2248,185 @@ 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) + +# **updateSubscription** +> void updateSubscription(updateSubscriptionRequestBody) + +Updates an existing Subscription’s properties. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiUpdateSubscriptionRequest = { + // string + appId: "app_id_example", + // string + subscriptionId: "subscription_id_example", + // UpdateSubscriptionRequestBody + updateSubscriptionRequestBody: { + subscription: { + id: "id_example", + type: "iOSPush", + token: "token_example", + enabled: true, + notification_types: 3.14, + session_time: 3.14, + session_count: 3.14, + sdk: "sdk_example", + device_model: "device_model_example", + device_os: "device_os_example", + rooted: true, + test_type: 3.14, + app_version: "app_version_example", + net_type: 3.14, + carrier: "carrier_example", + web_auth: "web_auth_example", + web_p256: "web_p256_example", + }, + }, +}; + +apiInstance.updateSubscription(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateSubscriptionRequestBody** | **UpdateSubscriptionRequestBody**| | + **appId** | [**string**] | | defaults to undefined + **subscriptionId** | [**string**] | | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[app_key](README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | ACCEPTED | - | + +[[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) + +# **updateUser** +> InlineResponse202 updateUser(updateUserRequest) + +Updates an existing User’s properties. + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:.DefaultApiUpdateUserRequest = { + // string + appId: "app_id_example", + // string + aliasLabel: "alias_label_example", + // string + aliasId: "alias_id_example", + // UpdateUserRequest + updateUserRequest: { + properties: { + tags: {}, + language: "language_example", + timezone_id: "timezone_id_example", + lat: 3.14, + long: 3.14, + country: "country_example", + first_active: 3.14, + last_active: 3.14, + amount_spent: 3.14, + purchases: [ + { + sku: "sku_example", + amount: "amount_example", + iso: "iso_example", + }, + ], + ip: "ip_example", + }, + refresh_device_metadata: false, + deltas: { + session_time: 3.14, + session_count: 3.14, + amount_spent: 3.14, + purchases: [ + { + sku: "sku_example", + amount: "amount_example", + iso: "iso_example", + }, + ], + }, + }, + // string (optional) + subscriptionId: "subscription_id_example", +}; + +apiInstance.updateUser(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateUserRequest** | **UpdateUserRequest**| | + **appId** | [**string**] | | defaults to undefined + **aliasLabel** | [**string**] | | defaults to undefined + **aliasId** | [**string**] | | defaults to undefined + **subscriptionId** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**InlineResponse202** + +### 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 | +|-------------|-------------|------------------| +**202** | ACCEPTED | - | [[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 4efa0e0..128d762 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,154 @@ const subscriptionId = ''; // player id await api.endLiveActivity('', '', subscriptionId); ``` +### Subscription types +* iOSPush +* AndroidPush +* FireOSPush +* ChromeExtensionPush +* ChromePush +* WindowsPush +* SafariLegacyPush +* FirefoxPush +* macOSPush +* HuaweiPush +* SafariPush +* Email +* SMS + +## Users +### Creating a OneSignal User +```js +const user = new OneSignal.User(); + +const aliasLabel = ''; +const aliasId = ''; +const subscriptionToken = ''; + +user.identity = { + [aliasLabel]: aliasId, +}; + +user.subscriptions = [ + { + type: "iOSPush", + token: subscriptionToken, + } +]; + +const createdUser = await api.createUser('', user); +assert(createdUser.identity!['onesignal_id'] != null); +``` + +### Getting a user by `onesignal_id` +```js +const oneisgnalAliasLabel = "onesignal_id"; +const onesignalAliasId = createdUser.identity!['onesignal_id']; + +const fetchedUser = await api.fetchUser('', oneisgnalAliasLabel, onesignalAliasId); +``` + +### Getting a user by an alias +```js +const fetchedUser = await api.fetchUser('', alias_label, alias_id); +``` + +### Updating a user +```js +const updateUserRequest: UpdateUserRequest = { + properties: { + language: 'fr' + } +}; + +const updatedUser = await api.updateUser('', aliasLabel, aliasId, updateUserRequest); +``` + +### Deleting a user +```js +await api.deleteUser('', aliasLabel, aliasId); +``` + +## Subscriptions +### Creating a subscription for existing user +```js +const createSubscriptionRequestBody: CreateSubscriptionRequestBody = { + subscription: { + type: "AndroidPush", + token: '', + } +}; + +const response = await api.createSubscription('', '', '', createSubscriptionRequestBody); +``` + +### Updating a subscription +```js +const updateSubscriptionRequestBody: UpdateSubscriptionRequestBody = { + subscription: { + type: "iOSPush", + token: '', + } +}; + +await api.updateSubscription('', '', updateSubscriptionRequestBody); +``` + +### Deleting a subscription +```js +await api.deleteSubscription('', ''); +``` + +### Transfer subscription ownership +Transfers the subscription from one user to another. +```js +// Setting the user for transfering the subscription to. User is identyfied by an IdentityObject. +const transferSubscriptionRequestBody: TransferSubscriptionRequestBody = { + identity: otherUserIdentityObject +}; + +const transferResponse = await api.transferSubscription('', '', transferSubscriptionRequestBody); +``` + +## Aliases +### Fetching aliases for a user +```js +const fetchResponse = await api.fetchAliases('', ''); +``` + +### Fetching user identity +```js +const fetchResponse = await api.fetchUserIdentity('', '', ''); +``` +### Identifying user by alias +```js +const userIdentityRequestBody: UserIdentityRequestBody = { + identity: { + ['']: '' + } +}; + +const identifyResponse = await api.identifyUserByAlias('', + '', + '', + userIdentityRequestBody); +``` + +### Identifying user by subscription id +```js +const userIdentityRequestBody: UserIdentityRequestBody = { + identity: { + ['']: '' + } +}; + +const identifyResponse = await api.identifyUserBySubscriptionId('', '', userIdentityRequestBody); +``` + +### Deleting an alias +```js +await api.deleteAlias('', '', '', ''); +``` ## Author * Website: https://onesignal.com diff --git a/apis/DefaultApi.ts b/apis/DefaultApi.ts index b318e1b..eff3902 100644 --- a/apis/DefaultApi.ts +++ b/apis/DefaultApi.ts @@ -18,6 +18,8 @@ import { CreateNotificationSuccessResponse } from '../models/CreateNotificationS import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; +import { CreateSubscriptionRequestBody } from '../models/CreateSubscriptionRequestBody'; +import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; @@ -25,6 +27,11 @@ import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResp import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody'; import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse'; import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody'; +import { IdentifyUserConflictResponse } from '../models/IdentifyUserConflictResponse'; +import { InlineResponse200 } from '../models/InlineResponse200'; +import { InlineResponse2003 } from '../models/InlineResponse2003'; +import { InlineResponse201 } from '../models/InlineResponse201'; +import { InlineResponse202 } from '../models/InlineResponse202'; import { Notification } from '../models/Notification'; import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse'; import { NotificationSlice } from '../models/NotificationSlice'; @@ -33,11 +40,17 @@ import { OutcomesData } from '../models/OutcomesData'; import { Player } from '../models/Player'; import { PlayerSlice } from '../models/PlayerSlice'; import { Segment } from '../models/Segment'; +import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody'; 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'; +import { UpdateSubscriptionRequestBody } from '../models/UpdateSubscriptionRequestBody'; +import { UpdateUserRequest } from '../models/UpdateUserRequest'; +import { User } from '../models/User'; +import { UserIdentityRequestBody } from '../models/UserIdentityRequestBody'; +import { UserIdentityResponse } from '../models/UserIdentityResponse'; /** * no description @@ -353,6 +366,193 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + * @param appId + * @param aliasLabel + * @param aliasId + * @param createSubscriptionRequestBody + */ + public async createSubscription(appId: string, aliasLabel: string, aliasId: string, createSubscriptionRequestBody: CreateSubscriptionRequestBody, _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", "createSubscription", "appId"); + } + + + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "createSubscription", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "createSubscription", "aliasId"); + } + + + // verify required parameter 'createSubscriptionRequestBody' is not null or undefined + if (createSubscriptionRequestBody === null || createSubscriptionRequestBody === undefined) { + throw new RequiredError("DefaultApi", "createSubscription", "createSubscriptionRequestBody"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); + + // 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(createSubscriptionRequestBody, "CreateSubscriptionRequestBody", ""), + 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; + } + + /** + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + * @param appId + * @param user + */ + public async createUser(appId: string, user: User, _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", "createUser", "appId"); + } + + + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError("DefaultApi", "createUser", "user"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/users' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))); + + // 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(user, "User", ""), + 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; + } + + /** + * Deletes an alias by alias label + * @param appId + * @param aliasLabel + * @param aliasId + * @param aliasLabelToDelete + */ + public async deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: 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", "deleteAlias", "appId"); + } + + + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "deleteAlias", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "deleteAlias", "aliasId"); + } + + + // verify required parameter 'aliasLabelToDelete' is not null or undefined + if (aliasLabelToDelete === null || aliasLabelToDelete === undefined) { + throw new RequiredError("DefaultApi", "deleteAlias", "aliasLabelToDelete"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))) + .replace('{' + 'alias_label_to_delete' + '}', encodeURIComponent(String(aliasLabelToDelete))); + + // 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; + } + /** * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. * Delete a user record @@ -409,28 +609,270 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { * @param appId The OneSignal App ID for your app. Available in Keys & IDs. * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. */ - public async deleteSegments(appId: string, segmentId: string, _options?: Configuration): Promise { + public async deleteSegments(appId: string, segmentId: 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", "deleteSegments", "appId"); + } + + + // verify required parameter 'segmentId' is not null or undefined + if (segmentId === null || segmentId === undefined) { + throw new RequiredError("DefaultApi", "deleteSegments", "segmentId"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/segments/{segment_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'segment_id' + '}', encodeURIComponent(String(segmentId))); + + // 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; + } + + /** + * Deletes the Subscription. + * @param appId + * @param subscriptionId + */ + public async deleteSubscription(appId: 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", "deleteSubscription", "appId"); + } + + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "deleteSubscription", "subscriptionId"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .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; + } + + /** + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId + * @param aliasLabel + * @param aliasId + */ + public async deleteUser(appId: string, aliasLabel: string, aliasId: 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", "deleteUser", "appId"); + } + + + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "deleteUser", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "deleteUser", "aliasId"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + 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 + * @param appId The app ID that you want to export devices from + * @param exportPlayersRequestBody + */ + public async exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _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", "exportPlayers", "appId"); + } + + + + // Path Params + const localVarPath = '/players/csv_export?app_id={app_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))); + + // 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(exportPlayersRequestBody, "ExportPlayersRequestBody", ""), + 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; + } + + /** + * Lists all Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + */ + public async fetchAliases(appId: 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", "deleteSegments", "appId"); + throw new RequiredError("DefaultApi", "fetchAliases", "appId"); } - // verify required parameter 'segmentId' is not null or undefined - if (segmentId === null || segmentId === undefined) { - throw new RequiredError("DefaultApi", "deleteSegments", "segmentId"); + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "fetchAliases", "subscriptionId"); } // Path Params - const localVarPath = '/apps/{app_id}/segments/{segment_id}' + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity' .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) - .replace('{' + 'segment_id' + '}', encodeURIComponent(String(segmentId))); + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") @@ -450,41 +892,40 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { } /** - * 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 + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId + * @param aliasLabel + * @param aliasId */ - public async endLiveActivity(appId: string, activityId: string, subscriptionId: string, _options?: Configuration): Promise { + public async fetchUser(appId: string, aliasLabel: string, aliasId: 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"); + throw new RequiredError("DefaultApi", "fetchUser", "appId"); } - // verify required parameter 'activityId' is not null or undefined - if (activityId === null || activityId === undefined) { - throw new RequiredError("DefaultApi", "endLiveActivity", "activityId"); + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "fetchUser", "aliasLabel"); } - // verify required parameter 'subscriptionId' is not null or undefined - if (subscriptionId === null || subscriptionId === undefined) { - throw new RequiredError("DefaultApi", "endLiveActivity", "subscriptionId"); + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "fetchUser", "aliasId"); } // Path Params - const localVarPath = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}' + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}' .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) - .replace('{' + 'activity_id' + '}', encodeURIComponent(String(activityId))) - .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") @@ -504,41 +945,43 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { } /** - * 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 - * @param appId The app ID that you want to export devices from - * @param exportPlayersRequestBody + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId */ - public async exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _options?: Configuration): Promise { + public async fetchUserIdentity(appId: string, aliasLabel: string, aliasId: 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", "exportPlayers", "appId"); + throw new RequiredError("DefaultApi", "fetchUserIdentity", "appId"); } + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "fetchUserIdentity", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "fetchUserIdentity", "aliasId"); + } + // Path Params - const localVarPath = '/players/csv_export?app_id={app_id}' - .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))); + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); 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(exportPlayersRequestBody, "ExportPlayersRequestBody", ""), - contentType - ); - requestContext.setBody(serializedBody); - let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["app_key"] @@ -622,6 +1065,51 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Manifest of In-App Messages the Subscription is eligible to display by the SDK. + * @param appId + * @param subscriptionId + */ + public async getEligibleIams(appId: 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", "getEligibleIams", "appId"); + } + + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "getEligibleIams", "subscriptionId"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/iams' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + 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; + } + /** * View the details of a single notification and outcomes associated with it * View notification @@ -876,40 +1364,230 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { * @param playerId Player\'s OneSignal ID * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). */ - public async getPlayer(appId: string, playerId: string, emailAuthHash?: string, _options?: Configuration): Promise { + public async getPlayer(appId: string, playerId: string, emailAuthHash?: 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", "getPlayer", "appId"); + } + + + // verify required parameter 'playerId' is not null or undefined + if (playerId === null || playerId === undefined) { + throw new RequiredError("DefaultApi", "getPlayer", "playerId"); + } + + + + // Path Params + const localVarPath = '/players/{player_id}' + .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (appId !== undefined) { + requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", "")); + } + + // Query Params + if (emailAuthHash !== undefined) { + requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(emailAuthHash, "string", "")); + } + + + 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; + } + + /** + * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + * View devices + * @param appId The app ID that you want to view players from + * @param limit How many devices to return. Max is 300. Default is 300 + * @param offset Result offset. Default is 0. Results are sorted by id; + */ + public async getPlayers(appId: string, limit?: number, offset?: number, _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", "getPlayers", "appId"); + } + + + + + // Path Params + const localVarPath = '/players'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (appId !== undefined) { + requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", "")); + } + + // Query Params + if (limit !== undefined) { + requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); + } + + // Query Params + if (offset !== undefined) { + requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", "")); + } + + + 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; + } + + /** + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId + * @param userIdentityRequestBody + */ + public async identifyUserByAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityRequestBody: UserIdentityRequestBody, _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", "identifyUserByAlias", "appId"); + } + + + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "identifyUserByAlias", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "identifyUserByAlias", "aliasId"); + } + + + // verify required parameter 'userIdentityRequestBody' is not null or undefined + if (userIdentityRequestBody === null || userIdentityRequestBody === undefined) { + throw new RequiredError("DefaultApi", "identifyUserByAlias", "userIdentityRequestBody"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + 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(userIdentityRequestBody, "UserIdentityRequestBody", ""), + 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; + } + + /** + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + * @param userIdentityRequestBody + */ + public async identifyUserBySubscriptionId(appId: string, subscriptionId: string, userIdentityRequestBody: UserIdentityRequestBody, _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", "getPlayer", "appId"); + throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "appId"); } - // verify required parameter 'playerId' is not null or undefined - if (playerId === null || playerId === undefined) { - throw new RequiredError("DefaultApi", "getPlayer", "playerId"); + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "subscriptionId"); } + // verify required parameter 'userIdentityRequestBody' is not null or undefined + if (userIdentityRequestBody === null || userIdentityRequestBody === undefined) { + throw new RequiredError("DefaultApi", "identifyUserBySubscriptionId", "userIdentityRequestBody"); + } + // Path Params - const localVarPath = '/players/{player_id}' - .replace('{' + 'player_id' + '}', encodeURIComponent(String(playerId))); + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - // Query Params - if (appId !== undefined) { - requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", "")); - } - - // Query Params - if (emailAuthHash !== undefined) { - requestContext.setQueryParam("email_auth_hash", ObjectSerializer.serialize(emailAuthHash, "string", "")); - } + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(userIdentityRequestBody, "UserIdentityRequestBody", ""), + contentType + ); + requestContext.setBody(serializedBody); let authMethod: SecurityAuthentication | undefined; // Apply auth methods @@ -927,45 +1605,52 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { } /** - * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - * View devices - * @param appId The app ID that you want to view players from - * @param limit How many devices to return. Max is 300. Default is 300 - * @param offset Result offset. Default is 0. Results are sorted by id; + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId + * @param subscriptionId + * @param transferSubscriptionRequestBody */ - public async getPlayers(appId: string, limit?: number, offset?: number, _options?: Configuration): Promise { + public async transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _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", "getPlayers", "appId"); + throw new RequiredError("DefaultApi", "transferSubscription", "appId"); + } + + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "transferSubscription", "subscriptionId"); } + // verify required parameter 'transferSubscriptionRequestBody' is not null or undefined + if (transferSubscriptionRequestBody === null || transferSubscriptionRequestBody === undefined) { + throw new RequiredError("DefaultApi", "transferSubscription", "transferSubscriptionRequestBody"); + } // Path Params - const localVarPath = '/players'; + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}/owner' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - // Query Params - if (appId !== undefined) { - requestContext.setQueryParam("app_id", ObjectSerializer.serialize(appId, "string", "")); - } - - // Query Params - if (limit !== undefined) { - requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); - } - - // Query Params - if (offset !== undefined) { - requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", "")); - } + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(transferSubscriptionRequestBody, "TransferSubscriptionRequestBody", ""), + contentType + ); + requestContext.setBody(serializedBody); let authMethod: SecurityAuthentication | undefined; // Apply auth methods @@ -1217,6 +1902,145 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Updates an existing Subscription’s properties. + * @param appId + * @param subscriptionId + * @param updateSubscriptionRequestBody + */ + public async updateSubscription(appId: string, subscriptionId: string, updateSubscriptionRequestBody: UpdateSubscriptionRequestBody, _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", "updateSubscription", "appId"); + } + + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("DefaultApi", "updateSubscription", "subscriptionId"); + } + + + // verify required parameter 'updateSubscriptionRequestBody' is not null or undefined + if (updateSubscriptionRequestBody === null || updateSubscriptionRequestBody === undefined) { + throw new RequiredError("DefaultApi", "updateSubscription", "updateSubscriptionRequestBody"); + } + + + // Path Params + const localVarPath = '/apps/{app_id}/subscriptions/{subscription_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'subscription_id' + '}', encodeURIComponent(String(subscriptionId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + 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(updateSubscriptionRequestBody, "UpdateSubscriptionRequestBody", ""), + 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; + } + + /** + * Updates an existing User’s properties. + * @param appId + * @param aliasLabel + * @param aliasId + * @param updateUserRequest + * @param subscriptionId + */ + public async updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, 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", "updateUser", "appId"); + } + + + // verify required parameter 'aliasLabel' is not null or undefined + if (aliasLabel === null || aliasLabel === undefined) { + throw new RequiredError("DefaultApi", "updateUser", "aliasLabel"); + } + + + // verify required parameter 'aliasId' is not null or undefined + if (aliasId === null || aliasId === undefined) { + throw new RequiredError("DefaultApi", "updateUser", "aliasId"); + } + + + // verify required parameter 'updateUserRequest' is not null or undefined + if (updateUserRequest === null || updateUserRequest === undefined) { + throw new RequiredError("DefaultApi", "updateUser", "updateUserRequest"); + } + + + + // Path Params + const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}' + .replace('{' + 'app_id' + '}', encodeURIComponent(String(appId))) + .replace('{' + 'alias_label' + '}', encodeURIComponent(String(aliasLabel))) + .replace('{' + 'alias_id' + '}', encodeURIComponent(String(aliasId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Header Params + requestContext.setHeaderParam("subscription_id", ObjectSerializer.serialize(subscriptionId, "string", "")); + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(updateUserRequest, "UpdateUserRequest", ""), + 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; + } + } export class DefaultApiResponseProcessor { @@ -1423,17 +2247,125 @@ export class DefaultApiResponseProcessor { if (isCodeInRange("409", response.httpStatusCode)) { const body: CreateSegmentConflictResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CreateSegmentConflictResponse", "" - ) as CreateSegmentConflictResponse; - throw new ApiException(409, "Conflict", body, response.headers); + "CreateSegmentConflictResponse", "" + ) as CreateSegmentConflictResponse; + throw new ApiException(409, "Conflict", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateSegmentSuccessResponse", "" + ) as CreateSegmentSuccessResponse; + 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 + * + * @params response Response returned by the server for a request to createSubscription + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSubscription(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: InlineResponse201 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse201", "" + ) as InlineResponse201; + return body; + } + if (isCodeInRange("202", response.httpStatusCode)) { + const body: InlineResponse201 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse201", "" + ) as InlineResponse201; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: InlineResponse201 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse201", "" + ) as InlineResponse201; + 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 + * + * @params response Response returned by the server for a request to createUser + * @throws ApiException if the response code was not in [200, 299] + */ + public async createUser(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: User = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "User", "" + ) as User; + return body; + } + if (isCodeInRange("202", response.httpStatusCode)) { + const body: User = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "User", "" + ) as User; + return body; + } + if (isCodeInRange("409", response.httpStatusCode)) { + const body: CreateUserConflictResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateUserConflictResponse", "" + ) as CreateUserConflictResponse; + throw new ApiException(409, "Multiple User Identity Conflict", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: User = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "User", "" + ) as User; + 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 + * + * @params response Response returned by the server for a request to deleteAlias + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteAlias(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: InlineResponse200 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse200", "" + ) as InlineResponse200; + return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: CreateSegmentSuccessResponse = ObjectSerializer.deserialize( + const body: InlineResponse200 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CreateSegmentSuccessResponse", "" - ) as CreateSegmentSuccessResponse; + "InlineResponse200", "" + ) as InlineResponse200; return body; } @@ -1526,6 +2458,56 @@ 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 deleteSubscription + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteSubscription(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("202", response.httpStatusCode)) { + return; + } + + // 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 + * + * @params response Response returned by the server for a request to deleteUser + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteUser(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + return; + } + + // 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 @@ -1594,6 +2576,93 @@ 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 fetchAliases + * @throws ApiException if the response code was not in [200, 299] + */ + public async fetchAliases(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + 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 + * + * @params response Response returned by the server for a request to fetchUser + * @throws ApiException if the response code was not in [200, 299] + */ + public async fetchUser(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: User = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "User", "" + ) as User; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: User = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "User", "" + ) as User; + 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 + * + * @params response Response returned by the server for a request to fetchUserIdentity + * @throws ApiException if the response code was not in [200, 299] + */ + public async fetchUserIdentity(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: InlineResponse200 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse200", "" + ) as InlineResponse200; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: InlineResponse200 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse200", "" + ) as InlineResponse200; + 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 @@ -1666,6 +2735,35 @@ 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 getEligibleIams + * @throws ApiException if the response code was not in [200, 299] + */ + public async getEligibleIams(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: InlineResponse2003 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse2003", "" + ) as InlineResponse2003; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: InlineResponse2003 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse2003", "" + ) as InlineResponse2003; + 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 @@ -1882,6 +2980,107 @@ 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 identifyUserByAlias + * @throws ApiException if the response code was not in [200, 299] + */ + public async identifyUserByAlias(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: InlineResponse200 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse200", "" + ) as InlineResponse200; + return body; + } + if (isCodeInRange("409", response.httpStatusCode)) { + const body: IdentifyUserConflictResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IdentifyUserConflictResponse", "" + ) as IdentifyUserConflictResponse; + throw new ApiException(409, "Conflict", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: InlineResponse200 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse200", "" + ) as InlineResponse200; + 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 + * + * @params response Response returned by the server for a request to identifyUserBySubscriptionId + * @throws ApiException if the response code was not in [200, 299] + */ + public async identifyUserBySubscriptionId(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + return body; + } + if (isCodeInRange("409", response.httpStatusCode)) { + const body: IdentifyUserConflictResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IdentifyUserConflictResponse", "" + ) as IdentifyUserConflictResponse; + throw new ApiException(409, "Conflict", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + 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 + * + * @params response Response returned by the server for a request to transferSubscription + * @throws ApiException if the response code was not in [200, 299] + */ + public async transferSubscription(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UserIdentityResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UserIdentityResponse", "" + ) as UserIdentityResponse; + 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 @@ -2006,13 +3205,6 @@ 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) { @@ -2026,4 +3218,58 @@ 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 updateSubscription + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateSubscription(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("202", response.httpStatusCode)) { + return; + } + + // 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 + * + * @params response Response returned by the server for a request to updateUser + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateUser(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("202", response.httpStatusCode)) { + const body: InlineResponse202 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse202", "" + ) as InlineResponse202; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: InlineResponse202 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "InlineResponse202", "" + ) as InlineResponse202; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + } diff --git a/models/App.ts b/models/App.ts index 885c527..a05a32e 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/BadRequestError.ts b/models/BadRequestError.ts index 167656f..43fde26 100644 --- a/models/BadRequestError.ts +++ b/models/BadRequestError.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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotification.ts b/models/BasicNotification.ts index 8023438..ac99fbf 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ @@ -11,6 +11,7 @@ import { BasicNotificationAllOfAndroidBackgroundLayout } from './BasicNotificati import { Button } from './Button'; import { Filter } from './Filter'; import { NotificationTarget } from './NotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { StringMap } from './StringMap'; import { HttpFile } from '../http/http'; @@ -63,6 +64,8 @@ export class BasicNotification { * Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call */ 'include_android_reg_ids'?: Array; + 'include_aliases'?: PlayerNotificationTargetIncludeAliases; + 'target_channel'?: BasicNotificationTargetChannelEnum; 'id'?: string; 'value'?: number; /** @@ -471,6 +474,18 @@ export class BasicNotification { "type": "Array", "format": "" }, + { + "name": "include_aliases", + "baseName": "include_aliases", + "type": "PlayerNotificationTargetIncludeAliases", + "format": "" + }, + { + "name": "target_channel", + "baseName": "target_channel", + "type": "BasicNotificationTargetChannelEnum", + "format": "" + }, { "name": "id", "baseName": "id", @@ -1015,5 +1030,6 @@ export class BasicNotification { } +export type BasicNotificationTargetChannelEnum = "push" | "email" | "sms" ; export type BasicNotificationAggregationEnum = "sum" | "count" ; diff --git a/models/BasicNotificationAllOf.ts b/models/BasicNotificationAllOf.ts index f95f7d9..070da6a 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotificationAllOfAndroidBackgroundLayout.ts b/models/BasicNotificationAllOfAndroidBackgroundLayout.ts index 2e3243f..374d08d 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/BeginLiveActivityRequest.ts b/models/BeginLiveActivityRequest.ts index d8cd263..c5a6fa9 100644 --- a/models/BeginLiveActivityRequest.ts +++ b/models/BeginLiveActivityRequest.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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/Button.ts b/models/Button.ts index a167a38..acb93bb 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CancelNotificationSuccessResponse.ts b/models/CancelNotificationSuccessResponse.ts index d40149d..aed48f2 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateNotificationSuccessResponse.ts b/models/CreateNotificationSuccessResponse.ts index 9e952a5..0e38f5e 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreatePlayerSuccessResponse.ts b/models/CreatePlayerSuccessResponse.ts index 073e6c8..3b86bde 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentConflictResponse.ts b/models/CreateSegmentConflictResponse.ts index 8c3ee0f..88efd9a 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentSuccessResponse.ts b/models/CreateSegmentSuccessResponse.ts index 2fa0dac..6f04de4 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSubscriptionRequestBody.ts b/models/CreateSubscriptionRequestBody.ts new file mode 100644 index 0000000..885343c --- /dev/null +++ b/models/CreateSubscriptionRequestBody.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { SubscriptionObject } from './SubscriptionObject'; +import { HttpFile } from '../http/http'; + +export class CreateSubscriptionRequestBody { + 'subscription'?: SubscriptionObject; + 'retain_previous_owner'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "subscription", + "baseName": "subscription", + "type": "SubscriptionObject", + "format": "" + }, + { + "name": "retain_previous_owner", + "baseName": "retain_previous_owner", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateSubscriptionRequestBody.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/CreateUserConflictResponse.ts b/models/CreateUserConflictResponse.ts new file mode 100644 index 0000000..5783428 --- /dev/null +++ b/models/CreateUserConflictResponse.ts @@ -0,0 +1,32 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { CreateUserConflictResponseErrorsInner } from './CreateUserConflictResponseErrorsInner'; +import { HttpFile } from '../http/http'; + +export class CreateUserConflictResponse { + '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 CreateUserConflictResponse.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/CreateUserConflictResponseErrorsInner.ts b/models/CreateUserConflictResponseErrorsInner.ts new file mode 100644 index 0000000..fbf991a --- /dev/null +++ b/models/CreateUserConflictResponseErrorsInner.ts @@ -0,0 +1,46 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { CreateUserConflictResponseErrorsItemsMeta } from './CreateUserConflictResponseErrorsItemsMeta'; +import { HttpFile } from '../http/http'; + +export class CreateUserConflictResponseErrorsInner { + 'code'?: string; + 'title'?: string; + 'meta'?: CreateUserConflictResponseErrorsItemsMeta; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "meta", + "baseName": "meta", + "type": "CreateUserConflictResponseErrorsItemsMeta", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateUserConflictResponseErrorsInner.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/CreateUserConflictResponseErrorsItemsMeta.ts b/models/CreateUserConflictResponseErrorsItemsMeta.ts new file mode 100644 index 0000000..15dad35 --- /dev/null +++ b/models/CreateUserConflictResponseErrorsItemsMeta.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class CreateUserConflictResponseErrorsItemsMeta { + 'conflicting_aliases'?: object; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "conflicting_aliases", + "baseName": "conflicting_aliases", + "type": "object", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateUserConflictResponseErrorsItemsMeta.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/DeletePlayerNotFoundResponse.ts b/models/DeletePlayerNotFoundResponse.ts index fa158d8..dbd5865 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/DeletePlayerSuccessResponse.ts b/models/DeletePlayerSuccessResponse.ts index 1427eae..14eccdc 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/DeleteSegmentNotFoundResponse.ts b/models/DeleteSegmentNotFoundResponse.ts index 141450b..6a41e5a 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/DeleteSegmentSuccessResponse.ts b/models/DeleteSegmentSuccessResponse.ts index fdb1863..1b8bc4b 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/DeliveryData.ts b/models/DeliveryData.ts index 5692f1a..66bac5e 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/ExportPlayersRequestBody.ts b/models/ExportPlayersRequestBody.ts index 2d7fe98..f0348a3 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/ExportPlayersSuccessResponse.ts b/models/ExportPlayersSuccessResponse.ts index 7040266..5f36a22 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/Filter.ts b/models/Filter.ts index e3b9a16..a6c8398 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/FilterExpressions.ts b/models/FilterExpressions.ts index 7a8adab..bdeaa36 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/GetNotificationRequestBody.ts b/models/GetNotificationRequestBody.ts index b7f6cd7..acef746 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/IdentifyUserConflictResponse.ts b/models/IdentifyUserConflictResponse.ts new file mode 100644 index 0000000..ce2b8d1 --- /dev/null +++ b/models/IdentifyUserConflictResponse.ts @@ -0,0 +1,32 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { IdentifyUserConflictResponseErrorsInner } from './IdentifyUserConflictResponseErrorsInner'; +import { HttpFile } from '../http/http'; + +export class IdentifyUserConflictResponse { + '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 IdentifyUserConflictResponse.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/IdentifyUserConflictResponseErrorsInner.ts b/models/IdentifyUserConflictResponseErrorsInner.ts new file mode 100644 index 0000000..4ad3c58 --- /dev/null +++ b/models/IdentifyUserConflictResponseErrorsInner.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class IdentifyUserConflictResponseErrorsInner { + 'code'?: string; + 'title'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return IdentifyUserConflictResponseErrorsInner.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/InlineResponse200.ts b/models/InlineResponse200.ts new file mode 100644 index 0000000..8e877dc --- /dev/null +++ b/models/InlineResponse200.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class InlineResponse200 { + 'identity'?: { [key: string]: any; }; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "identity", + "baseName": "identity", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineResponse200.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/InlineResponse2003.ts b/models/InlineResponse2003.ts new file mode 100644 index 0000000..fdee68b --- /dev/null +++ b/models/InlineResponse2003.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class InlineResponse2003 { + 'in_app_messages'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "in_app_messages", + "baseName": "in_app_messages", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineResponse2003.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/InlineResponse201.ts b/models/InlineResponse201.ts new file mode 100644 index 0000000..3f3ead8 --- /dev/null +++ b/models/InlineResponse201.ts @@ -0,0 +1,32 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { SubscriptionObject } from './SubscriptionObject'; +import { HttpFile } from '../http/http'; + +export class InlineResponse201 { + 'subscription'?: SubscriptionObject; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "subscription", + "baseName": "subscription", + "type": "SubscriptionObject", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineResponse201.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/InlineResponse202.ts b/models/InlineResponse202.ts new file mode 100644 index 0000000..b61326c --- /dev/null +++ b/models/InlineResponse202.ts @@ -0,0 +1,32 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { PropertiesObject } from './PropertiesObject'; +import { HttpFile } from '../http/http'; + +export class InlineResponse202 { + 'properties'?: PropertiesObject; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "properties", + "baseName": "properties", + "type": "PropertiesObject", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineResponse202.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/InvalidIdentifierError.ts b/models/InvalidIdentifierError.ts index 8d7acec..ed17ae6 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/Notification.ts b/models/Notification.ts index ff35446..5668698 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ @@ -11,6 +11,7 @@ import { BasicNotificationAllOfAndroidBackgroundLayout } from './BasicNotificati import { Button } from './Button'; import { Filter } from './Filter'; import { NotificationAllOf } from './NotificationAllOf'; +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { StringMap } from './StringMap'; import { HttpFile } from '../http/http'; @@ -63,6 +64,8 @@ export class Notification { * Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call */ 'include_android_reg_ids'?: Array; + 'include_aliases'?: PlayerNotificationTargetIncludeAliases; + 'target_channel'?: NotificationTargetChannelEnum; 'id'?: string; 'value'?: number; /** @@ -475,6 +478,18 @@ export class Notification { "type": "Array", "format": "" }, + { + "name": "include_aliases", + "baseName": "include_aliases", + "type": "PlayerNotificationTargetIncludeAliases", + "format": "" + }, + { + "name": "target_channel", + "baseName": "target_channel", + "type": "NotificationTargetChannelEnum", + "format": "" + }, { "name": "id", "baseName": "id", @@ -1025,5 +1040,6 @@ export class Notification { } +export type NotificationTargetChannelEnum = "push" | "email" | "sms" ; export type NotificationAggregationEnum = "sum" | "count" ; diff --git a/models/Notification200Errors.ts b/models/Notification200Errors.ts index e05e883..2afdccb 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationAllOf.ts b/models/NotificationAllOf.ts index 7d32332..2fba4b5 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationHistorySuccessResponse.ts b/models/NotificationHistorySuccessResponse.ts index 23c1f6c..b227a2a 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationSlice.ts b/models/NotificationSlice.ts index 0cb179d..3614834 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationTarget.ts b/models/NotificationTarget.ts index 3a581ea..e4b46a3 100644 --- a/models/NotificationTarget.ts +++ b/models/NotificationTarget.ts @@ -2,11 +2,12 @@ * 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 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ import { PlayerNotificationTarget } from './PlayerNotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { SegmentNotificationTarget } from './SegmentNotificationTarget'; import { HttpFile } from '../http/http'; @@ -59,6 +60,8 @@ export class NotificationTarget { * Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call */ 'include_android_reg_ids'?: Array; + 'include_aliases'?: PlayerNotificationTargetIncludeAliases; + 'target_channel'?: NotificationTargetTargetChannelEnum; static readonly discriminator: string | undefined = undefined; @@ -134,6 +137,18 @@ export class NotificationTarget { "baseName": "include_android_reg_ids", "type": "Array", "format": "" + }, + { + "name": "include_aliases", + "baseName": "include_aliases", + "type": "PlayerNotificationTargetIncludeAliases", + "format": "" + }, + { + "name": "target_channel", + "baseName": "target_channel", + "type": "NotificationTargetTargetChannelEnum", + "format": "" } ]; static getAttributeTypeMap() { @@ -144,3 +159,6 @@ export class NotificationTarget { } } + +export type NotificationTargetTargetChannelEnum = "push" | "email" | "sms" ; + diff --git a/models/NotificationWithMeta.ts b/models/NotificationWithMeta.ts index 2f9d45c..403345f 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ @@ -15,6 +15,7 @@ import { NotificationWithMetaAllOf } from './NotificationWithMetaAllOf'; import { OutcomeData } from './OutcomeData'; import { OutcomesData } from './OutcomesData'; import { PlatformDeliveryData } from './PlatformDeliveryData'; +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { StringMap } from './StringMap'; import { HttpFile } from '../http/http'; @@ -67,6 +68,8 @@ export class NotificationWithMeta { * Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call */ 'include_android_reg_ids'?: Array; + 'include_aliases'?: PlayerNotificationTargetIncludeAliases; + 'target_channel'?: NotificationWithMetaTargetChannelEnum; 'id'?: string; 'value'?: number; /** @@ -513,6 +516,18 @@ export class NotificationWithMeta { "type": "Array", "format": "" }, + { + "name": "include_aliases", + "baseName": "include_aliases", + "type": "PlayerNotificationTargetIncludeAliases", + "format": "" + }, + { + "name": "target_channel", + "baseName": "target_channel", + "type": "NotificationWithMetaTargetChannelEnum", + "format": "" + }, { "name": "id", "baseName": "id", @@ -1123,5 +1138,6 @@ export class NotificationWithMeta { } +export type NotificationWithMetaTargetChannelEnum = "push" | "email" | "sms" ; export type NotificationWithMetaAggregationEnum = "sum" | "count" ; diff --git a/models/NotificationWithMetaAllOf.ts b/models/NotificationWithMetaAllOf.ts index 58f115c..c920c95 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/ObjectSerializer.ts b/models/ObjectSerializer.ts index 1f0edec..fc7d4d6 100644 --- a/models/ObjectSerializer.ts +++ b/models/ObjectSerializer.ts @@ -10,6 +10,10 @@ export * from './CreateNotificationSuccessResponse'; export * from './CreatePlayerSuccessResponse'; export * from './CreateSegmentConflictResponse'; export * from './CreateSegmentSuccessResponse'; +export * from './CreateSubscriptionRequestBody'; +export * from './CreateUserConflictResponse'; +export * from './CreateUserConflictResponseErrorsInner'; +export * from './CreateUserConflictResponseErrorsItemsMeta'; export * from './DeletePlayerNotFoundResponse'; export * from './DeletePlayerSuccessResponse'; export * from './DeleteSegmentNotFoundResponse'; @@ -20,6 +24,12 @@ export * from './ExportPlayersSuccessResponse'; export * from './Filter'; export * from './FilterExpressions'; export * from './GetNotificationRequestBody'; +export * from './IdentifyUserConflictResponse'; +export * from './IdentifyUserConflictResponseErrorsInner'; +export * from './InlineResponse200'; +export * from './InlineResponse2003'; +export * from './InlineResponse201'; +export * from './InlineResponse202'; export * from './InvalidIdentifierError'; export * from './Notification'; export * from './Notification200Errors'; @@ -37,20 +47,31 @@ export * from './PlatformDeliveryDataEmailAllOf'; export * from './PlatformDeliveryDataSmsAllOf'; export * from './Player'; export * from './PlayerNotificationTarget'; +export * from './PlayerNotificationTargetIncludeAliases'; export * from './PlayerSlice'; +export * from './PropertiesDeltas'; +export * from './PropertiesObject'; export * from './Purchase'; export * from './Segment'; export * from './SegmentNotificationTarget'; export * from './StringMap'; +export * from './SubscriptionObject'; +export * from './TransferSubscriptionRequestBody'; export * from './UpdateLiveActivityRequest'; export * from './UpdateLiveActivitySuccessResponse'; export * from './UpdatePlayerSuccessResponse'; export * from './UpdatePlayerTagsRequestBody'; export * from './UpdatePlayerTagsSuccessResponse'; +export * from './UpdateSubscriptionRequestBody'; +export * from './UpdateUserRequest'; +export * from './User'; +export * from './UserIdentityRequestBody'; +export * from './UserIdentityResponse'; +export * from './UserSubscriptionOptions'; import { App , AppApnsEnvEnum } from './App'; import { BadRequestError } from './BadRequestError'; -import { BasicNotification , BasicNotificationAggregationEnum } from './BasicNotification'; +import { BasicNotification , BasicNotificationTargetChannelEnum , BasicNotificationAggregationEnum } from './BasicNotification'; import { BasicNotificationAllOf , BasicNotificationAllOfAggregationEnum } from './BasicNotificationAllOf'; import { BasicNotificationAllOfAndroidBackgroundLayout } from './BasicNotificationAllOfAndroidBackgroundLayout'; import { BeginLiveActivityRequest } from './BeginLiveActivityRequest'; @@ -60,6 +81,10 @@ import { CreateNotificationSuccessResponse } from './CreateNotificationSuccessRe import { CreatePlayerSuccessResponse } from './CreatePlayerSuccessResponse'; import { CreateSegmentConflictResponse } from './CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from './CreateSegmentSuccessResponse'; +import { CreateSubscriptionRequestBody } from './CreateSubscriptionRequestBody'; +import { CreateUserConflictResponse } from './CreateUserConflictResponse'; +import { CreateUserConflictResponseErrorsInner } from './CreateUserConflictResponseErrorsInner'; +import { CreateUserConflictResponseErrorsItemsMeta } from './CreateUserConflictResponseErrorsItemsMeta'; import { DeletePlayerNotFoundResponse } from './DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from './DeletePlayerSuccessResponse'; import { DeleteSegmentNotFoundResponse } from './DeleteSegmentNotFoundResponse'; @@ -70,14 +95,20 @@ import { ExportPlayersSuccessResponse } from './ExportPlayersSuccessResponse'; import { Filter , FilterRelationEnum } from './Filter'; import { FilterExpressions , FilterExpressionsRelationEnum , FilterExpressionsOperatorEnum } from './FilterExpressions'; import { GetNotificationRequestBody, GetNotificationRequestBodyEventsEnum } from './GetNotificationRequestBody'; +import { IdentifyUserConflictResponse } from './IdentifyUserConflictResponse'; +import { IdentifyUserConflictResponseErrorsInner } from './IdentifyUserConflictResponseErrorsInner'; +import { InlineResponse200 } from './InlineResponse200'; +import { InlineResponse2003 } from './InlineResponse2003'; +import { InlineResponse201 } from './InlineResponse201'; +import { InlineResponse202 } from './InlineResponse202'; import { InvalidIdentifierError } from './InvalidIdentifierError'; -import { Notification , NotificationAggregationEnum } from './Notification'; +import { Notification , NotificationTargetChannelEnum , NotificationAggregationEnum } from './Notification'; import { Notification200Errors } from './Notification200Errors'; import { NotificationAllOf } from './NotificationAllOf'; import { NotificationHistorySuccessResponse } from './NotificationHistorySuccessResponse'; import { NotificationSlice } from './NotificationSlice'; -import { NotificationTarget } from './NotificationTarget'; -import { NotificationWithMeta , NotificationWithMetaAggregationEnum } from './NotificationWithMeta'; +import { NotificationTarget , NotificationTargetTargetChannelEnum } from './NotificationTarget'; +import { NotificationWithMeta , NotificationWithMetaTargetChannelEnum , NotificationWithMetaAggregationEnum } from './NotificationWithMeta'; import { NotificationWithMetaAllOf } from './NotificationWithMetaAllOf'; import { Operator, OperatorOperatorEnum } from './Operator'; import { OutcomeData , OutcomeDataAggregationEnum } from './OutcomeData'; @@ -86,17 +117,28 @@ import { PlatformDeliveryData } from './PlatformDeliveryData'; import { PlatformDeliveryDataEmailAllOf } from './PlatformDeliveryDataEmailAllOf'; import { PlatformDeliveryDataSmsAllOf } from './PlatformDeliveryDataSmsAllOf'; import { Player } from './Player'; -import { PlayerNotificationTarget } from './PlayerNotificationTarget'; +import { PlayerNotificationTarget , PlayerNotificationTargetTargetChannelEnum } from './PlayerNotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { PlayerSlice } from './PlayerSlice'; +import { PropertiesDeltas } from './PropertiesDeltas'; +import { PropertiesObject } from './PropertiesObject'; import { Purchase } from './Purchase'; import { Segment } from './Segment'; import { SegmentNotificationTarget } from './SegmentNotificationTarget'; import { StringMap } from './StringMap'; +import { SubscriptionObject , SubscriptionObjectTypeEnum } from './SubscriptionObject'; +import { TransferSubscriptionRequestBody } from './TransferSubscriptionRequestBody'; import { UpdateLiveActivityRequest, UpdateLiveActivityRequestNameEnum , UpdateLiveActivityRequestEventEnum } from './UpdateLiveActivityRequest'; import { UpdateLiveActivitySuccessResponse } from './UpdateLiveActivitySuccessResponse'; import { UpdatePlayerSuccessResponse } from './UpdatePlayerSuccessResponse'; import { UpdatePlayerTagsRequestBody } from './UpdatePlayerTagsRequestBody'; import { UpdatePlayerTagsSuccessResponse } from './UpdatePlayerTagsSuccessResponse'; +import { UpdateSubscriptionRequestBody } from './UpdateSubscriptionRequestBody'; +import { UpdateUserRequest } from './UpdateUserRequest'; +import { User } from './User'; +import { UserIdentityRequestBody } from './UserIdentityRequestBody'; +import { UserIdentityResponse } from './UserIdentityResponse'; +import { UserSubscriptionOptions } from './UserSubscriptionOptions'; /* tslint:disable:no-unused-variable */ let primitives = [ @@ -119,16 +161,22 @@ const supportedMediaTypes: { [mediaType: string]: number } = { let enumsMap: Set = new Set([ "AppApnsEnvEnum", + "BasicNotificationTargetChannelEnum", "BasicNotificationAggregationEnum", "BasicNotificationAllOfAggregationEnum", "FilterRelationEnum", "FilterExpressionsRelationEnum", "FilterExpressionsOperatorEnum", "GetNotificationRequestBodyEventsEnum", + "NotificationTargetChannelEnum", "NotificationAggregationEnum", + "NotificationTargetTargetChannelEnum", + "NotificationWithMetaTargetChannelEnum", "NotificationWithMetaAggregationEnum", "OperatorOperatorEnum", "OutcomeDataAggregationEnum", + "PlayerNotificationTargetTargetChannelEnum", + "SubscriptionObjectTypeEnum", "UpdateLiveActivityRequestNameEnum", "UpdateLiveActivityRequestEventEnum", ]); @@ -146,6 +194,10 @@ let typeMap: {[index: string]: any} = { "CreatePlayerSuccessResponse": CreatePlayerSuccessResponse, "CreateSegmentConflictResponse": CreateSegmentConflictResponse, "CreateSegmentSuccessResponse": CreateSegmentSuccessResponse, + "CreateSubscriptionRequestBody": CreateSubscriptionRequestBody, + "CreateUserConflictResponse": CreateUserConflictResponse, + "CreateUserConflictResponseErrorsInner": CreateUserConflictResponseErrorsInner, + "CreateUserConflictResponseErrorsItemsMeta": CreateUserConflictResponseErrorsItemsMeta, "DeletePlayerNotFoundResponse": DeletePlayerNotFoundResponse, "DeletePlayerSuccessResponse": DeletePlayerSuccessResponse, "DeleteSegmentNotFoundResponse": DeleteSegmentNotFoundResponse, @@ -156,6 +208,12 @@ let typeMap: {[index: string]: any} = { "Filter": Filter, "FilterExpressions": FilterExpressions, "GetNotificationRequestBody": GetNotificationRequestBody, + "IdentifyUserConflictResponse": IdentifyUserConflictResponse, + "IdentifyUserConflictResponseErrorsInner": IdentifyUserConflictResponseErrorsInner, + "InlineResponse200": InlineResponse200, + "InlineResponse2003": InlineResponse2003, + "InlineResponse201": InlineResponse201, + "InlineResponse202": InlineResponse202, "InvalidIdentifierError": InvalidIdentifierError, "Notification": Notification, "Notification200Errors": Notification200Errors, @@ -173,16 +231,27 @@ let typeMap: {[index: string]: any} = { "PlatformDeliveryDataSmsAllOf": PlatformDeliveryDataSmsAllOf, "Player": Player, "PlayerNotificationTarget": PlayerNotificationTarget, + "PlayerNotificationTargetIncludeAliases": PlayerNotificationTargetIncludeAliases, "PlayerSlice": PlayerSlice, + "PropertiesDeltas": PropertiesDeltas, + "PropertiesObject": PropertiesObject, "Purchase": Purchase, "Segment": Segment, "SegmentNotificationTarget": SegmentNotificationTarget, "StringMap": StringMap, + "SubscriptionObject": SubscriptionObject, + "TransferSubscriptionRequestBody": TransferSubscriptionRequestBody, "UpdateLiveActivityRequest": UpdateLiveActivityRequest, "UpdateLiveActivitySuccessResponse": UpdateLiveActivitySuccessResponse, "UpdatePlayerSuccessResponse": UpdatePlayerSuccessResponse, "UpdatePlayerTagsRequestBody": UpdatePlayerTagsRequestBody, "UpdatePlayerTagsSuccessResponse": UpdatePlayerTagsSuccessResponse, + "UpdateSubscriptionRequestBody": UpdateSubscriptionRequestBody, + "UpdateUserRequest": UpdateUserRequest, + "User": User, + "UserIdentityRequestBody": UserIdentityRequestBody, + "UserIdentityResponse": UserIdentityResponse, + "UserSubscriptionOptions": UserSubscriptionOptions, } export class ObjectSerializer { diff --git a/models/Operator.ts b/models/Operator.ts index 6aabcdb..b0bc7c6 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomeData.ts b/models/OutcomeData.ts index 2c4b9d3..a2c12af 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomesData.ts b/models/OutcomesData.ts index c4d3cef..2d7e368 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryData.ts b/models/PlatformDeliveryData.ts index cc6bd8c..cc49a63 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataEmailAllOf.ts b/models/PlatformDeliveryDataEmailAllOf.ts index 67dca22..a354ad5 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataSmsAllOf.ts b/models/PlatformDeliveryDataSmsAllOf.ts index 3fe746e..08d161b 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/Player.ts b/models/Player.ts index 995f1cc..f7dcaef 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ @@ -105,7 +105,7 @@ export class Player { /** * Longitude of the device, used for geotagging to segment on. */ - '_long'?: number; + 'long'?: number; /** * Latitude of the device, used for geotagging to segment on. */ @@ -263,7 +263,7 @@ export class Player { "format": "" }, { - "name": "_long", + "name": "long", "baseName": "long", "type": "number", "format": "" diff --git a/models/PlayerNotificationTarget.ts b/models/PlayerNotificationTarget.ts index 7bd4867..1de58d1 100644 --- a/models/PlayerNotificationTarget.ts +++ b/models/PlayerNotificationTarget.ts @@ -2,10 +2,11 @@ * 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 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ +import { PlayerNotificationTargetIncludeAliases } from './PlayerNotificationTargetIncludeAliases'; import { HttpFile } from '../http/http'; export class PlayerNotificationTarget { @@ -49,6 +50,8 @@ export class PlayerNotificationTarget { * Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call */ 'include_android_reg_ids'?: Array; + 'include_aliases'?: PlayerNotificationTargetIncludeAliases; + 'target_channel'?: PlayerNotificationTargetTargetChannelEnum; static readonly discriminator: string | undefined = undefined; @@ -112,6 +115,18 @@ export class PlayerNotificationTarget { "baseName": "include_android_reg_ids", "type": "Array", "format": "" + }, + { + "name": "include_aliases", + "baseName": "include_aliases", + "type": "PlayerNotificationTargetIncludeAliases", + "format": "" + }, + { + "name": "target_channel", + "baseName": "target_channel", + "type": "PlayerNotificationTargetTargetChannelEnum", + "format": "" } ]; static getAttributeTypeMap() { @@ -122,3 +137,6 @@ export class PlayerNotificationTarget { } } + +export type PlayerNotificationTargetTargetChannelEnum = "push" | "email" | "sms" ; + diff --git a/models/PlayerNotificationTargetIncludeAliases.ts b/models/PlayerNotificationTargetIncludeAliases.ts new file mode 100644 index 0000000..ced93dd --- /dev/null +++ b/models/PlayerNotificationTargetIncludeAliases.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class PlayerNotificationTargetIncludeAliases { + 'alias_label'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "alias_label", + "baseName": "alias_label", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PlayerNotificationTargetIncludeAliases.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/PlayerSlice.ts b/models/PlayerSlice.ts index 5364d97..3126ee9 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/PropertiesDeltas.ts b/models/PropertiesDeltas.ts new file mode 100644 index 0000000..b82e99e --- /dev/null +++ b/models/PropertiesDeltas.ts @@ -0,0 +1,53 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { Purchase } from './Purchase'; +import { HttpFile } from '../http/http'; + +export class PropertiesDeltas { + 'session_time'?: number; + 'session_count'?: number; + 'amount_spent'?: number; + 'purchases'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "session_time", + "baseName": "session_time", + "type": "number", + "format": "" + }, + { + "name": "session_count", + "baseName": "session_count", + "type": "number", + "format": "" + }, + { + "name": "amount_spent", + "baseName": "amount_spent", + "type": "number", + "format": "" + }, + { + "name": "purchases", + "baseName": "purchases", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PropertiesDeltas.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/PropertiesObject.ts b/models/PropertiesObject.ts new file mode 100644 index 0000000..d56cd41 --- /dev/null +++ b/models/PropertiesObject.ts @@ -0,0 +1,102 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { Purchase } from './Purchase'; +import { HttpFile } from '../http/http'; + +export class PropertiesObject { + 'tags'?: { [key: string]: any; }; + 'language'?: string; + 'timezone_id'?: string; + 'lat'?: number; + 'long'?: number; + 'country'?: string; + 'first_active'?: number; + 'last_active'?: number; + 'amount_spent'?: number; + 'purchases'?: Array; + 'ip'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "tags", + "baseName": "tags", + "type": "{ [key: string]: any; }", + "format": "" + }, + { + "name": "language", + "baseName": "language", + "type": "string", + "format": "" + }, + { + "name": "timezone_id", + "baseName": "timezone_id", + "type": "string", + "format": "" + }, + { + "name": "lat", + "baseName": "lat", + "type": "number", + "format": "" + }, + { + "name": "long", + "baseName": "long", + "type": "number", + "format": "" + }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, + { + "name": "first_active", + "baseName": "first_active", + "type": "number", + "format": "" + }, + { + "name": "last_active", + "baseName": "last_active", + "type": "number", + "format": "" + }, + { + "name": "amount_spent", + "baseName": "amount_spent", + "type": "number", + "format": "" + }, + { + "name": "purchases", + "baseName": "purchases", + "type": "Array", + "format": "" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PropertiesObject.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/Purchase.ts b/models/Purchase.ts index c958331..0b85dca 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ @@ -16,7 +16,7 @@ export class Purchase { /** * The amount, in USD, spent purchasing the item. */ - 'amount': number; + 'amount': string; /** * The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. */ @@ -34,7 +34,7 @@ export class Purchase { { "name": "amount", "baseName": "amount", - "type": "number", + "type": "string", "format": "" }, { diff --git a/models/Segment.ts b/models/Segment.ts index a8114a8..3caf9ea 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/SegmentNotificationTarget.ts b/models/SegmentNotificationTarget.ts index 11ab223..322fcc3 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/StringMap.ts b/models/StringMap.ts index c94f943..7fa4ab5 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/SubscriptionObject.ts b/models/SubscriptionObject.ts new file mode 100644 index 0000000..62a421c --- /dev/null +++ b/models/SubscriptionObject.ts @@ -0,0 +1,146 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class SubscriptionObject { + 'id'?: string; + 'type'?: SubscriptionObjectTypeEnum; + 'token'?: string; + 'enabled'?: boolean; + 'notification_types'?: number; + 'session_time'?: number; + 'session_count'?: number; + 'sdk'?: string; + 'device_model'?: string; + 'device_os'?: string; + 'rooted'?: boolean; + 'test_type'?: number; + 'app_version'?: string; + 'net_type'?: number; + 'carrier'?: string; + 'web_auth'?: string; + 'web_p256'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "SubscriptionObjectTypeEnum", + "format": "" + }, + { + "name": "token", + "baseName": "token", + "type": "string", + "format": "" + }, + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean", + "format": "" + }, + { + "name": "notification_types", + "baseName": "notification_types", + "type": "number", + "format": "" + }, + { + "name": "session_time", + "baseName": "session_time", + "type": "number", + "format": "" + }, + { + "name": "session_count", + "baseName": "session_count", + "type": "number", + "format": "" + }, + { + "name": "sdk", + "baseName": "sdk", + "type": "string", + "format": "" + }, + { + "name": "device_model", + "baseName": "device_model", + "type": "string", + "format": "" + }, + { + "name": "device_os", + "baseName": "device_os", + "type": "string", + "format": "" + }, + { + "name": "rooted", + "baseName": "rooted", + "type": "boolean", + "format": "" + }, + { + "name": "test_type", + "baseName": "test_type", + "type": "number", + "format": "" + }, + { + "name": "app_version", + "baseName": "app_version", + "type": "string", + "format": "" + }, + { + "name": "net_type", + "baseName": "net_type", + "type": "number", + "format": "" + }, + { + "name": "carrier", + "baseName": "carrier", + "type": "string", + "format": "" + }, + { + "name": "web_auth", + "baseName": "web_auth", + "type": "string", + "format": "" + }, + { + "name": "web_p256", + "baseName": "web_p256", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return SubscriptionObject.attributeTypeMap; + } + + public constructor() { + } +} + + +export type SubscriptionObjectTypeEnum = "iOSPush" | "AndroidPush" | "FireOSPush" | "ChromeExtensionPush" | "ChromePush" | "WindowsPush" | "SafariLegacyPush" | "FirefoxPush" | "macOSPush" | "HuaweiPush" | "SafariPush" | "Email" | "SMS" ; + diff --git a/models/TransferSubscriptionRequestBody.ts b/models/TransferSubscriptionRequestBody.ts new file mode 100644 index 0000000..692c852 --- /dev/null +++ b/models/TransferSubscriptionRequestBody.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class TransferSubscriptionRequestBody { + 'identity'?: { [key: string]: any; }; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "identity", + "baseName": "identity", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TransferSubscriptionRequestBody.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UpdateLiveActivityRequest.ts b/models/UpdateLiveActivityRequest.ts index f338659..91f637a 100644 --- a/models/UpdateLiveActivityRequest.ts +++ b/models/UpdateLiveActivityRequest.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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateLiveActivitySuccessResponse.ts b/models/UpdateLiveActivitySuccessResponse.ts index 8378ff6..4c65b6c 100644 --- a/models/UpdateLiveActivitySuccessResponse.ts +++ b/models/UpdateLiveActivitySuccessResponse.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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdatePlayerSuccessResponse.ts b/models/UpdatePlayerSuccessResponse.ts index 0ac74e2..28dac66 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdatePlayerTagsRequestBody.ts b/models/UpdatePlayerTagsRequestBody.ts index 0e67082..c78f15e 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdatePlayerTagsSuccessResponse.ts b/models/UpdatePlayerTagsSuccessResponse.ts index a56f60c..f02b092 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.2 + * API Version: 1.1.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateSubscriptionRequestBody.ts b/models/UpdateSubscriptionRequestBody.ts new file mode 100644 index 0000000..5d92e14 --- /dev/null +++ b/models/UpdateSubscriptionRequestBody.ts @@ -0,0 +1,32 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { SubscriptionObject } from './SubscriptionObject'; +import { HttpFile } from '../http/http'; + +export class UpdateSubscriptionRequestBody { + 'subscription'?: SubscriptionObject; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "subscription", + "baseName": "subscription", + "type": "SubscriptionObject", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateSubscriptionRequestBody.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UpdateUserRequest.ts b/models/UpdateUserRequest.ts new file mode 100644 index 0000000..812ab6c --- /dev/null +++ b/models/UpdateUserRequest.ts @@ -0,0 +1,47 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { PropertiesDeltas } from './PropertiesDeltas'; +import { PropertiesObject } from './PropertiesObject'; +import { HttpFile } from '../http/http'; + +export class UpdateUserRequest { + 'properties'?: PropertiesObject; + 'refresh_device_metadata'?: boolean; + 'deltas'?: PropertiesDeltas; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "properties", + "baseName": "properties", + "type": "PropertiesObject", + "format": "" + }, + { + "name": "refresh_device_metadata", + "baseName": "refresh_device_metadata", + "type": "boolean", + "format": "" + }, + { + "name": "deltas", + "baseName": "deltas", + "type": "PropertiesDeltas", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateUserRequest.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/User.ts b/models/User.ts new file mode 100644 index 0000000..52af98e --- /dev/null +++ b/models/User.ts @@ -0,0 +1,55 @@ +/** + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * API Version: 1.1.0 + * Contact: devrel@onesignal.com + */ + +import { PropertiesObject } from './PropertiesObject'; +import { SubscriptionObject } from './SubscriptionObject'; +import { UserSubscriptionOptions } from './UserSubscriptionOptions'; +import { HttpFile } from '../http/http'; + +export class User { + 'properties'?: PropertiesObject; + 'identity'?: { [key: string]: any; }; + 'subscriptions'?: Array; + 'subscription_options'?: UserSubscriptionOptions; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "properties", + "baseName": "properties", + "type": "PropertiesObject", + "format": "" + }, + { + "name": "identity", + "baseName": "identity", + "type": "{ [key: string]: any; }", + "format": "" + }, + { + "name": "subscriptions", + "baseName": "subscriptions", + "type": "Array", + "format": "" + }, + { + "name": "subscription_options", + "baseName": "subscription_options", + "type": "UserSubscriptionOptions", + "format": "" + } ]; + + static getAttributeTypeMap() { + return User.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UserIdentityRequestBody.ts b/models/UserIdentityRequestBody.ts new file mode 100644 index 0000000..cebcff1 --- /dev/null +++ b/models/UserIdentityRequestBody.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class UserIdentityRequestBody { + 'identity'?: { [key: string]: any; }; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "identity", + "baseName": "identity", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UserIdentityRequestBody.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UserIdentityResponse.ts b/models/UserIdentityResponse.ts new file mode 100644 index 0000000..84fc235 --- /dev/null +++ b/models/UserIdentityResponse.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class UserIdentityResponse { + 'identity'?: { [key: string]: any; }; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "identity", + "baseName": "identity", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UserIdentityResponse.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/UserSubscriptionOptions.ts b/models/UserSubscriptionOptions.ts new file mode 100644 index 0000000..a3c134b --- /dev/null +++ b/models/UserSubscriptionOptions.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.1.0 + * Contact: devrel@onesignal.com + */ + +import { HttpFile } from '../http/http'; + +export class UserSubscriptionOptions { + 'retain_previous_owner'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "retain_previous_owner", + "baseName": "retain_previous_owner", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UserSubscriptionOptions.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/models/all.ts b/models/all.ts index 7a14528..998e71a 100644 --- a/models/all.ts +++ b/models/all.ts @@ -10,6 +10,10 @@ export * from './CreateNotificationSuccessResponse' export * from './CreatePlayerSuccessResponse' export * from './CreateSegmentConflictResponse' export * from './CreateSegmentSuccessResponse' +export * from './CreateSubscriptionRequestBody' +export * from './CreateUserConflictResponse' +export * from './CreateUserConflictResponseErrorsInner' +export * from './CreateUserConflictResponseErrorsItemsMeta' export * from './DeletePlayerNotFoundResponse' export * from './DeletePlayerSuccessResponse' export * from './DeleteSegmentNotFoundResponse' @@ -20,6 +24,12 @@ export * from './ExportPlayersSuccessResponse' export * from './Filter' export * from './FilterExpressions' export * from './GetNotificationRequestBody' +export * from './IdentifyUserConflictResponse' +export * from './IdentifyUserConflictResponseErrorsInner' +export * from './InlineResponse200' +export * from './InlineResponse2003' +export * from './InlineResponse201' +export * from './InlineResponse202' export * from './InvalidIdentifierError' export * from './Notification' export * from './Notification200Errors' @@ -37,13 +47,24 @@ export * from './PlatformDeliveryDataEmailAllOf' export * from './PlatformDeliveryDataSmsAllOf' export * from './Player' export * from './PlayerNotificationTarget' +export * from './PlayerNotificationTargetIncludeAliases' export * from './PlayerSlice' +export * from './PropertiesDeltas' +export * from './PropertiesObject' export * from './Purchase' export * from './Segment' export * from './SegmentNotificationTarget' export * from './StringMap' +export * from './SubscriptionObject' +export * from './TransferSubscriptionRequestBody' export * from './UpdateLiveActivityRequest' export * from './UpdateLiveActivitySuccessResponse' export * from './UpdatePlayerSuccessResponse' export * from './UpdatePlayerTagsRequestBody' export * from './UpdatePlayerTagsSuccessResponse' +export * from './UpdateSubscriptionRequestBody' +export * from './UpdateUserRequest' +export * from './User' +export * from './UserIdentityRequestBody' +export * from './UserIdentityResponse' +export * from './UserSubscriptionOptions' diff --git a/package.json b/package.json index fa77e80..563a5df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onesignal/node-onesignal", - "version": "1.0.0-beta8", + "version": "1.0.0-beta9", "description": "OpenAPI client for @onesignal/node-onesignal", "author": "OpenAPI-Generator Contributors", "keywords": [ diff --git a/types/ObjectParamAPI.ts b/types/ObjectParamAPI.ts index 1bb8534..d2b6a72 100644 --- a/types/ObjectParamAPI.ts +++ b/types/ObjectParamAPI.ts @@ -14,6 +14,10 @@ import { CreateNotificationSuccessResponse } from '../models/CreateNotificationS import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; +import { CreateSubscriptionRequestBody } from '../models/CreateSubscriptionRequestBody'; +import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse'; +import { CreateUserConflictResponseErrorsInner } from '../models/CreateUserConflictResponseErrorsInner'; +import { CreateUserConflictResponseErrorsItemsMeta } from '../models/CreateUserConflictResponseErrorsItemsMeta'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; @@ -24,6 +28,12 @@ import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResp import { Filter } from '../models/Filter'; import { FilterExpressions } from '../models/FilterExpressions'; import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody'; +import { IdentifyUserConflictResponse } from '../models/IdentifyUserConflictResponse'; +import { IdentifyUserConflictResponseErrorsInner } from '../models/IdentifyUserConflictResponseErrorsInner'; +import { InlineResponse200 } from '../models/InlineResponse200'; +import { InlineResponse2003 } from '../models/InlineResponse2003'; +import { InlineResponse201 } from '../models/InlineResponse201'; +import { InlineResponse202 } from '../models/InlineResponse202'; import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; @@ -41,16 +51,27 @@ import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEm import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf'; import { Player } from '../models/Player'; import { PlayerNotificationTarget } from '../models/PlayerNotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from '../models/PlayerNotificationTargetIncludeAliases'; import { PlayerSlice } from '../models/PlayerSlice'; +import { PropertiesDeltas } from '../models/PropertiesDeltas'; +import { PropertiesObject } from '../models/PropertiesObject'; import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { SubscriptionObject } from '../models/SubscriptionObject'; +import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody'; 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'; +import { UpdateSubscriptionRequestBody } from '../models/UpdateSubscriptionRequestBody'; +import { UpdateUserRequest } from '../models/UpdateUserRequest'; +import { User } from '../models/User'; +import { UserIdentityRequestBody } from '../models/UserIdentityRequestBody'; +import { UserIdentityResponse } from '../models/UserIdentityResponse'; +import { UserSubscriptionOptions } from '../models/UserSubscriptionOptions'; import { ObservableDefaultApi } from "./ObservableAPI"; import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; @@ -133,6 +154,75 @@ export interface DefaultApiCreateSegmentsRequest { segment?: Segment } +export interface DefaultApiCreateSubscriptionRequest { + /** + * + * @type string + * @memberof DefaultApicreateSubscription + */ + appId: string + /** + * + * @type string + * @memberof DefaultApicreateSubscription + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApicreateSubscription + */ + aliasId: string + /** + * + * @type CreateSubscriptionRequestBody + * @memberof DefaultApicreateSubscription + */ + createSubscriptionRequestBody: CreateSubscriptionRequestBody +} + +export interface DefaultApiCreateUserRequest { + /** + * + * @type string + * @memberof DefaultApicreateUser + */ + appId: string + /** + * + * @type User + * @memberof DefaultApicreateUser + */ + user: User +} + +export interface DefaultApiDeleteAliasRequest { + /** + * + * @type string + * @memberof DefaultApideleteAlias + */ + appId: string + /** + * + * @type string + * @memberof DefaultApideleteAlias + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApideleteAlias + */ + aliasId: string + /** + * + * @type string + * @memberof DefaultApideleteAlias + */ + aliasLabelToDelete: string +} + export interface DefaultApiDeletePlayerRequest { /** * The OneSignal App ID for your app. Available in Keys & IDs. @@ -163,6 +253,42 @@ export interface DefaultApiDeleteSegmentsRequest { segmentId: string } +export interface DefaultApiDeleteSubscriptionRequest { + /** + * + * @type string + * @memberof DefaultApideleteSubscription + */ + appId: string + /** + * + * @type string + * @memberof DefaultApideleteSubscription + */ + subscriptionId: string +} + +export interface DefaultApiDeleteUserRequest { + /** + * + * @type string + * @memberof DefaultApideleteUser + */ + appId: string + /** + * + * @type string + * @memberof DefaultApideleteUser + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApideleteUser + */ + aliasId: string +} + export interface DefaultApiEndLiveActivityRequest { /** * The OneSignal App ID for your app. Available in Keys & IDs. @@ -199,6 +325,63 @@ export interface DefaultApiExportPlayersRequest { exportPlayersRequestBody?: ExportPlayersRequestBody } +export interface DefaultApiFetchAliasesRequest { + /** + * + * @type string + * @memberof DefaultApifetchAliases + */ + appId: string + /** + * + * @type string + * @memberof DefaultApifetchAliases + */ + subscriptionId: string +} + +export interface DefaultApiFetchUserRequest { + /** + * + * @type string + * @memberof DefaultApifetchUser + */ + appId: string + /** + * + * @type string + * @memberof DefaultApifetchUser + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApifetchUser + */ + aliasId: string +} + +export interface DefaultApiFetchUserIdentityRequest { + /** + * + * @type string + * @memberof DefaultApifetchUserIdentity + */ + appId: string + /** + * + * @type string + * @memberof DefaultApifetchUserIdentity + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApifetchUserIdentity + */ + aliasId: string +} + export interface DefaultApiGetAppRequest { /** * An app id @@ -211,6 +394,21 @@ export interface DefaultApiGetAppRequest { export interface DefaultApiGetAppsRequest { } +export interface DefaultApiGetEligibleIamsRequest { + /** + * + * @type string + * @memberof DefaultApigetEligibleIams + */ + appId: string + /** + * + * @type string + * @memberof DefaultApigetEligibleIams + */ + subscriptionId: string +} + export interface DefaultApiGetNotificationRequest { /** * @@ -349,6 +547,75 @@ export interface DefaultApiGetPlayersRequest { offset?: number } +export interface DefaultApiIdentifyUserByAliasRequest { + /** + * + * @type string + * @memberof DefaultApiidentifyUserByAlias + */ + appId: string + /** + * + * @type string + * @memberof DefaultApiidentifyUserByAlias + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApiidentifyUserByAlias + */ + aliasId: string + /** + * + * @type UserIdentityRequestBody + * @memberof DefaultApiidentifyUserByAlias + */ + userIdentityRequestBody: UserIdentityRequestBody +} + +export interface DefaultApiIdentifyUserBySubscriptionIdRequest { + /** + * + * @type string + * @memberof DefaultApiidentifyUserBySubscriptionId + */ + appId: string + /** + * + * @type string + * @memberof DefaultApiidentifyUserBySubscriptionId + */ + subscriptionId: string + /** + * + * @type UserIdentityRequestBody + * @memberof DefaultApiidentifyUserBySubscriptionId + */ + userIdentityRequestBody: UserIdentityRequestBody +} + +export interface DefaultApiTransferSubscriptionRequest { + /** + * + * @type string + * @memberof DefaultApitransferSubscription + */ + appId: string + /** + * + * @type string + * @memberof DefaultApitransferSubscription + */ + subscriptionId: string + /** + * + * @type TransferSubscriptionRequestBody + * @memberof DefaultApitransferSubscription + */ + transferSubscriptionRequestBody: TransferSubscriptionRequestBody +} + export interface DefaultApiUpdateAppRequest { /** * An app id @@ -421,6 +688,60 @@ export interface DefaultApiUpdatePlayerTagsRequest { updatePlayerTagsRequestBody?: UpdatePlayerTagsRequestBody } +export interface DefaultApiUpdateSubscriptionRequest { + /** + * + * @type string + * @memberof DefaultApiupdateSubscription + */ + appId: string + /** + * + * @type string + * @memberof DefaultApiupdateSubscription + */ + subscriptionId: string + /** + * + * @type UpdateSubscriptionRequestBody + * @memberof DefaultApiupdateSubscription + */ + updateSubscriptionRequestBody: UpdateSubscriptionRequestBody +} + +export interface DefaultApiUpdateUserRequest { + /** + * + * @type string + * @memberof DefaultApiupdateUser + */ + appId: string + /** + * + * @type string + * @memberof DefaultApiupdateUser + */ + aliasLabel: string + /** + * + * @type string + * @memberof DefaultApiupdateUser + */ + aliasId: string + /** + * + * @type UpdateUserRequest + * @memberof DefaultApiupdateUser + */ + updateUserRequest: UpdateUserRequest + /** + * + * @type string + * @memberof DefaultApiupdateUser + */ + subscriptionId?: string +} + export class ObjectDefaultApi { private api: ObservableDefaultApi @@ -482,6 +803,30 @@ export class ObjectDefaultApi { return this.api.createSegments(param.appId, param.segment, options).toPromise(); } + /** + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + * @param param the request object + */ + public createSubscription(param: DefaultApiCreateSubscriptionRequest, options?: Configuration): Promise { + return this.api.createSubscription(param.appId, param.aliasLabel, param.aliasId, param.createSubscriptionRequestBody, options).toPromise(); + } + + /** + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + * @param param the request object + */ + public createUser(param: DefaultApiCreateUserRequest, options?: Configuration): Promise { + return this.api.createUser(param.appId, param.user, options).toPromise(); + } + + /** + * Deletes an alias by alias label + * @param param the request object + */ + public deleteAlias(param: DefaultApiDeleteAliasRequest, options?: Configuration): Promise { + return this.api.deleteAlias(param.appId, param.aliasLabel, param.aliasId, param.aliasLabelToDelete, options).toPromise(); + } + /** * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. * Delete a user record @@ -500,6 +845,22 @@ export class ObjectDefaultApi { return this.api.deleteSegments(param.appId, param.segmentId, options).toPromise(); } + /** + * Deletes the Subscription. + * @param param the request object + */ + public deleteSubscription(param: DefaultApiDeleteSubscriptionRequest, options?: Configuration): Promise { + return this.api.deleteSubscription(param.appId, param.subscriptionId, options).toPromise(); + } + + /** + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param param the request object + */ + public deleteUser(param: DefaultApiDeleteUserRequest, options?: Configuration): Promise { + return this.api.deleteUser(param.appId, param.aliasLabel, param.aliasId, options).toPromise(); + } + /** * Stops a Live Activity * Stop Live Activity @@ -518,6 +879,30 @@ export class ObjectDefaultApi { return this.api.exportPlayers(param.appId, param.exportPlayersRequestBody, options).toPromise(); } + /** + * Lists all Aliases for the User identified by :subscription_id. + * @param param the request object + */ + public fetchAliases(param: DefaultApiFetchAliasesRequest, options?: Configuration): Promise { + return this.api.fetchAliases(param.appId, param.subscriptionId, options).toPromise(); + } + + /** + * Returns the User’s properties, Aliases, and Subscriptions. + * @param param the request object + */ + public fetchUser(param: DefaultApiFetchUserRequest, options?: Configuration): Promise { + return this.api.fetchUser(param.appId, param.aliasLabel, param.aliasId, options).toPromise(); + } + + /** + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param param the request object + */ + public fetchUserIdentity(param: DefaultApiFetchUserIdentityRequest, options?: Configuration): Promise { + return this.api.fetchUserIdentity(param.appId, param.aliasLabel, param.aliasId, options).toPromise(); + } + /** * View the details of a single OneSignal app * View an app @@ -536,6 +921,14 @@ export class ObjectDefaultApi { return this.api.getApps( options).toPromise(); } + /** + * Manifest of In-App Messages the Subscription is eligible to display by the SDK. + * @param param the request object + */ + public getEligibleIams(param: DefaultApiGetEligibleIamsRequest, options?: Configuration): Promise { + return this.api.getEligibleIams(param.appId, param.subscriptionId, options).toPromise(); + } + /** * View the details of a single notification and outcomes associated with it * View notification @@ -590,6 +983,30 @@ export class ObjectDefaultApi { return this.api.getPlayers(param.appId, param.limit, param.offset, options).toPromise(); } + /** + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + * @param param the request object + */ + public identifyUserByAlias(param: DefaultApiIdentifyUserByAliasRequest, options?: Configuration): Promise { + return this.api.identifyUserByAlias(param.appId, param.aliasLabel, param.aliasId, param.userIdentityRequestBody, options).toPromise(); + } + + /** + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param param the request object + */ + public identifyUserBySubscriptionId(param: DefaultApiIdentifyUserBySubscriptionIdRequest, options?: Configuration): Promise { + return this.api.identifyUserBySubscriptionId(param.appId, param.subscriptionId, param.userIdentityRequestBody, options).toPromise(); + } + + /** + * Transfers this Subscription to the User identified by the identity in the payload. + * @param param the request object + */ + public transferSubscription(param: DefaultApiTransferSubscriptionRequest, options?: Configuration): Promise { + return this.api.transferSubscription(param.appId, param.subscriptionId, param.transferSubscriptionRequestBody, options).toPromise(); + } + /** * Updates the name or configuration settings of an existing OneSignal app * Update an app @@ -626,4 +1043,20 @@ export class ObjectDefaultApi { return this.api.updatePlayerTags(param.appId, param.externalUserId, param.updatePlayerTagsRequestBody, options).toPromise(); } + /** + * Updates an existing Subscription’s properties. + * @param param the request object + */ + public updateSubscription(param: DefaultApiUpdateSubscriptionRequest, options?: Configuration): Promise { + return this.api.updateSubscription(param.appId, param.subscriptionId, param.updateSubscriptionRequestBody, options).toPromise(); + } + + /** + * Updates an existing User’s properties. + * @param param the request object + */ + public updateUser(param: DefaultApiUpdateUserRequest, options?: Configuration): Promise { + return this.api.updateUser(param.appId, param.aliasLabel, param.aliasId, param.updateUserRequest, param.subscriptionId, options).toPromise(); + } + } diff --git a/types/ObservableAPI.ts b/types/ObservableAPI.ts index f696a9d..bc928ab 100644 --- a/types/ObservableAPI.ts +++ b/types/ObservableAPI.ts @@ -15,6 +15,10 @@ import { CreateNotificationSuccessResponse } from '../models/CreateNotificationS import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; +import { CreateSubscriptionRequestBody } from '../models/CreateSubscriptionRequestBody'; +import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse'; +import { CreateUserConflictResponseErrorsInner } from '../models/CreateUserConflictResponseErrorsInner'; +import { CreateUserConflictResponseErrorsItemsMeta } from '../models/CreateUserConflictResponseErrorsItemsMeta'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; @@ -25,6 +29,12 @@ import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResp import { Filter } from '../models/Filter'; import { FilterExpressions } from '../models/FilterExpressions'; import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody'; +import { IdentifyUserConflictResponse } from '../models/IdentifyUserConflictResponse'; +import { IdentifyUserConflictResponseErrorsInner } from '../models/IdentifyUserConflictResponseErrorsInner'; +import { InlineResponse200 } from '../models/InlineResponse200'; +import { InlineResponse2003 } from '../models/InlineResponse2003'; +import { InlineResponse201 } from '../models/InlineResponse201'; +import { InlineResponse202 } from '../models/InlineResponse202'; import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; @@ -42,16 +52,27 @@ import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEm import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf'; import { Player } from '../models/Player'; import { PlayerNotificationTarget } from '../models/PlayerNotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from '../models/PlayerNotificationTargetIncludeAliases'; import { PlayerSlice } from '../models/PlayerSlice'; +import { PropertiesDeltas } from '../models/PropertiesDeltas'; +import { PropertiesObject } from '../models/PropertiesObject'; import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { SubscriptionObject } from '../models/SubscriptionObject'; +import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody'; 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'; +import { UpdateSubscriptionRequestBody } from '../models/UpdateSubscriptionRequestBody'; +import { UpdateUserRequest } from '../models/UpdateUserRequest'; +import { User } from '../models/User'; +import { UserIdentityRequestBody } from '../models/UserIdentityRequestBody'; +import { UserIdentityResponse } from '../models/UserIdentityResponse'; +import { UserSubscriptionOptions } from '../models/UserSubscriptionOptions'; import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; export class ObservableDefaultApi { @@ -217,6 +238,82 @@ export class ObservableDefaultApi { })); } + /** + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + * @param appId + * @param aliasLabel + * @param aliasId + * @param createSubscriptionRequestBody + */ + public createSubscription(appId: string, aliasLabel: string, aliasId: string, createSubscriptionRequestBody: CreateSubscriptionRequestBody, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.createSubscription(appId, aliasLabel, aliasId, createSubscriptionRequestBody, _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.createSubscription(rsp))); + })); + } + + /** + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + * @param appId + * @param user + */ + public createUser(appId: string, user: User, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.createUser(appId, user, _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.createUser(rsp))); + })); + } + + /** + * Deletes an alias by alias label + * @param appId + * @param aliasLabel + * @param aliasId + * @param aliasLabelToDelete + */ + public deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete, _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.deleteAlias(rsp))); + })); + } + /** * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. * Delete a user record @@ -267,6 +364,55 @@ export class ObservableDefaultApi { })); } + /** + * Deletes the Subscription. + * @param appId + * @param subscriptionId + */ + public deleteSubscription(appId: string, subscriptionId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.deleteSubscription(appId, 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.deleteSubscription(rsp))); + })); + } + + /** + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId + * @param aliasLabel + * @param aliasId + */ + public deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.deleteUser(appId, aliasLabel, aliasId, _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.deleteUser(rsp))); + })); + } + /** * Stops a Live Activity * Stop Live Activity @@ -318,6 +464,80 @@ export class ObservableDefaultApi { })); } + /** + * Lists all Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + */ + public fetchAliases(appId: string, subscriptionId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.fetchAliases(appId, 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.fetchAliases(rsp))); + })); + } + + /** + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId + * @param aliasLabel + * @param aliasId + */ + public fetchUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.fetchUser(appId, aliasLabel, aliasId, _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.fetchUser(rsp))); + })); + } + + /** + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId + */ + public fetchUserIdentity(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.fetchUserIdentity(appId, aliasLabel, aliasId, _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.fetchUserIdentity(rsp))); + })); + } + /** * View the details of a single OneSignal app * View an app @@ -365,6 +585,30 @@ export class ObservableDefaultApi { })); } + /** + * Manifest of In-App Messages the Subscription is eligible to display by the SDK. + * @param appId + * @param subscriptionId + */ + public getEligibleIams(appId: string, subscriptionId: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.getEligibleIams(appId, 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.getEligibleIams(rsp))); + })); + } + /** * View the details of a single notification and outcomes associated with it * View notification @@ -523,6 +767,82 @@ export class ObservableDefaultApi { })); } + /** + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId + * @param userIdentityRequestBody + */ + public identifyUserByAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.identifyUserByAlias(appId, aliasLabel, aliasId, userIdentityRequestBody, _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.identifyUserByAlias(rsp))); + })); + } + + /** + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + * @param userIdentityRequestBody + */ + public identifyUserBySubscriptionId(appId: string, subscriptionId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.identifyUserBySubscriptionId(appId, subscriptionId, userIdentityRequestBody, _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.identifyUserBySubscriptionId(rsp))); + })); + } + + /** + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId + * @param subscriptionId + * @param transferSubscriptionRequestBody + */ + public transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody, _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.transferSubscription(rsp))); + })); + } + /** * Updates the name or configuration settings of an existing OneSignal app * Update an app @@ -625,4 +945,56 @@ export class ObservableDefaultApi { })); } + /** + * Updates an existing Subscription’s properties. + * @param appId + * @param subscriptionId + * @param updateSubscriptionRequestBody + */ + public updateSubscription(appId: string, subscriptionId: string, updateSubscriptionRequestBody: UpdateSubscriptionRequestBody, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.updateSubscription(appId, subscriptionId, updateSubscriptionRequestBody, _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.updateSubscription(rsp))); + })); + } + + /** + * Updates an existing User’s properties. + * @param appId + * @param aliasLabel + * @param aliasId + * @param updateUserRequest + * @param subscriptionId + */ + public updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, subscriptionId?: string, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.updateUser(appId, aliasLabel, aliasId, updateUserRequest, 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.updateUser(rsp))); + })); + } + } diff --git a/types/PromiseAPI.ts b/types/PromiseAPI.ts index 92fb087..f772854 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -14,6 +14,10 @@ import { CreateNotificationSuccessResponse } from '../models/CreateNotificationS import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse'; import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse'; import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse'; +import { CreateSubscriptionRequestBody } from '../models/CreateSubscriptionRequestBody'; +import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse'; +import { CreateUserConflictResponseErrorsInner } from '../models/CreateUserConflictResponseErrorsInner'; +import { CreateUserConflictResponseErrorsItemsMeta } from '../models/CreateUserConflictResponseErrorsItemsMeta'; import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse'; import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse'; import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse'; @@ -24,6 +28,12 @@ import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResp import { Filter } from '../models/Filter'; import { FilterExpressions } from '../models/FilterExpressions'; import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody'; +import { IdentifyUserConflictResponse } from '../models/IdentifyUserConflictResponse'; +import { IdentifyUserConflictResponseErrorsInner } from '../models/IdentifyUserConflictResponseErrorsInner'; +import { InlineResponse200 } from '../models/InlineResponse200'; +import { InlineResponse2003 } from '../models/InlineResponse2003'; +import { InlineResponse201 } from '../models/InlineResponse201'; +import { InlineResponse202 } from '../models/InlineResponse202'; import { InvalidIdentifierError } from '../models/InvalidIdentifierError'; import { Notification } from '../models/Notification'; import { Notification200Errors } from '../models/Notification200Errors'; @@ -41,16 +51,27 @@ import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEm import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf'; import { Player } from '../models/Player'; import { PlayerNotificationTarget } from '../models/PlayerNotificationTarget'; +import { PlayerNotificationTargetIncludeAliases } from '../models/PlayerNotificationTargetIncludeAliases'; import { PlayerSlice } from '../models/PlayerSlice'; +import { PropertiesDeltas } from '../models/PropertiesDeltas'; +import { PropertiesObject } from '../models/PropertiesObject'; import { Purchase } from '../models/Purchase'; import { Segment } from '../models/Segment'; import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget'; import { StringMap } from '../models/StringMap'; +import { SubscriptionObject } from '../models/SubscriptionObject'; +import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody'; 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'; +import { UpdateSubscriptionRequestBody } from '../models/UpdateSubscriptionRequestBody'; +import { UpdateUserRequest } from '../models/UpdateUserRequest'; +import { User } from '../models/User'; +import { UserIdentityRequestBody } from '../models/UserIdentityRequestBody'; +import { UserIdentityResponse } from '../models/UserIdentityResponse'; +import { UserSubscriptionOptions } from '../models/UserSubscriptionOptions'; import { ObservableDefaultApi } from './ObservableAPI'; import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; @@ -129,6 +150,40 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + * @param appId + * @param aliasLabel + * @param aliasId + * @param createSubscriptionRequestBody + */ + public createSubscription(appId: string, aliasLabel: string, aliasId: string, createSubscriptionRequestBody: CreateSubscriptionRequestBody, _options?: Configuration): Promise { + const result = this.api.createSubscription(appId, aliasLabel, aliasId, createSubscriptionRequestBody, _options); + return result.toPromise(); + } + + /** + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + * @param appId + * @param user + */ + public createUser(appId: string, user: User, _options?: Configuration): Promise { + const result = this.api.createUser(appId, user, _options); + return result.toPromise(); + } + + /** + * Deletes an alias by alias label + * @param appId + * @param aliasLabel + * @param aliasId + * @param aliasLabelToDelete + */ + public deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: string, _options?: Configuration): Promise { + const result = this.api.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete, _options); + return result.toPromise(); + } + /** * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. * Delete a user record @@ -151,6 +206,27 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Deletes the Subscription. + * @param appId + * @param subscriptionId + */ + public deleteSubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise { + const result = this.api.deleteSubscription(appId, subscriptionId, _options); + return result.toPromise(); + } + + /** + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId + * @param aliasLabel + * @param aliasId + */ + public deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise { + const result = this.api.deleteUser(appId, aliasLabel, aliasId, _options); + return result.toPromise(); + } + /** * Stops a Live Activity * Stop Live Activity @@ -174,6 +250,38 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Lists all Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + */ + public fetchAliases(appId: string, subscriptionId: string, _options?: Configuration): Promise { + const result = this.api.fetchAliases(appId, subscriptionId, _options); + return result.toPromise(); + } + + /** + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId + * @param aliasLabel + * @param aliasId + */ + public fetchUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise { + const result = this.api.fetchUser(appId, aliasLabel, aliasId, _options); + return result.toPromise(); + } + + /** + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId + */ + public fetchUserIdentity(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise { + const result = this.api.fetchUserIdentity(appId, aliasLabel, aliasId, _options); + return result.toPromise(); + } + /** * View the details of a single OneSignal app * View an app @@ -193,6 +301,16 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Manifest of In-App Messages the Subscription is eligible to display by the SDK. + * @param appId + * @param subscriptionId + */ + public getEligibleIams(appId: string, subscriptionId: string, _options?: Configuration): Promise { + const result = this.api.getEligibleIams(appId, subscriptionId, _options); + return result.toPromise(); + } + /** * View the details of a single notification and outcomes associated with it * View notification @@ -267,6 +385,40 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + * @param appId + * @param aliasLabel + * @param aliasId + * @param userIdentityRequestBody + */ + public identifyUserByAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Promise { + const result = this.api.identifyUserByAlias(appId, aliasLabel, aliasId, userIdentityRequestBody, _options); + return result.toPromise(); + } + + /** + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId + * @param subscriptionId + * @param userIdentityRequestBody + */ + public identifyUserBySubscriptionId(appId: string, subscriptionId: string, userIdentityRequestBody: UserIdentityRequestBody, _options?: Configuration): Promise { + const result = this.api.identifyUserBySubscriptionId(appId, subscriptionId, userIdentityRequestBody, _options); + return result.toPromise(); + } + + /** + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId + * @param subscriptionId + * @param transferSubscriptionRequestBody + */ + public transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _options?: Configuration): Promise { + const result = this.api.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody, _options); + return result.toPromise(); + } + /** * Updates the name or configuration settings of an existing OneSignal app * Update an app @@ -313,6 +465,30 @@ export class PromiseDefaultApi { return result.toPromise(); } + /** + * Updates an existing Subscription’s properties. + * @param appId + * @param subscriptionId + * @param updateSubscriptionRequestBody + */ + public updateSubscription(appId: string, subscriptionId: string, updateSubscriptionRequestBody: UpdateSubscriptionRequestBody, _options?: Configuration): Promise { + const result = this.api.updateSubscription(appId, subscriptionId, updateSubscriptionRequestBody, _options); + return result.toPromise(); + } + + /** + * Updates an existing User’s properties. + * @param appId + * @param aliasLabel + * @param aliasId + * @param updateUserRequest + * @param subscriptionId + */ + public updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, subscriptionId?: string, _options?: Configuration): Promise { + const result = this.api.updateUser(appId, aliasLabel, aliasId, updateUserRequest, subscriptionId, _options); + return result.toPromise(); + } + }