Skip to content

Commit

Permalink
Update .NET API
Browse files Browse the repository at this point in the history
  • Loading branch information
OneSignal committed May 13, 2022
1 parent a294eb4 commit f401788
Show file tree
Hide file tree
Showing 74 changed files with 553 additions and 814 deletions.
23 changes: 0 additions & 23 deletions .openapi-generator-ignore

This file was deleted.

102 changes: 0 additions & 102 deletions .openapi-generator/FILES

This file was deleted.

1 change: 0 additions & 1 deletion .openapi-generator/VERSION

This file was deleted.

49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.2
- SDK version: 1.0.2
- API version: 1.0.1
- SDK version: 1.0.1
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
For more information, please visit [https://onesignal.com](https://onesignal.com)

Expand Down Expand Up @@ -71,20 +69,43 @@ namespace Example
{
public static void Main()
{
// Configure configuration with user_key Bearer token for authorization to access endpoints
// that require the OneSignal User Auth Key.
var userConfig = new Configuration();
userConfig.BasePath = "https://onesignal.com/api/v1";
userConfig.AccessToken = "USER_AUTH_KEY";

var userInstance = new DefaultApi(userConfig);

try
{
// Create a new app
var app = new App(name: "Sample App");
var result = userInstance.CreateApp(app);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateApp: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}

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);
// Configure configuration with app_key Bearer token for authorization to access endpoints
// that require the OneSignal App REST API Key.
var appConfig = new Configuration();
appConfig.BasePath = "https://onesignal.com/api/v1";
appConfig.AccessToken = "REST_API_KEY";

var appInstance = new DefaultApi(appConfig);

var appId = "appId_example"; // string |
var notificationId = "notificationId_example"; // string |
try
{
// Stop a scheduled or currently outgoing notification
InlineResponse2001 result = apiInstance.CancelNotification(appId, notificationId);
var result = appInstance.CancelNotification(appId, notificationId);
Debug.WriteLine(result);
}
catch (ApiException e)
Expand All @@ -93,7 +114,6 @@ namespace Example
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}

}
}
}
Expand Down Expand Up @@ -132,7 +152,6 @@ Class | Method | HTTP request | Description

- [Model.App](docs/App.md)
- [Model.Button](docs/Button.md)
- [Model.DateTimeOrLong](docs/DateTimeOrLong.md)
- [Model.DeliveryData](docs/DeliveryData.md)
- [Model.ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)
- [Model.Filter](docs/Filter.md)
Expand All @@ -142,9 +161,9 @@ Class | Method | HTTP request | Description
- [Model.InlineResponse200](docs/InlineResponse200.md)
- [Model.InlineResponse2001](docs/InlineResponse2001.md)
- [Model.InlineResponse2002](docs/InlineResponse2002.md)
- [Model.InlineResponse2003](docs/InlineResponse2003.md)
- [Model.InlineResponse2004](docs/InlineResponse2004.md)
- [Model.InlineResponse2005](docs/InlineResponse2005.md)
- [Model.InlineResponse2007](docs/InlineResponse2007.md)
- [Model.InlineResponse2008](docs/InlineResponse2008.md)
- [Model.InlineResponse201](docs/InlineResponse201.md)
- [Model.InlineResponse400](docs/InlineResponse400.md)
- [Model.InlineResponse4001](docs/InlineResponse4001.md)
Expand Down
18 changes: 9 additions & 9 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Name | Type | Description | Notes

<a name="createplayer"></a>
# **CreatePlayer**
> InlineResponse2003 CreatePlayer (Player player)
> InlineResponse2005 CreatePlayer (Player player)
Add a device

Expand Down Expand Up @@ -283,7 +283,7 @@ namespace Example
try
{
// Add a device
InlineResponse2003 result = apiInstance.CreatePlayer(player);
InlineResponse2005 result = apiInstance.CreatePlayer(player);
Debug.WriteLine(result);
}
catch (ApiException e)
Expand All @@ -305,7 +305,7 @@ Name | Type | Description | Notes

### Return type

[**InlineResponse2003**](InlineResponse2003.md)
[**InlineResponse2005**](InlineResponse2005.md)

### Authorization

Expand Down Expand Up @@ -404,7 +404,7 @@ Name | Type | Description | Notes

<a name="deleteplayer"></a>
# **DeletePlayer**
> InlineResponse2004 DeletePlayer (string appId, string playerId)
> InlineResponse2007 DeletePlayer (string appId, string playerId)
Delete a user record

Expand Down Expand Up @@ -436,7 +436,7 @@ namespace Example
try
{
// Delete a user record
InlineResponse2004 result = apiInstance.DeletePlayer(appId, playerId);
InlineResponse2007 result = apiInstance.DeletePlayer(appId, playerId);
Debug.WriteLine(result);
}
catch (ApiException e)
Expand All @@ -459,7 +459,7 @@ Name | Type | Description | Notes

### Return type

[**InlineResponse2004**](InlineResponse2004.md)
[**InlineResponse2007**](InlineResponse2007.md)

### Authorization

Expand Down Expand Up @@ -560,7 +560,7 @@ Name | Type | Description | Notes

<a name="exportplayers"></a>
# **ExportPlayers**
> InlineResponse2005 ExportPlayers (string appId, ExportPlayersRequestBody exportPlayersRequestBody = null)
> InlineResponse2008 ExportPlayers (string appId, ExportPlayersRequestBody exportPlayersRequestBody = null)
CSV export

Expand Down Expand Up @@ -592,7 +592,7 @@ namespace Example
try
{
// CSV export
InlineResponse2005 result = apiInstance.ExportPlayers(appId, exportPlayersRequestBody);
InlineResponse2008 result = apiInstance.ExportPlayers(appId, exportPlayersRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
Expand All @@ -615,7 +615,7 @@ Name | Type | Description | Notes

### Return type

[**InlineResponse2005**](InlineResponse2005.md)
[**InlineResponse2008**](InlineResponse2008.md)

### Authorization

Expand Down
10 changes: 5 additions & 5 deletions docs/DeliveryData.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Successful** | **int** | | [optional]
**Failed** | **int** | | [optional]
**Errored** | **int** | | [optional]
**Converted** | **int** | | [optional]
**Received** | **int** | | [optional]
**Successful** | **int?** | | [optional]
**Failed** | **int?** | | [optional]
**Errored** | **int?** | | [optional]
**Converted** | **int?** | | [optional]
**Received** | **int?** | | [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)

11 changes: 0 additions & 11 deletions docs/InlineResponse2003.md

This file was deleted.

3 changes: 2 additions & 1 deletion docs/InlineResponse2005.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CsvFileUrl** | **string** | | [optional]
**Success** | **bool** | | [optional]
**Id** | **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)

2 changes: 1 addition & 1 deletion docs/InlineResponse2004.md → docs/InlineResponse2007.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OneSignalSDK.Server.Model.InlineResponse2004
# OneSignalSDK.Server.Model.InlineResponse2007

## Properties

Expand Down
3 changes: 2 additions & 1 deletion docs/DateTimeOrLong.md → docs/InlineResponse2008.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# OneSignalSDK.Server.Model.DateTimeOrLong
# OneSignalSDK.Server.Model.InlineResponse2008

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CsvFileUrl** | **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)

Loading

0 comments on commit f401788

Please sign in to comment.