Kralizek / Assembla.Connector

A .NET Standard wrapper for Assembla REST API.
MIT License
3 stars 2 forks source link
assembla dotnet-core dotnet-standard rest-api

This repository contains a series of tools to easily integrate the REST API offered by Assembla. The first tool being worked on is a REST API wrapper that will act as foundation for future tools.

Kralizek.Assembla.Connector

This library contains the REST API wrapper. The idea behind this package is to closely map the available methods. In addition, this library won't validate the correctness of your requests. So, be sure you have the API reference at hand.

Authentication

As stated in the documentation, Assembla API supports four type of authentication of the requests.

This library aims at supporting the first two scenarios out-of-the-box. The remaining scenarios will be supported by extensions packages.

Functionalities

Here is a list of sections of the exposed functionalities.

Implemented

Next in line

Later

Example

Here is a small example of how to query for the list of all the spaces available to the current user

ILoggerFactory loggerFactory = new LoggerFactory();

HttpClient client = new HttpClient { BaseAddress = new Uri(@"https://api.assembla.com") };
client.DefaultRequestHeaders.Add("X-Api-Key", "yourApiKey");
client.DefaultRequestHeaders.Add("X-Api-Secret", "yourSecretKey");

IAssemblaClient assembla = new HttpAssemblaClient(client, loggerFactory.CreateLogger<HttpAssemblaClient>());

var spaces = await assembla.Spaces.GetAllAsync();

spaces.Select(s => new {s.Id, s.WikiName, s.Name}).Dump();

You can execute this script in LinqPad by adding the following packages

or by downloading this script.

Versioning

This repository uses the Semantic Versioning 2.0.0. The packages whose major version is 0 are to be considered in their initial development phase, therefore their public programming interface cannot be considered stable.

Future development

When the wrapper library is complete, additional tools can be built upon it. Ideas I have but are not limited to are

Support

Since I am not affiliated with Assembla in any way, this package might stop working at any moment due to unannounced API changes or similar causes. For these reasons, you use this package at your own risk.

Anyway, if anything breaks, feel free to send a PR with the solution ;)

Disclaimer

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.