Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dadapush/dadapush-csharp-client

DaDaPush Client For Csharp
https://github.com/dadapush/dadapush-csharp-client

dadapush notification-api notifications push push-notifications

Last synced: about 1 month ago
JSON representation

DaDaPush Client For Csharp

Awesome Lists containing this project

README

        

# Com.DaDaPush.Client - the C# library for the DaDaPush Public API

DaDaPush: Real-time Notifications App

Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices.

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

- API version: v1
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
For more information, please visit [https://www.dadapush.com](https://www.dadapush.com)

## Frameworks supported

- .NET 4.0 or later
- Windows Phone 7.1 (Mango)

## Dependencies

- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later

The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:

```
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
```

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)

## Installation

Run the following command to generate the DLL

- [Mac/Linux] `/bin/sh build.sh`
- [Windows] `build.bat`

Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:

```csharp
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

```

## Packaging

A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.

This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:

```
nuget pack -Build -OutputDirectory out Com.DaDaPush.Client.csproj
```

Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.

## Getting Started

```csharp
using System.Diagnostics;
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

namespace Example
{
public class Example
{
public static void Main()
{

Configuration.Default.BasePath = "https://www.dadapush.com";
var apiInstance = new DaDaPushMessageApi(Configuration.Default);
var body = new MessagePushRequest(); // MessagePushRequest | body
var xChannelToken = xChannelToken_example; // string | see: https://www.dadapush.com/channel/list (optional)

try
{
// push Message to a Channel
ResultOfMessagePushResponse result = apiInstance.CreateMessage(body, xChannelToken);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DaDaPushMessageApi.CreateMessage: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}

}
}
}
```

## Documentation for API Endpoints

All URIs are relative to *https://www.dadapush.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DaDaPushMessageApi* | [**CreateMessage**](docs/DaDaPushMessageApi.md#createmessage) | **POST** /api/v1/message | push Message to a Channel
*DaDaPushMessageApi* | [**DeleteMessage**](docs/DaDaPushMessageApi.md#deletemessage) | **DELETE** /api/v1/message/{messageId} | delete a Channel Message
*DaDaPushMessageApi* | [**GetMessage**](docs/DaDaPushMessageApi.md#getmessage) | **GET** /api/v1/message/{messageId} | get a Channel Message
*DaDaPushMessageApi* | [**GetMessages**](docs/DaDaPushMessageApi.md#getmessages) | **GET** /api/v1/messages | get Message List

## Documentation for Models

- [Model.Action](docs/Action.md)
- [Model.MessageObject](docs/MessageObject.md)
- [Model.MessagePushRequest](docs/MessagePushRequest.md)
- [Model.MessagePushResponse](docs/MessagePushResponse.md)
- [Model.PageResponseOfMessageObject](docs/PageResponseOfMessageObject.md)
- [Model.Result](docs/Result.md)
- [Model.ResultOfMessageObject](docs/ResultOfMessageObject.md)
- [Model.ResultOfMessagePushResponse](docs/ResultOfMessagePushResponse.md)
- [Model.ResultOfPageResponseOfMessageObject](docs/ResultOfPageResponseOfMessageObject.md)