Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/finbourne/lusid-sdk-csharp
C# SDK for LUSID by FINBOURNE, a bi-temporal investment management data platform with portfolio accounting capabilities.
https://github.com/finbourne/lusid-sdk-csharp
Last synced: 22 days ago
JSON representation
C# SDK for LUSID by FINBOURNE, a bi-temporal investment management data platform with portfolio accounting capabilities.
- Host: GitHub
- URL: https://github.com/finbourne/lusid-sdk-csharp
- Owner: finbourne
- License: other
- Created: 2018-04-09T08:24:33.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T10:43:52.000Z (2 months ago)
- Last Synced: 2024-10-29T12:42:37.994Z (2 months ago)
- Language: C#
- Homepage:
- Size: 486 MB
- Stars: 6
- Watchers: 12
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![LUSID_by_Finbourne](./resources/Finbourne_Logo_Teal.svg)
# C# SDK for the LUSID API
## Contents
- [Summary](#summary)
- [Versions](#versions)
- [Requirements](#requirements)
- [Installation](#installation)
- [Getting Started](#getting-started)
* [Environment variables](#environment-variables)
* [Secrets file](#secrets-file)
* [Example](#example)
- [Endpoints and models](#endpoints-and-models)## Summary
This is the C# SDK for the LUSID API, part of the [LUSID by FINBOURNE](https://www.finbourne.com/lusid-technology) platform. To use it you'll need a LUSID account - [sign up for free at lusid.com](https://www.lusid.com/app/signup).
LUSID is a bi-temporal investment management data platform with portfolio accounting capabilities - see https://support.lusid.com/knowledgebase/ to learn more.
For more details on other applications in the LUSID platform, see [Understanding all the applications in the LUSID platform](https://support.lusid.com/knowledgebase/article/KA-01787).
This sdk supports `Production`, `Early Access`, `Beta` and `Experimental` API endpoints. For more details on API endpoint categories, see [What is the LUSID feature release lifecycle](https://support.lusid.com/knowledgebase/article/KA-01786). To find out which category an API endpoint falls into, see the [swagger page](https://www.lusid.com/api/swagger/index.html).
This code is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
## Versions
- API version: 0.11.7203
- SDK version: 2.0.0## Requirements
- net6.0+
## Installation
The NuGet package for the LUSID API SDK can installed from https://www.nuget.org/packages/Lusid.Sdk using the following
```
$ dotnet add package Lusid.Sdk
```## Getting Started
You'll need to provide some configuration to connect to the LUSID API - see the articles about [short-lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654) and a [long-lived Personal Access Token](https://support.lusid.com/knowledgebase/article/KA-01774). This configuration can be provided using a secrets file or environment variables.
For some configuration it is also possible to override the global configuration at the ApiFactory level, or at the request level. For the set of configuration which can be overridden, please see [ConfigurationOptions](sdk/Lusid.Sdk/Extensions/ConfigurationOptions.cs). For a code illustration of this configuration being overridden, please see the [example](#example).
### Environment variables
Required for a short-lived access token
```
FBN_TOKEN_URL
FBN_LUSID_URL
FBN_USERNAME
FBN_PASSWORD
FBN_CLIENT_ID
FBN_CLIENT_SECRET
```Required for a long-lived access token
```
FBN_LUSID_URL
FBN_ACCESS_TOKEN
```You can send your requests to the LUSID API via a proxy, by setting `FBN_PROXY_ADDRESS`. If your proxy has basic auth enabled, you must also set `FBN_PROXY_USERNAME` and `FBN_PROXY_PASSWORD`.
Other optional configuration
```bash
# the sdk client timeout in milliseconds, the default is 1800000 (30 minutes)
# values must be between 1 and 2147483647
# please note - the chances of seeing a network issue increases with the duration of the request
# for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
FBN_TIMEOUT_MS
# the retries when being rate limited, the default is 2
FBN_RATE_LIMIT_RETRIES
```### Secrets file
The secrets file must be in the current working directory. By default the SDK looks for a secrets file called `secrets.json`
Required for a short-lived access token
```json
{
"api":
{
"tokenUrl":"",
"lusidUrl":"https://.lusid.com/api",
"username":"",
"password":"",
"clientId":"",
"clientSecret":""
}
}
```Required for a long-lived access token
```json
{
"api":
{
"lusidUrl":"https://.lusid.com/api",
"accessToken":""
}
}
```You can send your requests to the LUSID API via a proxy, by adding a proxy section. If your proxy has basic auth enabled, you must also supply a `username` and `password` in this section.
```json
{
"api":
{
"lusidUrl":"https://.lusid.com/api",
"accessToken":""
},
"proxy":
{
"address":"",
"username":"",
"password":""
}
}
```Other optional configuration
```javascript
{
"api":
{
// the sdk client timeout in milliseconds, the default is 1800000 (30 minutes)
// values must be between 1 and 2147483647
// please note - the chances of seeing a network issue increases with the duration of the request
// for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
"timeoutMs":"",
// the retries when being rate limited, the default is 2
"rateLimitRetries":
}
}
```### Example
```csharp
using System.Collections.Generic;
using Lusid.Sdk.Api;
using Lusid.Sdk.Client;
using Lusid.Sdk.Extensions;
using Lusid.Sdk.Model;
using Newtonsoft.Json;namespace Examples
{
public static class Program
{
public static void Main()
{
var secretsFilename = "secrets.json";
var path = Path.Combine(Directory.GetCurrentDirectory(), secretsFilename);
// Replace with the relevant values
File.WriteAllText(
path,
@"{
""api"": {
""tokenUrl"": """",
""lusidUrl"": ""https://.lusid.com/api"",
""username"": """",
""password"": """",
""clientId"": """",
""clientSecret"": """"
}
}");// uncomment the below to use configuration overrides
// var opts = new ConfigurationOptions();
// opts.TimeoutMs = 30_000;// uncomment the below to use an api factory with overrides
// var apiInstance = ApiFactoryBuilder.Build(secretsFilename, opts: opts).Api();var apiInstance = ApiFactoryBuilder.Build(secretsFilename).Api();
var scope = "scope_example"; // string | The scope of the Abor.
var code = "code_example"; // string | The code of the Abor.
var diaryEntryRequest = new DiaryEntryRequest(); // DiaryEntryRequest | The diary entry to add.try
{
// uncomment the below to set overrides at the request level
// DiaryEntry result = apiInstance.AddDiaryEntry(scope, code, diaryEntryRequest, opts: opts);// [EXPERIMENTAL] AddDiaryEntry: Add a diary entry to the specified Abor.
DiaryEntry result = apiInstance.AddDiaryEntry(scope, code, diaryEntryRequest);
Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling AborApi.AddDiaryEntry: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
}
```## Endpoints and models
- See [Documentation for API Endpoints](sdk/README.md#documentation-for-api-endpoints) for a description of each endpoint
- See [Documentation for Models](sdk/README.md#documentation-for-models) for descriptions of the models used