From 0defd291d7831cf3aa1cfcdc402a7e9da0bbdab7 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 20 Dec 2022 21:17:32 +0000 Subject: [PATCH] Update .NET API --- README.md | 16 +- docs/App.md | 4 + docs/BadRequestError.md | 10 + docs/BeginLiveActivityRequest.md | 11 + docs/DefaultApi.md | 251 ++++++ docs/UpdateLiveActivityRequest.md | 13 + docs/UpdateLiveActivitySuccessResponse.md | 11 + src/OneSignalApi/Api/DefaultApi.cs | 764 +++++++++++++++++- src/OneSignalApi/Client/ApiClient.cs | 4 +- src/OneSignalApi/Client/ApiException.cs | 2 +- src/OneSignalApi/Client/ApiResponse.cs | 2 +- src/OneSignalApi/Client/ClientUtils.cs | 2 +- src/OneSignalApi/Client/Configuration.cs | 10 +- src/OneSignalApi/Client/ExceptionFactory.cs | 2 +- .../Client/GlobalConfiguration.cs | 2 +- src/OneSignalApi/Client/HttpMethod.cs | 2 +- src/OneSignalApi/Client/IApiAccessor.cs | 2 +- .../Client/IAsynchronousClient.cs | 2 +- .../Client/IReadableConfiguration.cs | 2 +- src/OneSignalApi/Client/ISynchronousClient.cs | 2 +- src/OneSignalApi/Client/Multimap.cs | 2 +- .../Client/OpenAPIDateConverter.cs | 2 +- src/OneSignalApi/Client/RequestOptions.cs | 2 +- src/OneSignalApi/Client/RetryConfiguration.cs | 2 +- .../Model/AbstractOpenAPISchema.cs | 2 +- src/OneSignalApi/Model/App.cs | 80 +- src/OneSignalApi/Model/BadRequestError.cs | 130 +++ src/OneSignalApi/Model/BasicNotification.cs | 4 +- .../Model/BasicNotificationAllOf.cs | 4 +- ...otificationAllOfAndroidBackgroundLayout.cs | 2 +- .../Model/BeginLiveActivityRequest.cs | 162 ++++ src/OneSignalApi/Model/Button.cs | 2 +- .../CancelNotificationSuccessResponse.cs | 2 +- .../CreateNotificationSuccessResponse.cs | 2 +- .../Model/CreatePlayerSuccessResponse.cs | 2 +- .../Model/CreateSegmentConflictResponse.cs | 2 +- .../Model/CreateSegmentSuccessResponse.cs | 2 +- .../Model/DeletePlayerNotFoundResponse.cs | 2 +- .../Model/DeletePlayerSuccessResponse.cs | 2 +- .../Model/DeleteSegmentNotFoundResponse.cs | 2 +- .../Model/DeleteSegmentSuccessResponse.cs | 2 +- src/OneSignalApi/Model/DeliveryData.cs | 2 +- .../Model/ExportPlayersRequestBody.cs | 2 +- .../Model/ExportPlayersSuccessResponse.cs | 2 +- src/OneSignalApi/Model/Filter.cs | 2 +- src/OneSignalApi/Model/FilterExpressions.cs | 2 +- .../Model/GetNotificationRequestBody.cs | 2 +- .../Model/InvalidIdentifierError.cs | 2 +- src/OneSignalApi/Model/Notification.cs | 4 +- .../Model/Notification200Errors.cs | 2 +- src/OneSignalApi/Model/NotificationAllOf.cs | 2 +- .../NotificationHistorySuccessResponse.cs | 2 +- src/OneSignalApi/Model/NotificationSlice.cs | 2 +- src/OneSignalApi/Model/NotificationTarget.cs | 2 +- .../Model/NotificationWithMeta.cs | 4 +- .../Model/NotificationWithMetaAllOf.cs | 2 +- src/OneSignalApi/Model/Operator.cs | 2 +- src/OneSignalApi/Model/OutcomeData.cs | 2 +- src/OneSignalApi/Model/OutcomesData.cs | 2 +- .../Model/PlatformDeliveryData.cs | 2 +- .../Model/PlatformDeliveryDataEmailAllOf.cs | 2 +- .../Model/PlatformDeliveryDataSmsAllOf.cs | 2 +- src/OneSignalApi/Model/Player.cs | 2 +- .../Model/PlayerNotificationTarget.cs | 2 +- src/OneSignalApi/Model/PlayerSlice.cs | 2 +- src/OneSignalApi/Model/Purchase.cs | 2 +- src/OneSignalApi/Model/Segment.cs | 2 +- .../Model/SegmentNotificationTarget.cs | 2 +- src/OneSignalApi/Model/StringMap.cs | 2 +- .../Model/UpdateLiveActivityRequest.cs | 236 ++++++ .../UpdateLiveActivitySuccessResponse.cs | 147 ++++ .../Model/UpdatePlayerSuccessResponse.cs | 2 +- .../Model/UpdatePlayerTagsRequestBody.cs | 2 +- .../Model/UpdatePlayerTagsSuccessResponse.cs | 2 +- src/OneSignalApi/OneSignalApi.csproj | 2 +- 75 files changed, 1887 insertions(+), 90 deletions(-) create mode 100644 docs/BadRequestError.md create mode 100644 docs/BeginLiveActivityRequest.md create mode 100644 docs/UpdateLiveActivityRequest.md create mode 100644 docs/UpdateLiveActivitySuccessResponse.md create mode 100644 src/OneSignalApi/Model/BadRequestError.cs create mode 100644 src/OneSignalApi/Model/BeginLiveActivityRequest.cs create mode 100644 src/OneSignalApi/Model/UpdateLiveActivityRequest.cs create mode 100644 src/OneSignalApi/Model/UpdateLiveActivitySuccessResponse.cs diff --git a/README.md b/README.md index 4de67d7..35a6ef6 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -- API version: 1.0.1 -- SDK version: 1.0.3 +- API version: 1.0.2 +- SDK version: 1.0.4 - Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit [https://onesignal.com](https://onesignal.com) @@ -126,6 +126,7 @@ All URIs are relative to *https://onesignal.com/api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**BeginLiveActivity**](docs/DefaultApi.md#beginliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity *DefaultApi* | [**CancelNotification**](docs/DefaultApi.md#cancelnotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification *DefaultApi* | [**CreateApp**](docs/DefaultApi.md#createapp) | **POST** /apps | Create an app *DefaultApi* | [**CreateNotification**](docs/DefaultApi.md#createnotification) | **POST** /notifications | Create notification @@ -133,6 +134,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**CreateSegments**](docs/DefaultApi.md#createsegments) | **POST** /apps/{app_id}/segments | Create Segments *DefaultApi* | [**DeletePlayer**](docs/DefaultApi.md#deleteplayer) | **DELETE** /players/{player_id} | Delete a user record *DefaultApi* | [**DeleteSegments**](docs/DefaultApi.md#deletesegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +*DefaultApi* | [**EndLiveActivity**](docs/DefaultApi.md#endliveactivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *DefaultApi* | [**ExportPlayers**](docs/DefaultApi.md#exportplayers) | **POST** /players/csv_export?app_id={app_id} | CSV export *DefaultApi* | [**GetApp**](docs/DefaultApi.md#getapp) | **GET** /apps/{app_id} | View an app *DefaultApi* | [**GetApps**](docs/DefaultApi.md#getapps) | **GET** /apps | View apps @@ -143,6 +145,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**GetPlayer**](docs/DefaultApi.md#getplayer) | **GET** /players/{player_id} | View device *DefaultApi* | [**GetPlayers**](docs/DefaultApi.md#getplayers) | **GET** /players | View devices *DefaultApi* | [**UpdateApp**](docs/DefaultApi.md#updateapp) | **PUT** /apps/{app_id} | Update an app +*DefaultApi* | [**UpdateLiveActivity**](docs/DefaultApi.md#updateliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push *DefaultApi* | [**UpdatePlayer**](docs/DefaultApi.md#updateplayer) | **PUT** /players/{player_id} | Edit device *DefaultApi* | [**UpdatePlayerTags**](docs/DefaultApi.md#updateplayertags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id @@ -151,21 +154,19 @@ Class | Method | HTTP request | Description ## Documentation for Models - [Model.App](docs/App.md) + - [Model.BadRequestError](docs/BadRequestError.md) - [Model.BasicNotification](docs/BasicNotification.md) - [Model.BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [Model.BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) + - [Model.BeginLiveActivityRequest](docs/BeginLiveActivityRequest.md) - [Model.Button](docs/Button.md) - [Model.CancelNotificationSuccessResponse](docs/CancelNotificationSuccessResponse.md) - - [Model.CreateNotificationBadRequestResponse](docs/CreateNotificationBadRequestResponse.md) - [Model.CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - [Model.CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md) - - [Model.CreateSegmentBadRequestResponse](docs/CreateSegmentBadRequestResponse.md) - [Model.CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [Model.CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) - - [Model.DeletePlayerBadRequestResponse](docs/DeletePlayerBadRequestResponse.md) - [Model.DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md) - [Model.DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md) - - [Model.DeleteSegmentBadRequestResponse](docs/DeleteSegmentBadRequestResponse.md) - [Model.DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md) - [Model.DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md) - [Model.DeliveryData](docs/DeliveryData.md) @@ -178,7 +179,6 @@ Class | Method | HTTP request | Description - [Model.Notification](docs/Notification.md) - [Model.Notification200Errors](docs/Notification200Errors.md) - [Model.NotificationAllOf](docs/NotificationAllOf.md) - - [Model.NotificationHistoryBadRequestResponse](docs/NotificationHistoryBadRequestResponse.md) - [Model.NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md) - [Model.NotificationSlice](docs/NotificationSlice.md) - [Model.NotificationTarget](docs/NotificationTarget.md) @@ -197,6 +197,8 @@ Class | Method | HTTP request | Description - [Model.Segment](docs/Segment.md) - [Model.SegmentNotificationTarget](docs/SegmentNotificationTarget.md) - [Model.StringMap](docs/StringMap.md) + - [Model.UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) + - [Model.UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) - [Model.UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md) - [Model.UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) - [Model.UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md) diff --git a/docs/App.md b/docs/App.md index a73b361..a512f67 100644 --- a/docs/App.md +++ b/docs/App.md @@ -23,6 +23,10 @@ Name | Type | Description | Notes **SafariApnsCertificates** | **string** | | [optional] [readonly] **SafariApnsP12** | **string** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional] **SafariApnsP12Password** | **string** | Safari: Password for safari_apns_p12 file | [optional] +**ApnsKeyId** | **string** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional] +**ApnsTeamId** | **string** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional] +**ApnsBundleId** | **string** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional] +**ApnsP8** | **string** | iOS: Required if using p8. Base64 encoded p8 key | [optional] **SafariSiteOrigin** | **string** | Safari (Recommended): The hostname to your website including http(s):// | [optional] **SafariPushId** | **string** | | [optional] [readonly] **SafariIcon1616** | **string** | | [optional] [readonly] diff --git a/docs/BadRequestError.md b/docs/BadRequestError.md new file mode 100644 index 0000000..7f18136 --- /dev/null +++ b/docs/BadRequestError.md @@ -0,0 +1,10 @@ +# OneSignalApi.Model.BadRequestError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | **List<string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BeginLiveActivityRequest.md b/docs/BeginLiveActivityRequest.md new file mode 100644 index 0000000..b587d7e --- /dev/null +++ b/docs/BeginLiveActivityRequest.md @@ -0,0 +1,11 @@ +# OneSignalApi.Model.BeginLiveActivityRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PushToken** | **string** | | +**SubscriptionId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 1bab7be..cdcdcad 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://onesignal.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**BeginLiveActivity**](DefaultApi.md#beginliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity [**CancelNotification**](DefaultApi.md#cancelnotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification [**CreateApp**](DefaultApi.md#createapp) | **POST** /apps | Create an app [**CreateNotification**](DefaultApi.md#createnotification) | **POST** /notifications | Create notification @@ -11,6 +12,7 @@ Method | HTTP request | Description [**CreateSegments**](DefaultApi.md#createsegments) | **POST** /apps/{app_id}/segments | Create Segments [**DeletePlayer**](DefaultApi.md#deleteplayer) | **DELETE** /players/{player_id} | Delete a user record [**DeleteSegments**](DefaultApi.md#deletesegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +[**EndLiveActivity**](DefaultApi.md#endliveactivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity [**ExportPlayers**](DefaultApi.md#exportplayers) | **POST** /players/csv_export?app_id={app_id} | CSV export [**GetApp**](DefaultApi.md#getapp) | **GET** /apps/{app_id} | View an app [**GetApps**](DefaultApi.md#getapps) | **GET** /apps | View apps @@ -21,10 +23,89 @@ Method | HTTP request | Description [**GetPlayer**](DefaultApi.md#getplayer) | **GET** /players/{player_id} | View device [**GetPlayers**](DefaultApi.md#getplayers) | **GET** /players | View devices [**UpdateApp**](DefaultApi.md#updateapp) | **PUT** /apps/{app_id} | Update an app +[**UpdateLiveActivity**](DefaultApi.md#updateliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push [**UpdatePlayer**](DefaultApi.md#updateplayer) | **PUT** /players/{player_id} | Edit device [**UpdatePlayerTags**](DefaultApi.md#updateplayertags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id + +# **BeginLiveActivity** +> void BeginLiveActivity (string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest) + +Start Live Activity + +Starts a Live Activity + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using OneSignalApi.Api; +using OneSignalApi.Client; +using OneSignalApi.Model; + +namespace Example +{ + public class BeginLiveActivityExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://onesignal.com/api/v1"; + // Configure Bearer token for authorization: app_key + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new DefaultApi(config); + var appId = "appId_example"; // string | The OneSignal App ID for your app. Available in Keys & IDs. + var activityId = "activityId_example"; // string | Live Activity record ID + var beginLiveActivityRequest = new BeginLiveActivityRequest(); // BeginLiveActivityRequest | + + try + { + // Start Live Activity + apiInstance.BeginLiveActivity(appId, activityId, beginLiveActivityRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.BeginLiveActivity: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **activityId** | **string**| Live Activity record ID | + **beginLiveActivityRequest** | [**BeginLiveActivityRequest**](BeginLiveActivityRequest.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **CancelNotification** > CancelNotificationSuccessResponse CancelNotification (string appId, string notificationId) @@ -98,6 +179,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -172,6 +254,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -321,6 +404,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -558,6 +642,84 @@ 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 (string appId, string activityId, string subscriptionId) + +Stop Live Activity + +Stops a Live Activity + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using OneSignalApi.Api; +using OneSignalApi.Client; +using OneSignalApi.Model; + +namespace Example +{ + public class EndLiveActivityExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://onesignal.com/api/v1"; + // Configure Bearer token for authorization: app_key + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new DefaultApi(config); + var appId = "appId_example"; // string | The OneSignal App ID for your app. Available in Keys & IDs. + var activityId = "activityId_example"; // string | Live Activity record ID + var subscriptionId = "subscriptionId_example"; // string | Subscription ID + + try + { + // Stop Live Activity + apiInstance.EndLiveActivity(appId, activityId, subscriptionId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.EndLiveActivity: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **activityId** | **string**| Live Activity record ID | + **subscriptionId** | **string**| Subscription ID | + +### Return type + +void (empty response body) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **ExportPlayers** > ExportPlayersSuccessResponse ExportPlayers (string appId, ExportPlayersRequestBody exportPlayersRequestBody = null) @@ -706,6 +868,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -776,6 +939,7 @@ This endpoint does not need any parameter. | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -852,6 +1016,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1009,6 +1174,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1093,6 +1259,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1171,6 +1338,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1249,6 +1417,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1325,6 +1494,86 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateLiveActivity** +> UpdateLiveActivitySuccessResponse UpdateLiveActivity (string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest) + +Update a Live Activity via Push + +Updates a specified live activity. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using OneSignalApi.Api; +using OneSignalApi.Client; +using OneSignalApi.Model; + +namespace Example +{ + public class UpdateLiveActivityExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://onesignal.com/api/v1"; + // Configure Bearer token for authorization: app_key + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new DefaultApi(config); + var appId = "appId_example"; // string | The OneSignal App ID for your app. Available in Keys & IDs. + var activityId = "activityId_example"; // string | Live Activity record ID + var updateLiveActivityRequest = new UpdateLiveActivityRequest(); // UpdateLiveActivityRequest | + + try + { + // Update a Live Activity via Push + UpdateLiveActivitySuccessResponse result = apiInstance.UpdateLiveActivity(appId, activityId, updateLiveActivityRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UpdateLiveActivity: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **activityId** | **string**| Live Activity record ID | + **updateLiveActivityRequest** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md)| | + +### Return type + +[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md) + +### 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) @@ -1401,6 +1650,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1479,6 +1729,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/UpdateLiveActivityRequest.md b/docs/UpdateLiveActivityRequest.md new file mode 100644 index 0000000..46fdb75 --- /dev/null +++ b/docs/UpdateLiveActivityRequest.md @@ -0,0 +1,13 @@ +# OneSignalApi.Model.UpdateLiveActivityRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Type of live activity | +**Event** | **string** | | +**EventUpdates** | **Object** | | +**DismissAt** | **decimal** | Timestamp; only allowed if event is \"end\" | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UpdateLiveActivitySuccessResponse.md b/docs/UpdateLiveActivitySuccessResponse.md new file mode 100644 index 0000000..097810d --- /dev/null +++ b/docs/UpdateLiveActivitySuccessResponse.md @@ -0,0 +1,11 @@ +# OneSignalApi.Model.UpdateLiveActivitySuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationId** | **string** | | [optional] +**Errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/src/OneSignalApi/Api/DefaultApi.cs b/src/OneSignalApi/Api/DefaultApi.cs index aa0cb91..c4dff58 100644 --- a/src/OneSignalApi/Api/DefaultApi.cs +++ b/src/OneSignalApi/Api/DefaultApi.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -28,6 +28,33 @@ public interface IDefaultApiSync : IApiAccessor { #region Synchronous Operations /// + /// Start Live Activity + /// + /// + /// Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// + void BeginLiveActivity(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0); + + /// + /// Start Live Activity + /// + /// + /// Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse BeginLiveActivityWithHttpInfo(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0); + /// /// Stop a scheduled or currently outgoing notification /// /// @@ -197,6 +224,33 @@ public interface IDefaultApiSync : IApiAccessor /// ApiResponse of DeleteSegmentSuccessResponse ApiResponse DeleteSegmentsWithHttpInfo(string appId, string segmentId, int operationIndex = 0); /// + /// Stop Live Activity + /// + /// + /// Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// + void EndLiveActivity(string appId, string activityId, string subscriptionId, int operationIndex = 0); + + /// + /// Stop Live Activity + /// + /// + /// Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse EndLiveActivityWithHttpInfo(string appId, string activityId, string subscriptionId, int operationIndex = 0); + /// /// CSV export /// /// @@ -457,6 +511,33 @@ public interface IDefaultApiSync : IApiAccessor /// ApiResponse of App ApiResponse UpdateAppWithHttpInfo(string appId, App app, int operationIndex = 0); /// + /// Update a Live Activity via Push + /// + /// + /// Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// UpdateLiveActivitySuccessResponse + UpdateLiveActivitySuccessResponse UpdateLiveActivity(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0); + + /// + /// Update a Live Activity via Push + /// + /// + /// Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// ApiResponse of UpdateLiveActivitySuccessResponse + ApiResponse UpdateLiveActivityWithHttpInfo(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0); + /// /// Edit device /// /// @@ -518,6 +599,35 @@ public interface IDefaultApiAsync : IApiAccessor { #region Asynchronous Operations /// + /// Start Live Activity + /// + /// + /// Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task BeginLiveActivityAsync(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Start Live Activity + /// + /// + /// Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> BeginLiveActivityWithHttpInfoAsync(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stop a scheduled or currently outgoing notification /// /// @@ -701,6 +811,35 @@ public interface IDefaultApiAsync : IApiAccessor /// Task of ApiResponse (DeleteSegmentSuccessResponse) System.Threading.Tasks.Task> DeleteSegmentsWithHttpInfoAsync(string appId, string segmentId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Stop Live Activity + /// + /// + /// Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task EndLiveActivityAsync(string appId, string activityId, string subscriptionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Stop Live Activity + /// + /// + /// Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> EndLiveActivityWithHttpInfoAsync(string appId, string activityId, string subscriptionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// CSV export /// /// @@ -981,6 +1120,35 @@ public interface IDefaultApiAsync : IApiAccessor /// Task of ApiResponse (App) System.Threading.Tasks.Task> UpdateAppWithHttpInfoAsync(string appId, App app, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Update a Live Activity via Push + /// + /// + /// Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UpdateLiveActivitySuccessResponse + System.Threading.Tasks.Task UpdateLiveActivityAsync(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update a Live Activity via Push + /// + /// + /// Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UpdateLiveActivitySuccessResponse) + System.Threading.Tasks.Task> UpdateLiveActivityWithHttpInfoAsync(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Edit device /// /// @@ -1156,6 +1324,198 @@ public OneSignalApi.Client.ExceptionFactory ExceptionFactory set { _exceptionFactory = value; } } + /// + /// Start Live Activity Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// + public void BeginLiveActivity(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0) + { + BeginLiveActivityWithHttpInfo(appId, activityId, beginLiveActivityRequest); + } + + /// + /// Start Live Activity Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public OneSignalApi.Client.ApiResponse BeginLiveActivityWithHttpInfo(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->BeginLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->BeginLiveActivity"); + } + + // verify the required parameter 'beginLiveActivityRequest' is set + if (beginLiveActivityRequest == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'beginLiveActivityRequest' when calling DefaultApi->BeginLiveActivity"); + } + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.Data = beginLiveActivityRequest; + + localVarRequestOptions.Operation = "DefaultApi.BeginLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/apps/{app_id}/live_activities/{activity_id}/token", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("BeginLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Start Live Activity Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task BeginLiveActivityAsync(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await BeginLiveActivityWithHttpInfoAsync(appId, activityId, beginLiveActivityRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Start Live Activity Starts a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> BeginLiveActivityWithHttpInfoAsync(string appId, string activityId, BeginLiveActivityRequest beginLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->BeginLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->BeginLiveActivity"); + } + + // verify the required parameter 'beginLiveActivityRequest' is set + if (beginLiveActivityRequest == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'beginLiveActivityRequest' when calling DefaultApi->BeginLiveActivity"); + } + + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.Data = beginLiveActivityRequest; + + localVarRequestOptions.Operation = "DefaultApi.BeginLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/apps/{app_id}/live_activities/{activity_id}/token", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("BeginLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Stop a scheduled or currently outgoing notification Used to stop a scheduled or currently outgoing notification /// @@ -2317,24 +2677,214 @@ public OneSignalApi.Client.ApiResponse DeleteSegme } /// - /// CSV export Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | - -- | - -- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | - -- | - -- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + /// Stop Live Activity Stops a Live Activity /// /// Thrown when fails to make API call - /// The app ID that you want to export devices from - /// (optional) + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID /// Index associated with the operation. - /// ExportPlayersSuccessResponse - public ExportPlayersSuccessResponse ExportPlayers(string appId, ExportPlayersRequestBody exportPlayersRequestBody = default(ExportPlayersRequestBody), int operationIndex = 0) + /// + public void EndLiveActivity(string appId, string activityId, string subscriptionId, int operationIndex = 0) { - OneSignalApi.Client.ApiResponse localVarResponse = ExportPlayersWithHttpInfo(appId, exportPlayersRequestBody); - return localVarResponse.Data; + EndLiveActivityWithHttpInfo(appId, activityId, subscriptionId); } /// - /// CSV export Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | - -- | - -- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | - -- | - -- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + /// Stop Live Activity Stops a Live Activity /// /// Thrown when fails to make API call - /// The app ID that you want to export devices from + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + public OneSignalApi.Client.ApiResponse EndLiveActivityWithHttpInfo(string appId, string activityId, string subscriptionId, int operationIndex = 0) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->EndLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->EndLiveActivity"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'subscriptionId' when calling DefaultApi->EndLiveActivity"); + } + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.PathParameters.Add("subscription_id", OneSignalApi.Client.ClientUtils.ParameterToString(subscriptionId)); // path parameter + + localVarRequestOptions.Operation = "DefaultApi.EndLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EndLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Stop Live Activity Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task EndLiveActivityAsync(string appId, string activityId, string subscriptionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EndLiveActivityWithHttpInfoAsync(appId, activityId, subscriptionId, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop Live Activity Stops a Live Activity + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// Subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> EndLiveActivityWithHttpInfoAsync(string appId, string activityId, string subscriptionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->EndLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->EndLiveActivity"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'subscriptionId' when calling DefaultApi->EndLiveActivity"); + } + + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.PathParameters.Add("subscription_id", OneSignalApi.Client.ClientUtils.ParameterToString(subscriptionId)); // path parameter + + localVarRequestOptions.Operation = "DefaultApi.EndLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EndLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// CSV export Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | - -- | - -- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | - -- | - -- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + /// + /// Thrown when fails to make API call + /// The app ID that you want to export devices from + /// (optional) + /// Index associated with the operation. + /// ExportPlayersSuccessResponse + public ExportPlayersSuccessResponse ExportPlayers(string appId, ExportPlayersRequestBody exportPlayersRequestBody = default(ExportPlayersRequestBody), int operationIndex = 0) + { + OneSignalApi.Client.ApiResponse localVarResponse = ExportPlayersWithHttpInfo(appId, exportPlayersRequestBody); + return localVarResponse.Data; + } + + /// + /// CSV export Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | - -- | - -- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | - -- | - -- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + /// + /// Thrown when fails to make API call + /// The app ID that you want to export devices from /// (optional) /// Index associated with the operation. /// ApiResponse of ExportPlayersSuccessResponse @@ -4080,6 +4630,200 @@ public OneSignalApi.Client.ApiResponse UpdateAppWithHttpInfo(string appId, return localVarResponse; } + /// + /// Update a Live Activity via Push Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// UpdateLiveActivitySuccessResponse + public UpdateLiveActivitySuccessResponse UpdateLiveActivity(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0) + { + OneSignalApi.Client.ApiResponse localVarResponse = UpdateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); + return localVarResponse.Data; + } + + /// + /// Update a Live Activity via Push Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// ApiResponse of UpdateLiveActivitySuccessResponse + public OneSignalApi.Client.ApiResponse UpdateLiveActivityWithHttpInfo(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->UpdateLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->UpdateLiveActivity"); + } + + // verify the required parameter 'updateLiveActivityRequest' is set + if (updateLiveActivityRequest == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'updateLiveActivityRequest' when calling DefaultApi->UpdateLiveActivity"); + } + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.Data = updateLiveActivityRequest; + + localVarRequestOptions.Operation = "DefaultApi.UpdateLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/apps/{app_id}/live_activities/{activity_id}/notifications", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a Live Activity via Push Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UpdateLiveActivitySuccessResponse + public async System.Threading.Tasks.Task UpdateLiveActivityAsync(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + OneSignalApi.Client.ApiResponse localVarResponse = await UpdateLiveActivityWithHttpInfoAsync(appId, activityId, updateLiveActivityRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update a Live Activity via Push Updates a specified live activity. + /// + /// Thrown when fails to make API call + /// The OneSignal App ID for your app. Available in Keys & IDs. + /// Live Activity record ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UpdateLiveActivitySuccessResponse) + public async System.Threading.Tasks.Task> UpdateLiveActivityWithHttpInfoAsync(string appId, string activityId, UpdateLiveActivityRequest updateLiveActivityRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appId' is set + if (appId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'appId' when calling DefaultApi->UpdateLiveActivity"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'activityId' when calling DefaultApi->UpdateLiveActivity"); + } + + // verify the required parameter 'updateLiveActivityRequest' is set + if (updateLiveActivityRequest == null) + { + throw new OneSignalApi.Client.ApiException(400, "Missing required parameter 'updateLiveActivityRequest' when calling DefaultApi->UpdateLiveActivity"); + } + + + OneSignalApi.Client.RequestOptions localVarRequestOptions = new OneSignalApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = OneSignalApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = OneSignalApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("app_id", OneSignalApi.Client.ClientUtils.ParameterToString(appId)); // path parameter + localVarRequestOptions.PathParameters.Add("activity_id", OneSignalApi.Client.ClientUtils.ParameterToString(activityId)); // path parameter + localVarRequestOptions.Data = updateLiveActivityRequest; + + localVarRequestOptions.Operation = "DefaultApi.UpdateLiveActivity"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (app_key) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/apps/{app_id}/live_activities/{activity_id}/notifications", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateLiveActivity", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Edit device Update an existing device in one of your OneSignal apps /// diff --git a/src/OneSignalApi/Client/ApiClient.cs b/src/OneSignalApi/Client/ApiClient.cs index 5eeceba..137766f 100644 --- a/src/OneSignalApi/Client/ApiClient.cs +++ b/src/OneSignalApi/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -304,7 +304,7 @@ private RestRequest NewRequest( } // Always add the One Signal telemetry to the request. - request.AddHeader("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-dotnet, version=1.0.1"); + request.AddHeader("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-dotnet, version=1.0.2"); if (configuration.DefaultHeaders != null) { diff --git a/src/OneSignalApi/Client/ApiException.cs b/src/OneSignalApi/Client/ApiException.cs index 1e88569..5bc752b 100644 --- a/src/OneSignalApi/Client/ApiException.cs +++ b/src/OneSignalApi/Client/ApiException.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/ApiResponse.cs b/src/OneSignalApi/Client/ApiResponse.cs index f5ecdeb..0b8e592 100644 --- a/src/OneSignalApi/Client/ApiResponse.cs +++ b/src/OneSignalApi/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/ClientUtils.cs b/src/OneSignalApi/Client/ClientUtils.cs index 4c5f8d2..575cf3f 100644 --- a/src/OneSignalApi/Client/ClientUtils.cs +++ b/src/OneSignalApi/Client/ClientUtils.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/Configuration.cs b/src/OneSignalApi/Client/Configuration.cs index 30c2147..be71384 100644 --- a/src/OneSignalApi/Client/Configuration.cs +++ b/src/OneSignalApi/Client/Configuration.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.0.3"; + public const string Version = "1.0.4"; /// /// Identifier for ISO 8601 DateTime Format @@ -109,7 +109,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = "OpenAPI-Generator/1.0.3/csharp"; + UserAgent = "OpenAPI-Generator/1.0.4/csharp"; BasePath = "https://onesignal.com/api/v1"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -516,8 +516,8 @@ public static string ToDebugReport() string report = "C# SDK (OneSignalApi) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 1.0.1\n"; - report += " SDK Package Version: 1.0.3\n"; + report += " Version of the API: 1.0.2\n"; + report += " SDK Package Version: 1.0.4\n"; return report; } diff --git a/src/OneSignalApi/Client/ExceptionFactory.cs b/src/OneSignalApi/Client/ExceptionFactory.cs index 9fcb9a9..1c5ad6a 100644 --- a/src/OneSignalApi/Client/ExceptionFactory.cs +++ b/src/OneSignalApi/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/GlobalConfiguration.cs b/src/OneSignalApi/Client/GlobalConfiguration.cs index f10ca8a..82d3862 100644 --- a/src/OneSignalApi/Client/GlobalConfiguration.cs +++ b/src/OneSignalApi/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/HttpMethod.cs b/src/OneSignalApi/Client/HttpMethod.cs index 8fbffb4..01f9466 100644 --- a/src/OneSignalApi/Client/HttpMethod.cs +++ b/src/OneSignalApi/Client/HttpMethod.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/IApiAccessor.cs b/src/OneSignalApi/Client/IApiAccessor.cs index 56a2fc5..1d8844b 100644 --- a/src/OneSignalApi/Client/IApiAccessor.cs +++ b/src/OneSignalApi/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/IAsynchronousClient.cs b/src/OneSignalApi/Client/IAsynchronousClient.cs index 9a54004..967718b 100644 --- a/src/OneSignalApi/Client/IAsynchronousClient.cs +++ b/src/OneSignalApi/Client/IAsynchronousClient.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/IReadableConfiguration.cs b/src/OneSignalApi/Client/IReadableConfiguration.cs index f5cc2bf..2bf644c 100644 --- a/src/OneSignalApi/Client/IReadableConfiguration.cs +++ b/src/OneSignalApi/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/ISynchronousClient.cs b/src/OneSignalApi/Client/ISynchronousClient.cs index 0440509..0f33a59 100644 --- a/src/OneSignalApi/Client/ISynchronousClient.cs +++ b/src/OneSignalApi/Client/ISynchronousClient.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/Multimap.cs b/src/OneSignalApi/Client/Multimap.cs index 2b473d0..09cf256 100644 --- a/src/OneSignalApi/Client/Multimap.cs +++ b/src/OneSignalApi/Client/Multimap.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/OpenAPIDateConverter.cs b/src/OneSignalApi/Client/OpenAPIDateConverter.cs index 1c2b039..082b3c7 100644 --- a/src/OneSignalApi/Client/OpenAPIDateConverter.cs +++ b/src/OneSignalApi/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/RequestOptions.cs b/src/OneSignalApi/Client/RequestOptions.cs index 27ad3be..6e7685e 100644 --- a/src/OneSignalApi/Client/RequestOptions.cs +++ b/src/OneSignalApi/Client/RequestOptions.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Client/RetryConfiguration.cs b/src/OneSignalApi/Client/RetryConfiguration.cs index 9bf9392..a365c39 100644 --- a/src/OneSignalApi/Client/RetryConfiguration.cs +++ b/src/OneSignalApi/Client/RetryConfiguration.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/AbstractOpenAPISchema.cs b/src/OneSignalApi/Model/AbstractOpenAPISchema.cs index 9768844..f100710 100644 --- a/src/OneSignalApi/Model/AbstractOpenAPISchema.cs +++ b/src/OneSignalApi/Model/AbstractOpenAPISchema.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/App.cs b/src/OneSignalApi/Model/App.cs index 2a8c361..a554f9c 100644 --- a/src/OneSignalApi/Model/App.cs +++ b/src/OneSignalApi/Model/App.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -75,12 +75,16 @@ public enum ApnsEnvEnum /// iOS: Required if using p12 certificate. Password for the apns_p12 file.. /// Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded.. /// Safari: Password for safari_apns_p12 file. + /// iOS: Required if using p8. Unique identifier for the p8 authentication key.. + /// iOS: Required if using p8. Team ID generated by Apple for your developer account.. + /// iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem.. + /// iOS: Required if using p8. Base64 encoded p8 key. /// Safari (Recommended): The hostname to your website including http(s)://. /// Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide.. /// All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it.. /// The Id of the Organization you would like to add this app to.. /// iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload.. - public App(string name = default(string), string androidGcmSenderId = default(string), string gcmKey = default(string), string chromeWebOrigin = default(string), string chromeKey = default(string), string chromeWebDefaultNotificationIcon = default(string), string chromeWebSubDomain = default(string), ApnsEnvEnum? apnsEnv = default(ApnsEnvEnum?), string apnsP12 = default(string), string apnsP12Password = default(string), string safariApnsP12 = default(string), string safariApnsP12Password = default(string), string safariSiteOrigin = default(string), string safariIcon256256 = default(string), string siteName = default(string), string organizationId = default(string), bool additionalDataIsRootPayload = default(bool)) + public App(string name = default(string), string androidGcmSenderId = default(string), string gcmKey = default(string), string chromeWebOrigin = default(string), string chromeKey = default(string), string chromeWebDefaultNotificationIcon = default(string), string chromeWebSubDomain = default(string), ApnsEnvEnum? apnsEnv = default(ApnsEnvEnum?), string apnsP12 = default(string), string apnsP12Password = default(string), string safariApnsP12 = default(string), string safariApnsP12Password = default(string), string apnsKeyId = default(string), string apnsTeamId = default(string), string apnsBundleId = default(string), string apnsP8 = default(string), string safariSiteOrigin = default(string), string safariIcon256256 = default(string), string siteName = default(string), string organizationId = default(string), bool additionalDataIsRootPayload = default(bool)) { this.Name = name; this.AndroidGcmSenderId = androidGcmSenderId; @@ -94,6 +98,10 @@ public enum ApnsEnvEnum this.ApnsP12Password = apnsP12Password; this.SafariApnsP12 = safariApnsP12; this.SafariApnsP12Password = safariApnsP12Password; + this.ApnsKeyId = apnsKeyId; + this.ApnsTeamId = apnsTeamId; + this.ApnsBundleId = apnsBundleId; + this.ApnsP8 = apnsP8; this.SafariSiteOrigin = safariSiteOrigin; this.SafariIcon256256 = safariIcon256256; this.SiteName = siteName; @@ -276,6 +284,34 @@ public bool ShouldSerializeSafariApnsCertificates() [DataMember(Name = "safari_apns_p12_password", EmitDefaultValue = false)] public string SafariApnsP12Password { get; set; } + /// + /// iOS: Required if using p8. Unique identifier for the p8 authentication key. + /// + /// iOS: Required if using p8. Unique identifier for the p8 authentication key. + [DataMember(Name = "apns_key_id", EmitDefaultValue = false)] + public string ApnsKeyId { get; set; } + + /// + /// iOS: Required if using p8. Team ID generated by Apple for your developer account. + /// + /// iOS: Required if using p8. Team ID generated by Apple for your developer account. + [DataMember(Name = "apns_team_id", EmitDefaultValue = false)] + public string ApnsTeamId { get; set; } + + /// + /// iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. + /// + /// iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. + [DataMember(Name = "apns_bundle_id", EmitDefaultValue = false)] + public string ApnsBundleId { get; set; } + + /// + /// iOS: Required if using p8. Base64 encoded p8 key + /// + /// iOS: Required if using p8. Base64 encoded p8 key + [DataMember(Name = "apns_p8", EmitDefaultValue = false)] + public string ApnsP8 { get; set; } + /// /// Safari (Recommended): The hostname to your website including http(s):// /// @@ -422,6 +458,10 @@ public override string ToString() sb.Append(" SafariApnsCertificates: ").Append(SafariApnsCertificates).Append("\n"); sb.Append(" SafariApnsP12: ").Append(SafariApnsP12).Append("\n"); sb.Append(" SafariApnsP12Password: ").Append(SafariApnsP12Password).Append("\n"); + sb.Append(" ApnsKeyId: ").Append(ApnsKeyId).Append("\n"); + sb.Append(" ApnsTeamId: ").Append(ApnsTeamId).Append("\n"); + sb.Append(" ApnsBundleId: ").Append(ApnsBundleId).Append("\n"); + sb.Append(" ApnsP8: ").Append(ApnsP8).Append("\n"); sb.Append(" SafariSiteOrigin: ").Append(SafariSiteOrigin).Append("\n"); sb.Append(" SafariPushId: ").Append(SafariPushId).Append("\n"); sb.Append(" SafariIcon1616: ").Append(SafariIcon1616).Append("\n"); @@ -560,6 +600,26 @@ public bool Equals(App input) (this.SafariApnsP12Password != null && this.SafariApnsP12Password.Equals(input.SafariApnsP12Password)) ) && + ( + this.ApnsKeyId == input.ApnsKeyId || + (this.ApnsKeyId != null && + this.ApnsKeyId.Equals(input.ApnsKeyId)) + ) && + ( + this.ApnsTeamId == input.ApnsTeamId || + (this.ApnsTeamId != null && + this.ApnsTeamId.Equals(input.ApnsTeamId)) + ) && + ( + this.ApnsBundleId == input.ApnsBundleId || + (this.ApnsBundleId != null && + this.ApnsBundleId.Equals(input.ApnsBundleId)) + ) && + ( + this.ApnsP8 == input.ApnsP8 || + (this.ApnsP8 != null && + this.ApnsP8.Equals(input.ApnsP8)) + ) && ( this.SafariSiteOrigin == input.SafariSiteOrigin || (this.SafariSiteOrigin != null && @@ -692,6 +752,22 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.SafariApnsP12Password.GetHashCode(); } + if (this.ApnsKeyId != null) + { + hashCode = (hashCode * 59) + this.ApnsKeyId.GetHashCode(); + } + if (this.ApnsTeamId != null) + { + hashCode = (hashCode * 59) + this.ApnsTeamId.GetHashCode(); + } + if (this.ApnsBundleId != null) + { + hashCode = (hashCode * 59) + this.ApnsBundleId.GetHashCode(); + } + if (this.ApnsP8 != null) + { + hashCode = (hashCode * 59) + this.ApnsP8.GetHashCode(); + } if (this.SafariSiteOrigin != null) { hashCode = (hashCode * 59) + this.SafariSiteOrigin.GetHashCode(); diff --git a/src/OneSignalApi/Model/BadRequestError.cs b/src/OneSignalApi/Model/BadRequestError.cs new file mode 100644 index 0000000..f1cefa9 --- /dev/null +++ b/src/OneSignalApi/Model/BadRequestError.cs @@ -0,0 +1,130 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 1.0.2 + * Contact: devrel@onesignal.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = OneSignalApi.Client.OpenAPIDateConverter; + +namespace OneSignalApi.Model +{ + /// + /// BadRequestError + /// + [DataContract(Name = "BadRequestError")] + public partial class BadRequestError : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// errors. + public BadRequestError(List errors = default(List)) + { + this.Errors = errors; + } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", EmitDefaultValue = false)] + public List Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BadRequestError {\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BadRequestError); + } + + /// + /// Returns true if BadRequestError instances are equal + /// + /// Instance of BadRequestError to be compared + /// Boolean + public bool Equals(BadRequestError input) + { + if (input == null) + { + return false; + } + return + ( + this.Errors == input.Errors || + this.Errors != null && + input.Errors != null && + this.Errors.SequenceEqual(input.Errors) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Errors != null) + { + hashCode = (hashCode * 59) + this.Errors.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/OneSignalApi/Model/BasicNotification.cs b/src/OneSignalApi/Model/BasicNotification.cs index cd60859..35f1cf6 100644 --- a/src/OneSignalApi/Model/BasicNotification.cs +++ b/src/OneSignalApi/Model/BasicNotification.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -481,7 +481,7 @@ public bool ShouldSerializeValue() /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true /// /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true - [DataMember(Name = "external_id", EmitDefaultValue = true)] + [DataMember(Name = "external_id", EmitDefaultValue = false)] public string ExternalId { get; set; } /// diff --git a/src/OneSignalApi/Model/BasicNotificationAllOf.cs b/src/OneSignalApi/Model/BasicNotificationAllOf.cs index a188ed5..94b19af 100644 --- a/src/OneSignalApi/Model/BasicNotificationAllOf.cs +++ b/src/OneSignalApi/Model/BasicNotificationAllOf.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -363,7 +363,7 @@ public bool ShouldSerializeValue() /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true /// /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true - [DataMember(Name = "external_id", EmitDefaultValue = true)] + [DataMember(Name = "external_id", EmitDefaultValue = false)] public string ExternalId { get; set; } /// diff --git a/src/OneSignalApi/Model/BasicNotificationAllOfAndroidBackgroundLayout.cs b/src/OneSignalApi/Model/BasicNotificationAllOfAndroidBackgroundLayout.cs index e5ba9cf..32327d2 100644 --- a/src/OneSignalApi/Model/BasicNotificationAllOfAndroidBackgroundLayout.cs +++ b/src/OneSignalApi/Model/BasicNotificationAllOfAndroidBackgroundLayout.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/BeginLiveActivityRequest.cs b/src/OneSignalApi/Model/BeginLiveActivityRequest.cs new file mode 100644 index 0000000..ef58e94 --- /dev/null +++ b/src/OneSignalApi/Model/BeginLiveActivityRequest.cs @@ -0,0 +1,162 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 1.0.2 + * Contact: devrel@onesignal.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = OneSignalApi.Client.OpenAPIDateConverter; + +namespace OneSignalApi.Model +{ + /// + /// BeginLiveActivityRequest + /// + [DataContract(Name = "BeginLiveActivityRequest")] + public partial class BeginLiveActivityRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BeginLiveActivityRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// pushToken (required). + /// subscriptionId (required). + public BeginLiveActivityRequest(string pushToken = default(string), string subscriptionId = default(string)) + { + // to ensure "pushToken" is required (not null) + if (pushToken == null) + { + throw new ArgumentNullException("pushToken is a required property for BeginLiveActivityRequest and cannot be null"); + } + this.PushToken = pushToken; + // to ensure "subscriptionId" is required (not null) + if (subscriptionId == null) + { + throw new ArgumentNullException("subscriptionId is a required property for BeginLiveActivityRequest and cannot be null"); + } + this.SubscriptionId = subscriptionId; + } + + /// + /// Gets or Sets PushToken + /// + [DataMember(Name = "push_token", IsRequired = true, EmitDefaultValue = false)] + public string PushToken { get; set; } + + /// + /// Gets or Sets SubscriptionId + /// + [DataMember(Name = "subscription_id", IsRequired = true, EmitDefaultValue = false)] + public string SubscriptionId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BeginLiveActivityRequest {\n"); + sb.Append(" PushToken: ").Append(PushToken).Append("\n"); + sb.Append(" SubscriptionId: ").Append(SubscriptionId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BeginLiveActivityRequest); + } + + /// + /// Returns true if BeginLiveActivityRequest instances are equal + /// + /// Instance of BeginLiveActivityRequest to be compared + /// Boolean + public bool Equals(BeginLiveActivityRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.PushToken == input.PushToken || + (this.PushToken != null && + this.PushToken.Equals(input.PushToken)) + ) && + ( + this.SubscriptionId == input.SubscriptionId || + (this.SubscriptionId != null && + this.SubscriptionId.Equals(input.SubscriptionId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PushToken != null) + { + hashCode = (hashCode * 59) + this.PushToken.GetHashCode(); + } + if (this.SubscriptionId != null) + { + hashCode = (hashCode * 59) + this.SubscriptionId.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/OneSignalApi/Model/Button.cs b/src/OneSignalApi/Model/Button.cs index 4e82689..c473677 100644 --- a/src/OneSignalApi/Model/Button.cs +++ b/src/OneSignalApi/Model/Button.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/CancelNotificationSuccessResponse.cs b/src/OneSignalApi/Model/CancelNotificationSuccessResponse.cs index ddb88b5..40d4579 100644 --- a/src/OneSignalApi/Model/CancelNotificationSuccessResponse.cs +++ b/src/OneSignalApi/Model/CancelNotificationSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/CreateNotificationSuccessResponse.cs b/src/OneSignalApi/Model/CreateNotificationSuccessResponse.cs index 9ae35ce..44881c9 100644 --- a/src/OneSignalApi/Model/CreateNotificationSuccessResponse.cs +++ b/src/OneSignalApi/Model/CreateNotificationSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/CreatePlayerSuccessResponse.cs b/src/OneSignalApi/Model/CreatePlayerSuccessResponse.cs index 1f44b10..859ccbc 100644 --- a/src/OneSignalApi/Model/CreatePlayerSuccessResponse.cs +++ b/src/OneSignalApi/Model/CreatePlayerSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/CreateSegmentConflictResponse.cs b/src/OneSignalApi/Model/CreateSegmentConflictResponse.cs index 1c1e9ad..f37a5de 100644 --- a/src/OneSignalApi/Model/CreateSegmentConflictResponse.cs +++ b/src/OneSignalApi/Model/CreateSegmentConflictResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/CreateSegmentSuccessResponse.cs b/src/OneSignalApi/Model/CreateSegmentSuccessResponse.cs index f1120c9..6a72c05 100644 --- a/src/OneSignalApi/Model/CreateSegmentSuccessResponse.cs +++ b/src/OneSignalApi/Model/CreateSegmentSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/DeletePlayerNotFoundResponse.cs b/src/OneSignalApi/Model/DeletePlayerNotFoundResponse.cs index 8244e52..3075cbf 100644 --- a/src/OneSignalApi/Model/DeletePlayerNotFoundResponse.cs +++ b/src/OneSignalApi/Model/DeletePlayerNotFoundResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/DeletePlayerSuccessResponse.cs b/src/OneSignalApi/Model/DeletePlayerSuccessResponse.cs index 25f82a0..a0398f2 100644 --- a/src/OneSignalApi/Model/DeletePlayerSuccessResponse.cs +++ b/src/OneSignalApi/Model/DeletePlayerSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/DeleteSegmentNotFoundResponse.cs b/src/OneSignalApi/Model/DeleteSegmentNotFoundResponse.cs index 2638dbf..fc9af9b 100644 --- a/src/OneSignalApi/Model/DeleteSegmentNotFoundResponse.cs +++ b/src/OneSignalApi/Model/DeleteSegmentNotFoundResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/DeleteSegmentSuccessResponse.cs b/src/OneSignalApi/Model/DeleteSegmentSuccessResponse.cs index 7839196..c4a22be 100644 --- a/src/OneSignalApi/Model/DeleteSegmentSuccessResponse.cs +++ b/src/OneSignalApi/Model/DeleteSegmentSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/DeliveryData.cs b/src/OneSignalApi/Model/DeliveryData.cs index 4a1c3f8..c201823 100644 --- a/src/OneSignalApi/Model/DeliveryData.cs +++ b/src/OneSignalApi/Model/DeliveryData.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/ExportPlayersRequestBody.cs b/src/OneSignalApi/Model/ExportPlayersRequestBody.cs index 3474daf..9fca04b 100644 --- a/src/OneSignalApi/Model/ExportPlayersRequestBody.cs +++ b/src/OneSignalApi/Model/ExportPlayersRequestBody.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/ExportPlayersSuccessResponse.cs b/src/OneSignalApi/Model/ExportPlayersSuccessResponse.cs index a626e1d..7b41e13 100644 --- a/src/OneSignalApi/Model/ExportPlayersSuccessResponse.cs +++ b/src/OneSignalApi/Model/ExportPlayersSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Filter.cs b/src/OneSignalApi/Model/Filter.cs index b17d3bd..b28f7c5 100644 --- a/src/OneSignalApi/Model/Filter.cs +++ b/src/OneSignalApi/Model/Filter.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/FilterExpressions.cs b/src/OneSignalApi/Model/FilterExpressions.cs index 9fd3b0b..9275a09 100644 --- a/src/OneSignalApi/Model/FilterExpressions.cs +++ b/src/OneSignalApi/Model/FilterExpressions.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/GetNotificationRequestBody.cs b/src/OneSignalApi/Model/GetNotificationRequestBody.cs index a1ce368..6e9f94e 100644 --- a/src/OneSignalApi/Model/GetNotificationRequestBody.cs +++ b/src/OneSignalApi/Model/GetNotificationRequestBody.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/InvalidIdentifierError.cs b/src/OneSignalApi/Model/InvalidIdentifierError.cs index 76dedee..f2ae885 100644 --- a/src/OneSignalApi/Model/InvalidIdentifierError.cs +++ b/src/OneSignalApi/Model/InvalidIdentifierError.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Notification.cs b/src/OneSignalApi/Model/Notification.cs index b3f7c08..7e5d1c7 100644 --- a/src/OneSignalApi/Model/Notification.cs +++ b/src/OneSignalApi/Model/Notification.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -483,7 +483,7 @@ public bool ShouldSerializeValue() /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true /// /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true - [DataMember(Name = "external_id", EmitDefaultValue = true)] + [DataMember(Name = "external_id", EmitDefaultValue = false)] public string ExternalId { get; set; } /// diff --git a/src/OneSignalApi/Model/Notification200Errors.cs b/src/OneSignalApi/Model/Notification200Errors.cs index 03b758d..a518fe1 100644 --- a/src/OneSignalApi/Model/Notification200Errors.cs +++ b/src/OneSignalApi/Model/Notification200Errors.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/NotificationAllOf.cs b/src/OneSignalApi/Model/NotificationAllOf.cs index f9480e6..f6e68e1 100644 --- a/src/OneSignalApi/Model/NotificationAllOf.cs +++ b/src/OneSignalApi/Model/NotificationAllOf.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/NotificationHistorySuccessResponse.cs b/src/OneSignalApi/Model/NotificationHistorySuccessResponse.cs index 8d4e643..414cf97 100644 --- a/src/OneSignalApi/Model/NotificationHistorySuccessResponse.cs +++ b/src/OneSignalApi/Model/NotificationHistorySuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/NotificationSlice.cs b/src/OneSignalApi/Model/NotificationSlice.cs index 69fc148..29e2e8a 100644 --- a/src/OneSignalApi/Model/NotificationSlice.cs +++ b/src/OneSignalApi/Model/NotificationSlice.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/NotificationTarget.cs b/src/OneSignalApi/Model/NotificationTarget.cs index 672601f..ed95538 100644 --- a/src/OneSignalApi/Model/NotificationTarget.cs +++ b/src/OneSignalApi/Model/NotificationTarget.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/NotificationWithMeta.cs b/src/OneSignalApi/Model/NotificationWithMeta.cs index 71ae4d5..9b5ba6a 100644 --- a/src/OneSignalApi/Model/NotificationWithMeta.cs +++ b/src/OneSignalApi/Model/NotificationWithMeta.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -503,7 +503,7 @@ public bool ShouldSerializeValue() /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true /// /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true - [DataMember(Name = "external_id", EmitDefaultValue = true)] + [DataMember(Name = "external_id", EmitDefaultValue = false)] public string ExternalId { get; set; } /// diff --git a/src/OneSignalApi/Model/NotificationWithMetaAllOf.cs b/src/OneSignalApi/Model/NotificationWithMetaAllOf.cs index 89d8e7f..3f0eae3 100644 --- a/src/OneSignalApi/Model/NotificationWithMetaAllOf.cs +++ b/src/OneSignalApi/Model/NotificationWithMetaAllOf.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Operator.cs b/src/OneSignalApi/Model/Operator.cs index 6368451..decefcc 100644 --- a/src/OneSignalApi/Model/Operator.cs +++ b/src/OneSignalApi/Model/Operator.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/OutcomeData.cs b/src/OneSignalApi/Model/OutcomeData.cs index 102b462..9cc1c12 100644 --- a/src/OneSignalApi/Model/OutcomeData.cs +++ b/src/OneSignalApi/Model/OutcomeData.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/OutcomesData.cs b/src/OneSignalApi/Model/OutcomesData.cs index d22100b..7df13f9 100644 --- a/src/OneSignalApi/Model/OutcomesData.cs +++ b/src/OneSignalApi/Model/OutcomesData.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/PlatformDeliveryData.cs b/src/OneSignalApi/Model/PlatformDeliveryData.cs index 01f6e5b..4c0735d 100644 --- a/src/OneSignalApi/Model/PlatformDeliveryData.cs +++ b/src/OneSignalApi/Model/PlatformDeliveryData.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/PlatformDeliveryDataEmailAllOf.cs b/src/OneSignalApi/Model/PlatformDeliveryDataEmailAllOf.cs index 54ba235..1607e7d 100644 --- a/src/OneSignalApi/Model/PlatformDeliveryDataEmailAllOf.cs +++ b/src/OneSignalApi/Model/PlatformDeliveryDataEmailAllOf.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/PlatformDeliveryDataSmsAllOf.cs b/src/OneSignalApi/Model/PlatformDeliveryDataSmsAllOf.cs index bfe449e..0e08cf7 100644 --- a/src/OneSignalApi/Model/PlatformDeliveryDataSmsAllOf.cs +++ b/src/OneSignalApi/Model/PlatformDeliveryDataSmsAllOf.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Player.cs b/src/OneSignalApi/Model/Player.cs index a6b0542..fb3fe0b 100644 --- a/src/OneSignalApi/Model/Player.cs +++ b/src/OneSignalApi/Model/Player.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/PlayerNotificationTarget.cs b/src/OneSignalApi/Model/PlayerNotificationTarget.cs index 2633f82..80ec926 100644 --- a/src/OneSignalApi/Model/PlayerNotificationTarget.cs +++ b/src/OneSignalApi/Model/PlayerNotificationTarget.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/PlayerSlice.cs b/src/OneSignalApi/Model/PlayerSlice.cs index 9fd8514..86b849c 100644 --- a/src/OneSignalApi/Model/PlayerSlice.cs +++ b/src/OneSignalApi/Model/PlayerSlice.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Purchase.cs b/src/OneSignalApi/Model/Purchase.cs index 75d05a4..d99d8c6 100644 --- a/src/OneSignalApi/Model/Purchase.cs +++ b/src/OneSignalApi/Model/Purchase.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/Segment.cs b/src/OneSignalApi/Model/Segment.cs index 257a113..10e80f0 100644 --- a/src/OneSignalApi/Model/Segment.cs +++ b/src/OneSignalApi/Model/Segment.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/SegmentNotificationTarget.cs b/src/OneSignalApi/Model/SegmentNotificationTarget.cs index 1b2f9e8..f60d3f8 100644 --- a/src/OneSignalApi/Model/SegmentNotificationTarget.cs +++ b/src/OneSignalApi/Model/SegmentNotificationTarget.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/StringMap.cs b/src/OneSignalApi/Model/StringMap.cs index 7f369e8..97041d3 100644 --- a/src/OneSignalApi/Model/StringMap.cs +++ b/src/OneSignalApi/Model/StringMap.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs b/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs new file mode 100644 index 0000000..dab3fec --- /dev/null +++ b/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs @@ -0,0 +1,236 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 1.0.2 + * Contact: devrel@onesignal.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = OneSignalApi.Client.OpenAPIDateConverter; + +namespace OneSignalApi.Model +{ + /// + /// UpdateLiveActivityRequest + /// + [DataContract(Name = "UpdateLiveActivityRequest")] + public partial class UpdateLiveActivityRequest : IEquatable, IValidatableObject + { + /// + /// Type of live activity + /// + /// Type of live activity + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum Headings for value: headings + /// + [EnumMember(Value = "headings")] + Headings = 1, + + /// + /// Enum Contents for value: contents + /// + [EnumMember(Value = "contents")] + Contents = 2, + + /// + /// Enum IosSound for value: ios_sound + /// + [EnumMember(Value = "ios_sound")] + IosSound = 3, + + /// + /// Enum PriorityLevel for value: priority_level + /// + [EnumMember(Value = "priority_level")] + PriorityLevel = 4 + + } + + + /// + /// Type of live activity + /// + /// Type of live activity + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public NameEnum Name { get; set; } + /// + /// Defines Event + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EventEnum + { + /// + /// Enum Update for value: update + /// + [EnumMember(Value = "update")] + Update = 1, + + /// + /// Enum End for value: end + /// + [EnumMember(Value = "end")] + End = 2 + + } + + + /// + /// Gets or Sets Event + /// + [DataMember(Name = "event", IsRequired = true, EmitDefaultValue = false)] + public EventEnum Event { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UpdateLiveActivityRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Type of live activity (required). + /// _event (required). + /// eventUpdates (required). + /// Timestamp; only allowed if event is \"end\". + public UpdateLiveActivityRequest(NameEnum name = default(NameEnum), EventEnum _event = default(EventEnum), Object eventUpdates = default(Object), decimal dismissAt = default(decimal)) + { + this.Name = name; + this.Event = _event; + // to ensure "eventUpdates" is required (not null) + if (eventUpdates == null) + { + throw new ArgumentNullException("eventUpdates is a required property for UpdateLiveActivityRequest and cannot be null"); + } + this.EventUpdates = eventUpdates; + this.DismissAt = dismissAt; + } + + /// + /// Gets or Sets EventUpdates + /// + [DataMember(Name = "event_updates", IsRequired = true, EmitDefaultValue = false)] + public Object EventUpdates { get; set; } + + /// + /// Timestamp; only allowed if event is \"end\" + /// + /// Timestamp; only allowed if event is \"end\" + [DataMember(Name = "dismiss_at", EmitDefaultValue = false)] + public decimal DismissAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UpdateLiveActivityRequest {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Event: ").Append(Event).Append("\n"); + sb.Append(" EventUpdates: ").Append(EventUpdates).Append("\n"); + sb.Append(" DismissAt: ").Append(DismissAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as UpdateLiveActivityRequest); + } + + /// + /// Returns true if UpdateLiveActivityRequest instances are equal + /// + /// Instance of UpdateLiveActivityRequest to be compared + /// Boolean + public bool Equals(UpdateLiveActivityRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + this.Name.Equals(input.Name) + ) && + ( + this.Event == input.Event || + this.Event.Equals(input.Event) + ) && + ( + this.EventUpdates == input.EventUpdates || + (this.EventUpdates != null && + this.EventUpdates.Equals(input.EventUpdates)) + ) && + ( + this.DismissAt == input.DismissAt || + this.DismissAt.Equals(input.DismissAt) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Event.GetHashCode(); + if (this.EventUpdates != null) + { + hashCode = (hashCode * 59) + this.EventUpdates.GetHashCode(); + } + hashCode = (hashCode * 59) + this.DismissAt.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/OneSignalApi/Model/UpdateLiveActivitySuccessResponse.cs b/src/OneSignalApi/Model/UpdateLiveActivitySuccessResponse.cs new file mode 100644 index 0000000..7ac6799 --- /dev/null +++ b/src/OneSignalApi/Model/UpdateLiveActivitySuccessResponse.cs @@ -0,0 +1,147 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 1.0.2 + * Contact: devrel@onesignal.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = OneSignalApi.Client.OpenAPIDateConverter; + +namespace OneSignalApi.Model +{ + /// + /// UpdateLiveActivitySuccessResponse + /// + [DataContract(Name = "UpdateLiveActivitySuccessResponse")] + public partial class UpdateLiveActivitySuccessResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// notificationId. + /// errors. + public UpdateLiveActivitySuccessResponse(string notificationId = default(string), Notification200Errors errors = default(Notification200Errors)) + { + this.NotificationId = notificationId; + this.Errors = errors; + } + + /// + /// Gets or Sets NotificationId + /// + [DataMember(Name = "notification_id", EmitDefaultValue = false)] + public string NotificationId { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", EmitDefaultValue = false)] + public Notification200Errors Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UpdateLiveActivitySuccessResponse {\n"); + sb.Append(" NotificationId: ").Append(NotificationId).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as UpdateLiveActivitySuccessResponse); + } + + /// + /// Returns true if UpdateLiveActivitySuccessResponse instances are equal + /// + /// Instance of UpdateLiveActivitySuccessResponse to be compared + /// Boolean + public bool Equals(UpdateLiveActivitySuccessResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.NotificationId == input.NotificationId || + (this.NotificationId != null && + this.NotificationId.Equals(input.NotificationId)) + ) && + ( + this.Errors == input.Errors || + (this.Errors != null && + this.Errors.Equals(input.Errors)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NotificationId != null) + { + hashCode = (hashCode * 59) + this.NotificationId.GetHashCode(); + } + if (this.Errors != null) + { + hashCode = (hashCode * 59) + this.Errors.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/OneSignalApi/Model/UpdatePlayerSuccessResponse.cs b/src/OneSignalApi/Model/UpdatePlayerSuccessResponse.cs index f43d53a..c43cbf8 100644 --- a/src/OneSignalApi/Model/UpdatePlayerSuccessResponse.cs +++ b/src/OneSignalApi/Model/UpdatePlayerSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/UpdatePlayerTagsRequestBody.cs b/src/OneSignalApi/Model/UpdatePlayerTagsRequestBody.cs index e8a41bf..84912f4 100644 --- a/src/OneSignalApi/Model/UpdatePlayerTagsRequestBody.cs +++ b/src/OneSignalApi/Model/UpdatePlayerTagsRequestBody.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/Model/UpdatePlayerTagsSuccessResponse.cs b/src/OneSignalApi/Model/UpdatePlayerTagsSuccessResponse.cs index 8370bab..88ce807 100644 --- a/src/OneSignalApi/Model/UpdatePlayerTagsSuccessResponse.cs +++ b/src/OneSignalApi/Model/UpdatePlayerTagsSuccessResponse.cs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.0.1 + * The version of the OpenAPI document: 1.0.2 * Contact: devrel@onesignal.com * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/src/OneSignalApi/OneSignalApi.csproj b/src/OneSignalApi/OneSignalApi.csproj index 128409f..f5c2d37 100644 --- a/src/OneSignalApi/OneSignalApi.csproj +++ b/src/OneSignalApi/OneSignalApi.csproj @@ -12,7 +12,7 @@ OneSignal is a free push notification service for mobile apps. Integrate OneSignal with your backend events, data, and more. Copyrite 2022 OneSignal OneSignalApi - 1.0.3 + 1.0.4 bin\$(Configuration)\$(TargetFramework)\OneSignalApi.xml https://github.com/OneSignal/onesignal-dotnet-api.git git