Commit c68c63f5 authored by Matija Obreza's avatar Matija Obreza

Updated Readme

parent 2c390877
# GRINGlobal.Client - the C# library for the GRIN-Global CE API
# dotnet library for the GRIN-Global CE API
GG-CE API
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
This is the API client library for GRIN-Global **Community Edition** server. This library does not support SOAP.
- API version: 0.0.1-SNAPSHOT
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
For more information, please visit [https://www.grin-global.org](https://www.grin-global.org)
## 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:
The DLLs included in the package may not be the latest version. Use [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Install-Package RestSharp
......@@ -30,38 +20,6 @@ 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 GRINGlobal.Client.Api;
using GRINGlobal.Client.Client;
using GRINGlobal.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 GRINGlobal.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
......@@ -77,8 +35,11 @@ namespace Example
{
public static void Main()
{
// Base path should point to your instance of GG-CE server
Configuration.Default.BasePath = "http://localhost:8080";
ApiClient client = Configuration.Default.ApiClient;
client.RestClient.Authenticator = new AuthHeaderAuthenticator(client); // see below
var apiInstance = new AccessionApi(Configuration.Default);
var f = f_example; // string | (optional)
var inlineObject = new InlineObject(); // InlineObject | (optional)
......@@ -98,12 +59,27 @@ namespace Example
}
}
internal class AuthHeaderAuthenticator : IAuthenticator
{
private ApiClient client;
public AuthHeaderAuthenticator(ApiClient client)
{
this.client = client;
}
public void Authenticate(IRestClient restClient, IRestRequest request)
{
request.AddHeader("Authorization", "Bearer " + client.Configuration.AccessToken);
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost:8080*
All URIs are relative to the instance of GG-CE server (e.g. *http://localhost:8080*)
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
......@@ -171,23 +147,3 @@ Class | Method | HTTP request | Description
- [Model.WebCooperator](docs/WebCooperator.md)
- [Model.WebUser](docs/WebUser.md)
## Documentation for Authorization
### JWT
- **Type**: HTTP basic authentication
### OAuth2
- **Type**: OAuth
- **Flow**: password
- **Authorization URL**:
- **Scopes**:
- read: Read data on your behalf
- write: Write data on your behalf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment