Generate client with open-api-generator (#1)

* Generate project with open-api-generator

* Add example project

* Create wrapper class
This commit is contained in:
2025-05-26 21:40:46 -03:00
committed by GitHub
parent 311678cfd6
commit d791408793
87 changed files with 24687 additions and 6126 deletions

2
.env.example Normal file
View File

@ -0,0 +1,2 @@
TRIBUFU_API_KEY=""
TRIBUFU_API_URL="https://api.tribufu.com"

4
.gitignore vendored
View File

@ -2,6 +2,8 @@
bin/
obj/
.DS_Store
.env
*.filters
*.user
.DS_Store
desktop.ini

View File

@ -0,0 +1,9 @@
docs/
.gitignore
*.sln
**.csproj
api/openapi.yaml
appveyor.yml
git_push.sh
README.md

60
.openapi-generator/FILES Normal file
View File

@ -0,0 +1,60 @@
src/Tribufu.Generated/Api/TribufuGeneratedApi.cs
src/Tribufu.Generated/Client/ApiClient.cs
src/Tribufu.Generated/Client/ApiException.cs
src/Tribufu.Generated/Client/ApiResponse.cs
src/Tribufu.Generated/Client/ClientUtils.cs
src/Tribufu.Generated/Client/Configuration.cs
src/Tribufu.Generated/Client/ExceptionFactory.cs
src/Tribufu.Generated/Client/GlobalConfiguration.cs
src/Tribufu.Generated/Client/HttpMethod.cs
src/Tribufu.Generated/Client/IApiAccessor.cs
src/Tribufu.Generated/Client/IAsynchronousClient.cs
src/Tribufu.Generated/Client/IReadableConfiguration.cs
src/Tribufu.Generated/Client/ISynchronousClient.cs
src/Tribufu.Generated/Client/Multimap.cs
src/Tribufu.Generated/Client/OpenAPIDateConverter.cs
src/Tribufu.Generated/Client/RequestOptions.cs
src/Tribufu.Generated/Client/RetryConfiguration.cs
src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs
src/Tribufu.Generated/Model/Account.cs
src/Tribufu.Generated/Model/Application.cs
src/Tribufu.Generated/Model/ApplicationType.cs
src/Tribufu.Generated/Model/AuthorizeRequest.cs
src/Tribufu.Generated/Model/CodeChallengeMethod.cs
src/Tribufu.Generated/Model/CryptoViewModel.cs
src/Tribufu.Generated/Model/Game.cs
src/Tribufu.Generated/Model/GameServer.cs
src/Tribufu.Generated/Model/GameServerCluster.cs
src/Tribufu.Generated/Model/GrantType.cs
src/Tribufu.Generated/Model/Group.cs
src/Tribufu.Generated/Model/GroupGame.cs
src/Tribufu.Generated/Model/GroupMember.cs
src/Tribufu.Generated/Model/GroupRank.cs
src/Tribufu.Generated/Model/HashViewModel.cs
src/Tribufu.Generated/Model/IntrospectRequest.cs
src/Tribufu.Generated/Model/IpAddress.cs
src/Tribufu.Generated/Model/LeaderboardItem.cs
src/Tribufu.Generated/Model/LeaderboardOrder.cs
src/Tribufu.Generated/Model/LoginProvider.cs
src/Tribufu.Generated/Model/LoginRequest.cs
src/Tribufu.Generated/Model/LoginResponse.cs
src/Tribufu.Generated/Model/Package.cs
src/Tribufu.Generated/Model/Profile.cs
src/Tribufu.Generated/Model/ProfileGame.cs
src/Tribufu.Generated/Model/ProfileGroup.cs
src/Tribufu.Generated/Model/RefreshRequest.cs
src/Tribufu.Generated/Model/RegisterRequest.cs
src/Tribufu.Generated/Model/ResponseType.cs
src/Tribufu.Generated/Model/RevokeRequest.cs
src/Tribufu.Generated/Model/SearchRequest.cs
src/Tribufu.Generated/Model/SearchType.cs
src/Tribufu.Generated/Model/ServerMetrics.cs
src/Tribufu.Generated/Model/ServerStatus.cs
src/Tribufu.Generated/Model/Subscription.cs
src/Tribufu.Generated/Model/TokenHintType.cs
src/Tribufu.Generated/Model/TokenRequest.cs
src/Tribufu.Generated/Model/TokenResponse.cs
src/Tribufu.Generated/Model/TokenType.cs
src/Tribufu.Generated/Model/UpdateProfile.cs
src/Tribufu.Generated/Model/UserInfo.cs
src/Tribufu.Generated/Model/UserType.cs

View File

@ -0,0 +1 @@
7.12.0

View File

@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Authors>Tribufu</Authors>
<Company>Tribufu</Company>
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
<FileVersion>1.0.0.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
<Version>1.0.0</Version>
<RepositoryUrl>https://github.com/tribufu/sdk-dotnet</RepositoryUrl>
<Version>1.1.0</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<NoWarn>$(NoWarn);0618;1591;1998;2002;8767</NoWarn>
</PropertyGroup>
</Project>

View File

@ -3,8 +3,11 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="dotenv.net" Version="3.2.0" />
<PackageVersion Include="JsonSubTypes" Version="2.0.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Polly" Version="8.1.0" />
<PackageVersion Include="RestSharp" Version="112.1.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>
</Project>

285
README.md
View File

@ -1,20 +1,279 @@
# Tribufu .NET
# Tribufu - the C# library for the Tribufu API
.NET SDK to access Tribufu APIs and services.
REST API to access Tribufu services.
[![MIT License][mit-badge]][mit-url]
[![Discord Chat][discord-badge]][discord-url]
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[mit-url]: https://github.com/tribufu/sdk-dotnet/blob/main/LICENSE.txt
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
[discord-url]: https://www.tribufu.com/discord
- API version: 1.1.0
- SDK version: 1.0.0
- Generator version: 7.8.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
For more information, please visit [https://www.tribufu.com/contact](https://www.tribufu.com/contact)
[Website](https://www.tribufu.com) |
[Discord](https://www.tribufu.com/discord)
<a id="frameworks-supported"></a>
## Frameworks supported
## License
<a id="dependencies"></a>
## Dependencies
This project is licensed under the [MIT License].
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.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 Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
```
<a id="installation"></a>
## 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 Tribufu.Api;
using Tribufu.Client;
using Tribufu.Model;
```
<a id="packaging"></a>
## 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 Tribufu.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.
<a id="usage"></a>
## Usage
To use the API client with a HTTP proxy, setup a `System.Net.WebProxy`
```csharp
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
```
### Connections
Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method.
To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor.
```csharp
HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new YourApiClass(yourHttpClient, yourHandler);
```
If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory.
```csharp
HttpClient yourHttpClient = new HttpClient();
var api = new YourApiClass(yourHttpClient);
```
You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available.
Here an example of DI setup in a sample web project:
```csharp
services.AddHttpClient<YourApiClass>(httpClient =>
new PetApi(httpClient));
```
<a id="getting-started"></a>
## Getting Started
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Tribufu.Api;
using Tribufu.Client;
using Tribufu.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://localhost";
// Configure API key authorization: ApiKey
config.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.ApiKeyPrefix.Add("Authorization", "Bearer");
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new TribufuApi(httpClient, config, httpClientHandler);
var authorizeRequest = new AuthorizeRequest?(); // AuthorizeRequest? | (optional)
try
{
// Authorize the client to access the user information.
apiInstance.Authorize(authorizeRequest);
}
catch (ApiException e)
{
Debug.Print("Exception when calling TribufuApi.Authorize: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
<a id="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints
All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*TribufuApi* | [**Authorize**](docs/TribufuApi.md#authorize) | **POST** /v1/oauth2/authorize | Authorize the client to access the user information.
*TribufuApi* | [**ChangeEmail**](docs/TribufuApi.md#changeemail) | **PUT** /v1/users/{id}/email | Change the email of a user.
*TribufuApi* | [**ChangePassword**](docs/TribufuApi.md#changepassword) | **PUT** /v1/users/{id}/password | Change the password of a user.
*TribufuApi* | [**ClaimGameServer**](docs/TribufuApi.md#claimgameserver) | **PUT** /v1/servers/{id}/claim | Claim a game server.
*TribufuApi* | [**ConvertBase64**](docs/TribufuApi.md#convertbase64) | **POST** /v1/utils/base64 | Convert a string to base64 or vice versa.
*TribufuApi* | [**CreateGameServer**](docs/TribufuApi.md#creategameserver) | **POST** /v1/servers | Create a new game server.
*TribufuApi* | [**CreateGameServerCluster**](docs/TribufuApi.md#creategameservercluster) | **POST** /v1/clusters | Create a new game server cluster.
*TribufuApi* | [**CreateGroup**](docs/TribufuApi.md#creategroup) | **POST** /v1/groups | Create a new group.
*TribufuApi* | [**CreateToken**](docs/TribufuApi.md#createtoken) | **POST** /v1/oauth2/token | Create a new token with grant type.
*TribufuApi* | [**DeleteGameServer**](docs/TribufuApi.md#deletegameserver) | **DELETE** /v1/servers/{id} | Delete a game server.
*TribufuApi* | [**DeleteGameServerCluster**](docs/TribufuApi.md#deletegameservercluster) | **DELETE** /v1/clusters/{id} | Delete a game server cluster.
*TribufuApi* | [**DeleteGroup**](docs/TribufuApi.md#deletegroup) | **DELETE** /v1/groups/{id} | Delete a group.
*TribufuApi* | [**GenerateFlakeId**](docs/TribufuApi.md#generateflakeid) | **GET** /v1/utils/flake | Generate one or more flake ids.
*TribufuApi* | [**GenerateFlakeIdFromTimestamp**](docs/TribufuApi.md#generateflakeidfromtimestamp) | **GET** /v1/utils/flake/{timestamp} | Generate one or more flake ids from a timestamp.
*TribufuApi* | [**GeneratePassword**](docs/TribufuApi.md#generatepassword) | **GET** /v1/utils/password | Generate a random password.
*TribufuApi* | [**GenerateUuid**](docs/TribufuApi.md#generateuuid) | **GET** /v1/utils/uuid | Generate one or more uuids with a specific version.
*TribufuApi* | [**GetClientInfo**](docs/TribufuApi.md#getclientinfo) | **GET** /v1/oauth2/clientinfo | Get current client information.
*TribufuApi* | [**GetCurrentIpAddress**](docs/TribufuApi.md#getcurrentipaddress) | **GET** /v1/geoip | Get current ip address location.
*TribufuApi* | [**GetGameById**](docs/TribufuApi.md#getgamebyid) | **GET** /v1/games/{id} | Get a game by id.
*TribufuApi* | [**GetGameClustersByGameId**](docs/TribufuApi.md#getgameclustersbygameid) | **GET** /v1/games/{id}/clusters | Get a list of game server clusters of a game.
*TribufuApi* | [**GetGameItems**](docs/TribufuApi.md#getgameitems) | **GET** /v1/games/{id}/items | Get a list of game items.
*TribufuApi* | [**GetGameServerByAddressAndQueryPort**](docs/TribufuApi.md#getgameserverbyaddressandqueryport) | **GET** /v1/servers/address/{address}:{port} | Get a game server by address and query port.
*TribufuApi* | [**GetGameServerById**](docs/TribufuApi.md#getgameserverbyid) | **GET** /v1/servers/{id} | Get a game server by id.
*TribufuApi* | [**GetGameServerClusterById**](docs/TribufuApi.md#getgameserverclusterbyid) | **GET** /v1/clusters/{id} | Get a game server cluster by id.
*TribufuApi* | [**GetGameServerClusters**](docs/TribufuApi.md#getgameserverclusters) | **GET** /v1/clusters | Get a list of game server clusters.
*TribufuApi* | [**GetGameServers**](docs/TribufuApi.md#getgameservers) | **GET** /v1/servers | Get a list of game servers.
*TribufuApi* | [**GetGameServersByCountry**](docs/TribufuApi.md#getgameserversbycountry) | **GET** /v1/servers/country/{country} | Get a list of game servers from a country.
*TribufuApi* | [**GetGameServersByGameId**](docs/TribufuApi.md#getgameserversbygameid) | **GET** /v1/games/{id}/servers | Get a list of game servers of a game.
*TribufuApi* | [**GetGameServersCountries**](docs/TribufuApi.md#getgameserverscountries) | **GET** /v1/servers/countries | Get a list of countries with the number of game servers.
*TribufuApi* | [**GetGameServersMetrics**](docs/TribufuApi.md#getgameserversmetrics) | **GET** /v1/servers/metrics | Get metrics about the tracked game servers.
*TribufuApi* | [**GetGames**](docs/TribufuApi.md#getgames) | **GET** /v1/games | Get a list of games.
*TribufuApi* | [**GetGroupById**](docs/TribufuApi.md#getgroupbyid) | **GET** /v1/groups/{id} | Get a group by id.
*TribufuApi* | [**GetGroupByTag**](docs/TribufuApi.md#getgroupbytag) | **GET** /v1/groups/tag/{tag} | Get a group by tag.
*TribufuApi* | [**GetGroupByUuid**](docs/TribufuApi.md#getgroupbyuuid) | **GET** /v1/groups/uuid/{uuid} | Get a group by uuid.
*TribufuApi* | [**GetGroupGames**](docs/TribufuApi.md#getgroupgames) | **GET** /v1/groups/{id}/games | Get a list of games of a group.
*TribufuApi* | [**GetGroupMembers**](docs/TribufuApi.md#getgroupmembers) | **GET** /v1/groups/{id}/members | Get a list of members in a group.
*TribufuApi* | [**GetGroups**](docs/TribufuApi.md#getgroups) | **GET** /v1/groups | Get a list of groups.
*TribufuApi* | [**GetIpAddress**](docs/TribufuApi.md#getipaddress) | **GET** /v1/geoip/addresses/{address} | Get a ip address location.
*TribufuApi* | [**GetIpAddresses**](docs/TribufuApi.md#getipaddresses) | **GET** /v1/geoip/addresses | Get a list of ip addresses.
*TribufuApi* | [**GetLeaderboard**](docs/TribufuApi.md#getleaderboard) | **GET** /v1/leaderboard | Get the top 20 leaderboard users.
*TribufuApi* | [**GetMe**](docs/TribufuApi.md#getme) | **GET** /v1/me | Get current user information.
*TribufuApi* | [**GetPackageById**](docs/TribufuApi.md#getpackagebyid) | **GET** /v1/packages/{id} | Get a package by id.
*TribufuApi* | [**GetPackages**](docs/TribufuApi.md#getpackages) | **GET** /v1/packages | Get a list of packages.
*TribufuApi* | [**GetPublicKeys**](docs/TribufuApi.md#getpublickeys) | **GET** /v1/oauth2/jwks | Get the public keys for the client.
*TribufuApi* | [**GetSubscriptionById**](docs/TribufuApi.md#getsubscriptionbyid) | **GET** /v1/subscriptions/{id} | Get a subscription by id.
*TribufuApi* | [**GetSubscriptions**](docs/TribufuApi.md#getsubscriptions) | **GET** /v1/subscriptions | Get a list of subscriptions.
*TribufuApi* | [**GetUserAccounts**](docs/TribufuApi.md#getuseraccounts) | **GET** /v1/users/{id}/accounts | Get a list of connected accounts of the user.
*TribufuApi* | [**GetUserById**](docs/TribufuApi.md#getuserbyid) | **GET** /v1/users/{id} | Get a user profile by id.
*TribufuApi* | [**GetUserByName**](docs/TribufuApi.md#getuserbyname) | **GET** /v1/users/name/{name} | Get a user profile by name.
*TribufuApi* | [**GetUserByUuid**](docs/TribufuApi.md#getuserbyuuid) | **GET** /v1/users/uuid/{uuid} | Get a user profile by uuid.
*TribufuApi* | [**GetUserFriends**](docs/TribufuApi.md#getuserfriends) | **GET** /v1/users/{id}/friends | Get a list of friends of the user.
*TribufuApi* | [**GetUserGames**](docs/TribufuApi.md#getusergames) | **GET** /v1/users/{id}/games | Get a list of games the user has played.
*TribufuApi* | [**GetUserGroups**](docs/TribufuApi.md#getusergroups) | **GET** /v1/users/{id}/groups | Get a list of groups the user is a member of.
*TribufuApi* | [**GetUserInfo**](docs/TribufuApi.md#getuserinfo) | **GET** /v1/oauth2/userinfo | Get current user information.
*TribufuApi* | [**GetUserPunishments**](docs/TribufuApi.md#getuserpunishments) | **GET** /v1/users/{id}/punishments | Get a list of punishments the user has received.
*TribufuApi* | [**GetUserServers**](docs/TribufuApi.md#getuserservers) | **GET** /v1/users/{id}/servers | Get a list of servers the user is owner of.
*TribufuApi* | [**GetUsers**](docs/TribufuApi.md#getusers) | **GET** /v1/users | Get a list of user profiles.
*TribufuApi* | [**HashArgon2**](docs/TribufuApi.md#hashargon2) | **POST** /v1/utils/argon2 | Hash a string using argon2.
*TribufuApi* | [**HashBcrypt**](docs/TribufuApi.md#hashbcrypt) | **POST** /v1/utils/bcrypt | Hash a string using bcrypt.
*TribufuApi* | [**HashMd5**](docs/TribufuApi.md#hashmd5) | **POST** /v1/utils/md5 | Hash a string using md5.
*TribufuApi* | [**HashSha256**](docs/TribufuApi.md#hashsha256) | **POST** /v1/utils/sha256 | Hash a string using sha256.
*TribufuApi* | [**IntrospectToken**](docs/TribufuApi.md#introspecttoken) | **POST** /v1/oauth2/introspect | Introspect a token.
*TribufuApi* | [**Login**](docs/TribufuApi.md#login) | **POST** /v1/login | Login with name or email and password.
*TribufuApi* | [**Logout**](docs/TribufuApi.md#logout) | **POST** /v1/logout | Invalidate credentials.
*TribufuApi* | [**Refresh**](docs/TribufuApi.md#refresh) | **POST** /v1/refresh | Refresh credentials.
*TribufuApi* | [**Register**](docs/TribufuApi.md#register) | **POST** /v1/register | Create a new user.
*TribufuApi* | [**RevokeToken**](docs/TribufuApi.md#revoketoken) | **POST** /v1/oauth2/revoke | Revoke a token.
*TribufuApi* | [**Search**](docs/TribufuApi.md#search) | **POST** /v1/search | Advanced search for servers or players.
*TribufuApi* | [**UpdateGameServer**](docs/TribufuApi.md#updategameserver) | **PUT** /v1/servers/{id} | Update a game server.
*TribufuApi* | [**UpdateGameServerCluster**](docs/TribufuApi.md#updategameservercluster) | **PUT** /v1/clusters/{id} | Update a game server cluster.
*TribufuApi* | [**UpdateGroup**](docs/TribufuApi.md#updategroup) | **PUT** /v1/groups/{id} | Update a group.
*TribufuApi* | [**UpdateUserProfile**](docs/TribufuApi.md#updateuserprofile) | **PUT** /v1/users/{id}/profile | Update a user profile.
<a id="documentation-for-models"></a>
## Documentation for Models
- [Model.Account](docs/Account.md)
- [Model.Application](docs/Application.md)
- [Model.ApplicationType](docs/ApplicationType.md)
- [Model.AuthorizeRequest](docs/AuthorizeRequest.md)
- [Model.CodeChallengeMethod](docs/CodeChallengeMethod.md)
- [Model.CryptoViewModel](docs/CryptoViewModel.md)
- [Model.Game](docs/Game.md)
- [Model.GameServer](docs/GameServer.md)
- [Model.GameServerCluster](docs/GameServerCluster.md)
- [Model.GrantType](docs/GrantType.md)
- [Model.Group](docs/Group.md)
- [Model.GroupGame](docs/GroupGame.md)
- [Model.GroupMember](docs/GroupMember.md)
- [Model.GroupRank](docs/GroupRank.md)
- [Model.HashViewModel](docs/HashViewModel.md)
- [Model.IntrospectRequest](docs/IntrospectRequest.md)
- [Model.IpAddress](docs/IpAddress.md)
- [Model.LeaderboardItem](docs/LeaderboardItem.md)
- [Model.LeaderboardOrder](docs/LeaderboardOrder.md)
- [Model.LoginProvider](docs/LoginProvider.md)
- [Model.LoginRequest](docs/LoginRequest.md)
- [Model.LoginResponse](docs/LoginResponse.md)
- [Model.Package](docs/Package.md)
- [Model.Profile](docs/Profile.md)
- [Model.ProfileGame](docs/ProfileGame.md)
- [Model.ProfileGroup](docs/ProfileGroup.md)
- [Model.RefreshRequest](docs/RefreshRequest.md)
- [Model.RegisterRequest](docs/RegisterRequest.md)
- [Model.ResponseType](docs/ResponseType.md)
- [Model.RevokeRequest](docs/RevokeRequest.md)
- [Model.SearchRequest](docs/SearchRequest.md)
- [Model.SearchType](docs/SearchType.md)
- [Model.ServerMetrics](docs/ServerMetrics.md)
- [Model.ServerStatus](docs/ServerStatus.md)
- [Model.Subscription](docs/Subscription.md)
- [Model.TokenHintType](docs/TokenHintType.md)
- [Model.TokenRequest](docs/TokenRequest.md)
- [Model.TokenResponse](docs/TokenResponse.md)
- [Model.TokenType](docs/TokenType.md)
- [Model.UpdateProfile](docs/UpdateProfile.md)
- [Model.UserInfo](docs/UserInfo.md)
- [Model.UserType](docs/UserType.md)
<a id="documentation-for-authorization"></a>
## Documentation for Authorization
Authentication schemes defined for the API:
<a id="ApiKey"></a>
### ApiKey
- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header
[MIT License]: https://github.com/tribufu/sdk-dotnet/blob/main/LICENSE.txt

View File

@ -1,50 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Native", "src\Tribufu.Native\Tribufu.Native.csproj", "{C66D6B57-324D-EAF2-3B65-75C9A7C35054}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization", "vendor\dotnet-utils\src\Tribufu.Serialization\Tribufu.Serialization.csproj", "{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization.Newtonsoft", "vendor\dotnet-utils\src\Tribufu.Serialization.Newtonsoft\Tribufu.Serialization.Newtonsoft.csproj", "{B7019B7B-A352-86BD-CCB6-747FB8661927}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Utils", "vendor\dotnet-utils\src\Tribufu.Utils\Tribufu.Utils.csproj", "{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.ComponentModel", "vendor\dotnet-utils\src\Tribufu.ComponentModel\Tribufu.ComponentModel.csproj", "{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.Build.0 = Release|Any CPU
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.Build.0 = Release|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.Build.0 = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.Build.0 = Release|Any CPU
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

60
Tribufu.sln Normal file
View File

@ -0,0 +1,60 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Generated", "src\Tribufu.Generated\Tribufu.Generated.csproj", "{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Example", "src\Tribufu.Example\Tribufu.Example.csproj", "{D6392A29-E2DC-4050-B4C1-B279DD2D226D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.ActiveCfg = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.Build.0 = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.ActiveCfg = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.Build.0 = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.ActiveCfg = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.Build.0 = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.ActiveCfg = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.Build.0 = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x64.ActiveCfg = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x64.Build.0 = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x86.ActiveCfg = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x86.Build.0 = Debug|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|Any CPU.Build.0 = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x64.ActiveCfg = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x64.Build.0 = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x86.ActiveCfg = Release|Any CPU
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x86.Build.0 = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.ActiveCfg = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.Build.0 = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.ActiveCfg = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.Build.0 = Debug|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.Build.0 = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.ActiveCfg = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.Build.0 = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.ActiveCfg = Release|Any CPU
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

12
scripts/generate.ps1 Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env pwsh
$env:CSHARP_POST_PROCESS_FILE = ""
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
-i https://api.tribufu.com/openapi.json `
-g csharp `
-o . `
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
--additional-properties=packageName=Tribufu.Generated,library=restsharp,zeroBasedEnums=true,nullableReferenceTypes=true `
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
--skip-validate-spec

View File

@ -1,3 +0,0 @@
#!/usr/bin/env sh
nswag run ./src/Tribufu/api.nswag

View File

@ -0,0 +1,31 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: UNLICENSED
using dotenv.net;
using Tribufu.Generated.Client;
namespace Tribufu.Test
{
public static class Program
{
public static async Task Main(string[] args)
{
DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"]));
var apiKey = Environment.GetEnvironmentVariable("TRIBUFU_API_KEY");
var tribufu = new TribufuApi(apiKey ?? "");
Console.WriteLine(TribufuApi.GetVersion());
try
{
var result = await tribufu.GetUserInfoAsync();
Console.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
}
}
}

View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Tribufu\Tribufu.csproj" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,823 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Text;
using System.Threading;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using RestSharp;
using RestSharp.Serializers;
using RestSharpMethod = RestSharp.Method;
using FileIO = System.IO.File;
using Polly;
using Tribufu.Generated.Model;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
/// </summary>
internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
{
private readonly IReadableConfiguration _configuration;
private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
{
// OpenAPI generated types generally hide default constructors.
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy
{
OverrideSpecifiedNames = false
}
}
};
public CustomJsonCodec(IReadableConfiguration configuration)
{
_configuration = configuration;
}
public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
{
_serializerSettings = serializerSettings;
_configuration = configuration;
}
/// <summary>
/// Serialize the object into a JSON string.
/// </summary>
/// <param name="obj">Object to be serialized.</param>
/// <returns>A JSON string.</returns>
public string Serialize(object obj)
{
if (obj != null && obj is AbstractOpenAPISchema)
{
// the object to be serialized is an oneOf/anyOf schema
return ((AbstractOpenAPISchema)obj).ToJson();
}
else
{
return JsonConvert.SerializeObject(obj, _serializerSettings);
}
}
public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value);
public T Deserialize<T>(RestResponse response)
{
var result = (T)Deserialize(response, typeof(T));
return result;
}
/// <summary>
/// Deserialize the JSON string into a proper object.
/// </summary>
/// <param name="response">The HTTP response.</param>
/// <param name="type">Object type.</param>
/// <returns>Object representation of the JSON string.</returns>
internal object Deserialize(RestResponse response, Type type)
{
if (type == typeof(byte[])) // return byte array
{
return response.RawBytes;
}
// TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
if (type == typeof(Stream))
{
var bytes = response.RawBytes;
if (response.Headers != null)
{
var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath)
? global::System.IO.Path.GetTempPath()
: _configuration.TempFolderPath;
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
foreach (var header in response.Headers)
{
var match = regex.Match(header.ToString());
if (match.Success)
{
string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
FileIO.WriteAllBytes(fileName, bytes);
return new FileStream(fileName, FileMode.Open);
}
}
}
var stream = new MemoryStream(bytes);
return stream;
}
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
{
return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind);
}
if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
{
return Convert.ChangeType(response.Content, type);
}
// at this point, it must be a model (json)
try
{
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
}
catch (Exception e)
{
throw new ApiException(500, e.Message);
}
}
public ISerializer Serializer => this;
public IDeserializer Deserializer => this;
public string[] AcceptedContentTypes => ContentType.JsonAccept;
public SupportsContentType SupportsContentType => contentType =>
contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ||
contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase);
public ContentType ContentType { get; set; } = ContentType.Json;
public DataFormat DataFormat => DataFormat.Json;
}
/// <summary>
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
/// encapsulating general REST accessor use cases.
/// </summary>
public partial class ApiClient : ISynchronousClient, IAsynchronousClient
{
private readonly string _baseUrl;
/// <summary>
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
/// These settings can be adjusted to accommodate custom serialization rules.
/// </summary>
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
{
// OpenAPI generated types generally hide default constructors.
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy
{
OverrideSpecifiedNames = false
}
}
};
/// <summary>
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
/// </summary>
/// <param name="request">The RestSharp request object</param>
partial void InterceptRequest(RestRequest request);
/// <summary>
/// Allows for extending response processing for <see cref="ApiClient"/> generated code.
/// </summary>
/// <param name="request">The RestSharp request object</param>
/// <param name="response">The RestSharp response object</param>
partial void InterceptResponse(RestRequest request, RestResponse response);
/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
/// </summary>
public ApiClient()
{
_baseUrl = GlobalConfiguration.Instance.BasePath;
}
/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" />
/// </summary>
/// <param name="basePath">The target service's base path in URL format.</param>
/// <exception cref="ArgumentException"></exception>
public ApiClient(string basePath)
{
if (string.IsNullOrEmpty(basePath))
throw new ArgumentException("basePath cannot be empty");
_baseUrl = basePath;
}
/// <summary>
/// Constructs the RestSharp version of an http method
/// </summary>
/// <param name="method">Swagger Client Custom HttpMethod</param>
/// <returns>RestSharp's HttpMethod instance.</returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
private RestSharpMethod Method(HttpMethod method)
{
RestSharpMethod other;
switch (method)
{
case HttpMethod.Get:
other = RestSharpMethod.Get;
break;
case HttpMethod.Post:
other = RestSharpMethod.Post;
break;
case HttpMethod.Put:
other = RestSharpMethod.Put;
break;
case HttpMethod.Delete:
other = RestSharpMethod.Delete;
break;
case HttpMethod.Head:
other = RestSharpMethod.Head;
break;
case HttpMethod.Options:
other = RestSharpMethod.Options;
break;
case HttpMethod.Patch:
other = RestSharpMethod.Patch;
break;
default:
throw new ArgumentOutOfRangeException("method", method, null);
}
return other;
}
/// <summary>
/// Provides all logic for constructing a new RestSharp <see cref="RestRequest"/>.
/// At this point, all information for querying the service is known.
/// Here, it is simply mapped into the RestSharp request.
/// </summary>
/// <param name="method">The http verb.</param>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object.
/// It is assumed that any merge with GlobalConfiguration has been done before calling this method.</param>
/// <returns>[private] A new RestRequest instance.</returns>
/// <exception cref="ArgumentNullException"></exception>
private RestRequest NewRequest(
HttpMethod method,
string path,
RequestOptions options,
IReadableConfiguration configuration)
{
if (path == null) throw new ArgumentNullException("path");
if (options == null) throw new ArgumentNullException("options");
if (configuration == null) throw new ArgumentNullException("configuration");
RestRequest request = new RestRequest(path, Method(method));
if (options.PathParameters != null)
{
foreach (var pathParam in options.PathParameters)
{
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
}
}
if (options.QueryParameters != null)
{
foreach (var queryParam in options.QueryParameters)
{
foreach (var value in queryParam.Value)
{
request.AddQueryParameter(queryParam.Key, value);
}
}
}
if (configuration.DefaultHeaders != null)
{
foreach (var headerParam in configuration.DefaultHeaders)
{
request.AddHeader(headerParam.Key, headerParam.Value);
}
}
if (options.HeaderParameters != null)
{
foreach (var headerParam in options.HeaderParameters)
{
foreach (var value in headerParam.Value)
{
request.AddOrUpdateHeader(headerParam.Key, value);
}
}
}
if (options.FormParameters != null)
{
foreach (var formParam in options.FormParameters)
{
request.AddParameter(formParam.Key, formParam.Value);
}
}
if (options.Data != null)
{
if (options.Data is Stream stream)
{
var contentType = "application/octet-stream";
if (options.HeaderParameters != null)
{
var contentTypes = options.HeaderParameters["Content-Type"];
contentType = contentTypes[0];
}
var bytes = ClientUtils.ReadAsBytes(stream);
request.AddParameter(contentType, bytes, ParameterType.RequestBody);
}
else
{
if (options.HeaderParameters != null)
{
var contentTypes = options.HeaderParameters["Content-Type"];
if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json")))
{
request.RequestFormat = DataFormat.Json;
}
else
{
// TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default.
}
}
else
{
// Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly.
request.RequestFormat = DataFormat.Json;
}
request.AddJsonBody(options.Data);
}
}
if (options.FileParameters != null)
{
foreach (var fileParam in options.FileParameters)
{
foreach (var file in fileParam.Value)
{
var bytes = ClientUtils.ReadAsBytes(file);
var fileStream = file as FileStream;
if (fileStream != null)
request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name));
else
request.AddFile(fileParam.Key, bytes, "no_file_name_provided");
}
}
}
if (options.HeaderParameters != null)
{
if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
{
request.AlwaysMultipartFormData = true;
}
}
return request;
}
/// <summary>
/// Transforms a RestResponse instance into a new ApiResponse instance.
/// At this point, we have a concrete http response from the service.
/// Here, it is simply mapped into the [public] ApiResponse object.
/// </summary>
/// <param name="response">The RestSharp response object</param>
/// <returns>A new ApiResponse instance.</returns>
private ApiResponse<T> ToApiResponse<T>(RestResponse<T> response)
{
T result = response.Data;
string rawContent = response.Content;
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>(), result, rawContent)
{
ErrorText = response.ErrorMessage,
Cookies = new List<Cookie>()
};
if (response.Headers != null)
{
foreach (var responseHeader in response.Headers)
{
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
}
}
if (response.ContentHeaders != null)
{
foreach (var responseHeader in response.ContentHeaders)
{
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
}
}
if (response.Cookies != null)
{
foreach (var responseCookies in response.Cookies.Cast<Cookie>())
{
transformed.Cookies.Add(
new Cookie(
responseCookies.Name,
responseCookies.Value,
responseCookies.Path,
responseCookies.Domain)
);
}
}
return transformed;
}
/// <summary>
/// Executes the HTTP request for the current service.
/// Based on functions received it can be async or sync.
/// </summary>
/// <param name="getResponse">Local function that executes http request and returns http response.</param>
/// <param name="setOptions">Local function to specify options for the service.</param>
/// <param name="request">The RestSharp request object</param>
/// <param name="options">The RestSharp options object</param>
/// <param name="configuration">A per-request configuration object.
/// It is assumed that any merge with GlobalConfiguration has been done before calling this method.</param>
/// <returns>A new ApiResponse instance.</returns>
private async Task<ApiResponse<T>> ExecClientAsync<T>(Func<RestClient, Task<RestResponse<T>>> getResponse, Action<RestClientOptions> setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration)
{
var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
var clientOptions = new RestClientOptions(baseUrl)
{
ClientCertificates = configuration.ClientCertificates,
Timeout = configuration.Timeout,
Proxy = configuration.Proxy,
UserAgent = configuration.UserAgent,
UseDefaultCredentials = configuration.UseDefaultCredentials,
RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
};
setOptions(clientOptions);
using (RestClient client = new RestClient(clientOptions,
configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration))))
{
InterceptRequest(request);
RestResponse<T> response = await getResponse(client);
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
{
try
{
response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
}
catch (Exception ex)
{
throw ex.InnerException != null ? ex.InnerException : ex;
}
}
else if (typeof(T).Name == "Stream") // for binary response
{
response.Data = (T)(object)new MemoryStream(response.RawBytes);
}
else if (typeof(T).Name == "Byte[]") // for byte response
{
response.Data = (T)(object)response.RawBytes;
}
else if (typeof(T).Name == "String") // for string response
{
response.Data = (T)(object)response.Content;
}
InterceptResponse(request, response);
var result = ToApiResponse(response);
if (response.ErrorMessage != null)
{
result.ErrorText = response.ErrorMessage;
}
if (response.Cookies != null && response.Cookies.Count > 0)
{
if (result.Cookies == null) result.Cookies = new List<Cookie>();
foreach (var restResponseCookie in response.Cookies.Cast<Cookie>())
{
var cookie = new Cookie(
restResponseCookie.Name,
restResponseCookie.Value,
restResponseCookie.Path,
restResponseCookie.Domain
)
{
Comment = restResponseCookie.Comment,
CommentUri = restResponseCookie.CommentUri,
Discard = restResponseCookie.Discard,
Expired = restResponseCookie.Expired,
Expires = restResponseCookie.Expires,
HttpOnly = restResponseCookie.HttpOnly,
Port = restResponseCookie.Port,
Secure = restResponseCookie.Secure,
Version = restResponseCookie.Version
};
result.Cookies.Add(cookie);
}
}
return result;
}
}
private async Task<RestResponse<T>> DeserializeRestResponseFromPolicyAsync<T>(RestClient client, RestRequest request, PolicyResult<RestResponse> policyResult, CancellationToken cancellationToken = default)
{
if (policyResult.Outcome == OutcomeType.Successful)
{
return await client.Deserialize<T>(policyResult.Result, cancellationToken);
}
else
{
return new RestResponse<T>(request)
{
ErrorException = policyResult.FinalException
};
}
}
private ApiResponse<T> Exec<T>(RestRequest request, RequestOptions options, IReadableConfiguration configuration)
{
Action<RestClientOptions> setOptions = (clientOptions) =>
{
var cookies = new CookieContainer();
if (options.Cookies != null && options.Cookies.Count > 0)
{
foreach (var cookie in options.Cookies)
{
cookies.Add(new Cookie(cookie.Name, cookie.Value));
}
}
clientOptions.CookieContainer = cookies;
};
Func<RestClient, Task<RestResponse<T>>> getResponse = (client) =>
{
if (RetryConfiguration.RetryPolicy != null)
{
var policy = RetryConfiguration.RetryPolicy;
var policyResult = policy.ExecuteAndCapture(() => client.Execute(request));
return DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult);
}
else
{
return Task.FromResult(client.Execute<T>(request));
}
};
return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult();
}
private Task<ApiResponse<T>> ExecAsync<T>(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken))
{
Action<RestClientOptions> setOptions = (clientOptions) =>
{
//no extra options
};
Func<RestClient, Task<RestResponse<T>>> getResponse = async (client) =>
{
if (RetryConfiguration.AsyncRetryPolicy != null)
{
var policy = RetryConfiguration.AsyncRetryPolicy;
var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false);
return await DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult, cancellationToken);
}
else
{
return await client.ExecuteAsync<T>(request, cancellationToken).ConfigureAwait(false);
}
};
return ExecClientAsync(getResponse, setOptions, request, options, configuration);
}
#region IAsynchronousClient
/// <summary>
/// Make a HTTP GET request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP POST request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP PUT request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP DELETE request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP HEAD request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP OPTION request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken);
}
/// <summary>
/// Make a HTTP PATCH request (async).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken);
}
#endregion IAsynchronousClient
#region ISynchronousClient
/// <summary>
/// Make a HTTP GET request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP POST request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP PUT request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP DELETE request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP HEAD request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP OPTION request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), options, config);
}
/// <summary>
/// Make a HTTP PATCH request (synchronous).
/// </summary>
/// <param name="path">The target path (or resource).</param>
/// <param name="options">The additional request options.</param>
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
/// GlobalConfiguration has been done before calling this method.</param>
/// <returns>A Task containing ApiResponse</returns>
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
{
var config = configuration ?? GlobalConfiguration.Instance;
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config);
}
#endregion ISynchronousClient
}
}

View File

@ -0,0 +1,69 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
namespace Tribufu.Generated.Client
{
/// <summary>
/// API Exception
/// </summary>
public class ApiException : Exception
{
/// <summary>
/// Gets or sets the error code (HTTP status code)
/// </summary>
/// <value>The error code (HTTP status code).</value>
public int ErrorCode { get; set; }
/// <summary>
/// Gets or sets the error content (body json object)
/// </summary>
/// <value>The error content (Http response body).</value>
public object ErrorContent { get; private set; }
/// <summary>
/// Gets or sets the HTTP headers
/// </summary>
/// <value>HTTP headers</value>
public Multimap<string, string> Headers { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
public ApiException() { }
/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
public ApiException(int errorCode, string message) : base(message)
{
this.ErrorCode = errorCode;
}
/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="errorContent">Error content.</param>
/// <param name="headers">HTTP Headers.</param>
public ApiException(int errorCode, string message, object errorContent = null, Multimap<string, string> headers = null) : base(message)
{
this.ErrorCode = errorCode;
this.ErrorContent = errorContent;
this.Headers = headers;
}
}
}

View File

@ -0,0 +1,167 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Net;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Provides a non-generic contract for the ApiResponse wrapper.
/// </summary>
public interface IApiResponse
{
/// <summary>
/// The data type of <see cref="Content"/>
/// </summary>
Type ResponseType { get; }
/// <summary>
/// The content of this response
/// </summary>
Object Content { get; }
/// <summary>
/// Gets or sets the status code (HTTP status code)
/// </summary>
/// <value>The status code.</value>
HttpStatusCode StatusCode { get; }
/// <summary>
/// Gets or sets the HTTP headers
/// </summary>
/// <value>HTTP headers</value>
Multimap<string, string> Headers { get; }
/// <summary>
/// Gets or sets any error text defined by the calling client.
/// </summary>
string ErrorText { get; set; }
/// <summary>
/// Gets or sets any cookies passed along on the response.
/// </summary>
List<Cookie> Cookies { get; set; }
/// <summary>
/// The raw content of this response
/// </summary>
string RawContent { get; }
}
/// <summary>
/// API Response
/// </summary>
public class ApiResponse<T> : IApiResponse
{
#region Properties
/// <summary>
/// Gets or sets the status code (HTTP status code)
/// </summary>
/// <value>The status code.</value>
public HttpStatusCode StatusCode { get; }
/// <summary>
/// Gets or sets the HTTP headers
/// </summary>
/// <value>HTTP headers</value>
public Multimap<string, string> Headers { get; }
/// <summary>
/// Gets or sets the data (parsed HTTP body)
/// </summary>
/// <value>The data.</value>
public T Data { get; }
/// <summary>
/// Gets or sets any error text defined by the calling client.
/// </summary>
public string ErrorText { get; set; }
/// <summary>
/// Gets or sets any cookies passed along on the response.
/// </summary>
public List<Cookie> Cookies { get; set; }
/// <summary>
/// The content of this response
/// </summary>
public Type ResponseType
{
get { return typeof(T); }
}
/// <summary>
/// The data type of <see cref="Content"/>
/// </summary>
public object Content
{
get { return Data; }
}
/// <summary>
/// The raw content
/// </summary>
public string RawContent { get; }
#endregion Properties
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="headers">HTTP headers.</param>
/// <param name="data">Data (parsed HTTP body)</param>
/// <param name="rawContent">Raw content.</param>
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data, string rawContent)
{
StatusCode = statusCode;
Headers = headers;
Data = data;
RawContent = rawContent;
}
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="headers">HTTP headers.</param>
/// <param name="data">Data (parsed HTTP body)</param>
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data) : this(statusCode, headers, data, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="data">Data (parsed HTTP body)</param>
/// <param name="rawContent">Raw content.</param>
public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="data">Data (parsed HTTP body)</param>
public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null)
{
}
#endregion Constructors
}
}

View File

@ -0,0 +1,254 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Utility functions providing some benefit to API client consumers.
/// </summary>
public static class ClientUtils
{
/// <summary>
/// Sanitize filename by removing the path
/// </summary>
/// <param name="filename">Filename</param>
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}
/// <summary>
/// Convert params to key/value pairs.
/// Use collectionFormat to properly format lists and collections.
/// </summary>
/// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param>
/// <param name="name">Key name.</param>
/// <param name="value">Value object.</param>
/// <returns>A multimap of keys with 1..n associated values.</returns>
public static Multimap<string, string> ParameterToMultiMap(string collectionFormat, string name, object value)
{
var parameters = new Multimap<string, string>();
if (value is ICollection collection && collectionFormat == "multi")
{
foreach (var item in collection)
{
parameters.Add(name, ParameterToString(item));
}
}
else if (value is IDictionary dictionary)
{
if(collectionFormat == "deepObject") {
foreach (DictionaryEntry entry in dictionary)
{
parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value));
}
}
else {
foreach (DictionaryEntry entry in dictionary)
{
parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value));
}
}
}
else
{
parameters.Add(name, ParameterToString(value));
}
return parameters;
}
/// <summary>
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
/// If parameter is a list, join the list with ",".
/// Otherwise just return the string.
/// </summary>
/// <param name="obj">The parameter (header, path, query, form).</param>
/// <param name="configuration">An optional configuration instance, providing formatting options used in processing.</param>
/// <returns>Formatted string.</returns>
public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
{
if (obj is DateTime dateTime)
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
// For example: 2009-06-15T13:45:30.0000000
return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
if (obj is DateTimeOffset dateTimeOffset)
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
// For example: 2009-06-15T13:45:30.0000000
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
if (obj is DateOnly dateOnly)
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
// For example: 2009-06-15
return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
if (obj is bool boolean)
return boolean ? "true" : "false";
if (obj is ICollection collection) {
List<string> entries = new List<string>();
foreach (var entry in collection)
entries.Add(ParameterToString(entry, configuration));
return string.Join(",", entries);
}
if (obj is Enum && HasEnumMemberAttrValue(obj))
return GetEnumMemberAttrValue(obj);
return Convert.ToString(obj, CultureInfo.InvariantCulture);
}
/// <summary>
/// Serializes the given object when not null. Otherwise return null.
/// </summary>
/// <param name="obj">The object to serialize.</param>
/// <returns>Serialized string.</returns>
public static string Serialize(object obj)
{
return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null;
}
/// <summary>
/// Encode string in base64 format.
/// </summary>
/// <param name="text">string to be encoded.</param>
/// <returns>Encoded string.</returns>
public static string Base64Encode(string text)
{
return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text));
}
/// <summary>
/// Convert stream to byte array
/// </summary>
/// <param name="inputStream">Input stream to be converted</param>
/// <returns>Byte array</returns>
public static byte[] ReadAsBytes(Stream inputStream)
{
using (var ms = new MemoryStream())
{
inputStream.CopyTo(ms);
return ms.ToArray();
}
}
/// <summary>
/// Select the Content-Type header's value from the given content-type array:
/// if JSON type exists in the given array, use it;
/// otherwise use the first one defined in 'consumes'
/// </summary>
/// <param name="contentTypes">The Content-Type array to select from.</param>
/// <returns>The Content-Type header to use.</returns>
public static string SelectHeaderContentType(string[] contentTypes)
{
if (contentTypes.Length == 0)
return null;
foreach (var contentType in contentTypes)
{
if (IsJsonMime(contentType))
return contentType;
}
return contentTypes[0]; // use the first content type specified in 'consumes'
}
/// <summary>
/// Select the Accept header's value from the given accepts array:
/// if JSON exists in the given array, use it;
/// otherwise use all of them (joining into a string)
/// </summary>
/// <param name="accepts">The accepts array to select from.</param>
/// <returns>The Accept header to use.</returns>
public static string SelectHeaderAccept(string[] accepts)
{
if (accepts.Length == 0)
return null;
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
return "application/json";
return string.Join(",", accepts);
}
/// <summary>
/// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
/// </summary>
public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
/// <summary>
/// Check if the given MIME is a JSON MIME.
/// JSON MIME examples:
/// application/json
/// application/json; charset=UTF8
/// APPLICATION/JSON
/// application/vnd.company+json
/// </summary>
/// <param name="mime">MIME</param>
/// <returns>Returns True if MIME type is json.</returns>
public static bool IsJsonMime(string mime)
{
if (string.IsNullOrWhiteSpace(mime)) return false;
return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json");
}
/// <summary>
/// Is the Enum decorated with EnumMember Attribute
/// </summary>
/// <param name="enumVal"></param>
/// <returns>true if found</returns>
private static bool HasEnumMemberAttrValue(object enumVal)
{
if (enumVal == null)
throw new ArgumentNullException(nameof(enumVal));
var enumType = enumVal.GetType();
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
if (attr != null) return true;
return false;
}
/// <summary>
/// Get the EnumMember value
/// </summary>
/// <param name="enumVal"></param>
/// <returns>EnumMember value as string otherwise null</returns>
private static string GetEnumMemberAttrValue(object enumVal)
{
if (enumVal == null)
throw new ArgumentNullException(nameof(enumVal));
var enumType = enumVal.GetType();
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
if (attr != null)
{
return attr.Value;
}
return null;
}
}
}

View File

@ -0,0 +1,613 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Net.Http;
using System.Net.Security;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Represents a set of configuration settings
/// </summary>
public class Configuration : IReadableConfiguration
{
#region Constants
/// <summary>
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "1.0.0";
/// <summary>
/// Identifier for ISO 8601 DateTime Format
/// </summary>
/// <remarks>See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.</remarks>
// ReSharper disable once InconsistentNaming
public const string ISO8601_DATETIME_FORMAT = "o";
#endregion Constants
#region Static Members
/// <summary>
/// Default creation of exceptions for a given method name and response object
/// </summary>
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
{
var status = (int)response.StatusCode;
if (status >= 400)
{
return new ApiException(status,
string.Format("Error calling {0}: {1}", methodName, response.RawContent),
response.RawContent, response.Headers);
}
if (status == 0)
{
return new ApiException(status,
string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText);
}
return null;
};
#endregion Static Members
#region Private Members
/// <summary>
/// Defines the base path of the target API server.
/// Example: http://localhost:3000/v1/
/// </summary>
private string _basePath;
private bool _useDefaultCredentials = false;
/// <summary>
/// Gets or sets the API key based on the authentication name.
/// This is the key and value comprising the "secret" for accessing an API.
/// </summary>
/// <value>The API key.</value>
private IDictionary<string, string> _apiKey;
/// <summary>
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
/// </summary>
/// <value>The prefix of the API key.</value>
private IDictionary<string, string> _apiKeyPrefix;
private string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
private string _tempFolderPath = Path.GetTempPath();
/// <summary>
/// Gets or sets the servers defined in the OpenAPI spec.
/// </summary>
/// <value>The servers</value>
private IList<IReadOnlyDictionary<string, object>> _servers;
/// <summary>
/// Gets or sets the operation servers defined in the OpenAPI spec.
/// </summary>
/// <value>The operation servers</value>
private IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> _operationServers;
#endregion Private Members
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="Configuration" /> class
/// </summary>
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
public Configuration()
{
Proxy = null;
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
BasePath = "http://localhost";
DefaultHeaders = new ConcurrentDictionary<string, string>();
ApiKey = new ConcurrentDictionary<string, string>();
ApiKeyPrefix = new ConcurrentDictionary<string, string>();
Servers = new List<IReadOnlyDictionary<string, object>>()
{
{
new Dictionary<string, object> {
{"url", ""},
{"description", "No description provided"},
}
}
};
OperationServers = new Dictionary<string, List<IReadOnlyDictionary<string, object>>>()
{
};
// Setting Timeout has side effects (forces ApiClient creation).
Timeout = TimeSpan.FromSeconds(100);
}
/// <summary>
/// Initializes a new instance of the <see cref="Configuration" /> class
/// </summary>
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
public Configuration(
IDictionary<string, string> defaultHeaders,
IDictionary<string, string> apiKey,
IDictionary<string, string> apiKeyPrefix,
string basePath = "http://localhost") : this()
{
if (string.IsNullOrWhiteSpace(basePath))
throw new ArgumentException("The provided basePath is invalid.", "basePath");
if (defaultHeaders == null)
throw new ArgumentNullException("defaultHeaders");
if (apiKey == null)
throw new ArgumentNullException("apiKey");
if (apiKeyPrefix == null)
throw new ArgumentNullException("apiKeyPrefix");
BasePath = basePath;
foreach (var keyValuePair in defaultHeaders)
{
DefaultHeaders.Add(keyValuePair);
}
foreach (var keyValuePair in apiKey)
{
ApiKey.Add(keyValuePair);
}
foreach (var keyValuePair in apiKeyPrefix)
{
ApiKeyPrefix.Add(keyValuePair);
}
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets or sets the base path for API access.
/// </summary>
public virtual string BasePath
{
get { return _basePath; }
set { _basePath = value; }
}
/// <summary>
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
/// </summary>
public virtual bool UseDefaultCredentials
{
get { return _useDefaultCredentials; }
set { _useDefaultCredentials = value; }
}
/// <summary>
/// Gets or sets the default header.
/// </summary>
[Obsolete("Use DefaultHeaders instead.")]
public virtual IDictionary<string, string> DefaultHeader
{
get
{
return DefaultHeaders;
}
set
{
DefaultHeaders = value;
}
}
/// <summary>
/// Gets or sets the default headers.
/// </summary>
public virtual IDictionary<string, string> DefaultHeaders { get; set; }
/// <summary>
/// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds.
/// </summary>
public virtual TimeSpan Timeout { get; set; }
/// <summary>
/// Gets or sets the proxy
/// </summary>
/// <value>Proxy.</value>
public virtual WebProxy Proxy { get; set; }
/// <summary>
/// Gets or sets the HTTP user agent.
/// </summary>
/// <value>Http user agent.</value>
public virtual string UserAgent { get; set; }
/// <summary>
/// Gets or sets the username (HTTP basic authentication).
/// </summary>
/// <value>The username.</value>
public virtual string Username { get; set; }
/// <summary>
/// Gets or sets the password (HTTP basic authentication).
/// </summary>
/// <value>The password.</value>
public virtual string Password { get; set; }
/// <summary>
/// Gets the API key with prefix.
/// </summary>
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
/// <returns>API key with prefix.</returns>
public string GetApiKeyWithPrefix(string apiKeyIdentifier)
{
string apiKeyValue;
ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue);
string apiKeyPrefix;
if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix))
{
return apiKeyPrefix + " " + apiKeyValue;
}
return apiKeyValue;
}
/// <summary>
/// Gets or sets certificate collection to be sent with requests.
/// </summary>
/// <value>X509 Certificate collection.</value>
public X509CertificateCollection ClientCertificates { get; set; }
/// <summary>
/// Gets or sets the access token for OAuth2 authentication.
///
/// This helper property simplifies code generation.
/// </summary>
/// <value>The access token.</value>
public virtual string AccessToken { get; set; }
/// <summary>
/// Gets or sets the temporary folder path to store the files downloaded from the server.
/// </summary>
/// <value>Folder path.</value>
public virtual string TempFolderPath
{
get { return _tempFolderPath; }
set
{
if (string.IsNullOrEmpty(value))
{
_tempFolderPath = Path.GetTempPath();
return;
}
// create the directory if it does not exist
if (!Directory.Exists(value))
{
Directory.CreateDirectory(value);
}
// check if the path contains directory separator at the end
if (value[value.Length - 1] == Path.DirectorySeparatorChar)
{
_tempFolderPath = value;
}
else
{
_tempFolderPath = value + Path.DirectorySeparatorChar;
}
}
}
/// <summary>
/// Gets or sets the date time format used when serializing in the ApiClient
/// By default, it's set to ISO 8601 - "o", for others see:
/// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
/// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
/// No validation is done to ensure that the string you're providing is valid
/// </summary>
/// <value>The DateTimeFormat string</value>
public virtual string DateTimeFormat
{
get { return _dateTimeFormat; }
set
{
if (string.IsNullOrEmpty(value))
{
// Never allow a blank or null string, go back to the default
_dateTimeFormat = ISO8601_DATETIME_FORMAT;
return;
}
// Caution, no validation when you choose date time format other than ISO 8601
// Take a look at the above links
_dateTimeFormat = value;
}
}
/// <summary>
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
///
/// Whatever you set here will be prepended to the value defined in AddApiKey.
///
/// An example invocation here might be:
/// <example>
/// ApiKeyPrefix["Authorization"] = "Bearer";
/// </example>
/// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
///
/// <remarks>
/// OAuth2 workflows should set tokens via AccessToken.
/// </remarks>
/// </summary>
/// <value>The prefix of the API key.</value>
public virtual IDictionary<string, string> ApiKeyPrefix
{
get { return _apiKeyPrefix; }
set
{
if (value == null)
{
throw new InvalidOperationException("ApiKeyPrefix collection may not be null.");
}
_apiKeyPrefix = value;
}
}
/// <summary>
/// Gets or sets the API key based on the authentication name.
/// </summary>
/// <value>The API key.</value>
public virtual IDictionary<string, string> ApiKey
{
get { return _apiKey; }
set
{
if (value == null)
{
throw new InvalidOperationException("ApiKey collection may not be null.");
}
_apiKey = value;
}
}
/// <summary>
/// Gets or sets the servers.
/// </summary>
/// <value>The servers.</value>
public virtual IList<IReadOnlyDictionary<string, object>> Servers
{
get { return _servers; }
set
{
if (value == null)
{
throw new InvalidOperationException("Servers may not be null.");
}
_servers = value;
}
}
/// <summary>
/// Gets or sets the operation servers.
/// </summary>
/// <value>The operation servers.</value>
public virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers
{
get { return _operationServers; }
set
{
if (value == null)
{
throw new InvalidOperationException("Operation servers may not be null.");
}
_operationServers = value;
}
}
/// <summary>
/// Returns URL based on server settings without providing values
/// for the variables
/// </summary>
/// <param name="index">Array index of the server settings.</param>
/// <return>The server URL.</return>
public string GetServerUrl(int index)
{
return GetServerUrl(Servers, index, null);
}
/// <summary>
/// Returns URL based on server settings.
/// </summary>
/// <param name="index">Array index of the server settings.</param>
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
/// <return>The server URL.</return>
public string GetServerUrl(int index, Dictionary<string, string> inputVariables)
{
return GetServerUrl(Servers, index, inputVariables);
}
/// <summary>
/// Returns URL based on operation server settings.
/// </summary>
/// <param name="operation">Operation associated with the request path.</param>
/// <param name="index">Array index of the server settings.</param>
/// <return>The operation server URL.</return>
public string GetOperationServerUrl(string operation, int index)
{
return GetOperationServerUrl(operation, index, null);
}
/// <summary>
/// Returns URL based on operation server settings.
/// </summary>
/// <param name="operation">Operation associated with the request path.</param>
/// <param name="index">Array index of the server settings.</param>
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
/// <return>The operation server URL.</return>
public string GetOperationServerUrl(string operation, int index, Dictionary<string, string> inputVariables)
{
if (operation != null && OperationServers.TryGetValue(operation, out var operationServer))
{
return GetServerUrl(operationServer, index, inputVariables);
}
return null;
}
/// <summary>
/// Returns URL based on server settings.
/// </summary>
/// <param name="servers">Dictionary of server settings.</param>
/// <param name="index">Array index of the server settings.</param>
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
/// <return>The server URL.</return>
private string GetServerUrl(IList<IReadOnlyDictionary<string, object>> servers, int index, Dictionary<string, string> inputVariables)
{
if (index < 0 || index >= servers.Count)
{
throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}.");
}
if (inputVariables == null)
{
inputVariables = new Dictionary<string, string>();
}
IReadOnlyDictionary<string, object> server = servers[index];
string url = (string)server["url"];
if (server.ContainsKey("variables"))
{
// go through each variable and assign a value
foreach (KeyValuePair<string, object> variable in (IReadOnlyDictionary<string, object>)server["variables"])
{
IReadOnlyDictionary<string, object> serverVariables = (IReadOnlyDictionary<string, object>)(variable.Value);
if (inputVariables.ContainsKey(variable.Key))
{
if (((List<string>)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
{
url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]);
}
else
{
throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List<string>)serverVariables["enum_values"]}");
}
}
else
{
// use default value
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
}
}
}
return url;
}
/// <summary>
/// Gets and Sets the RemoteCertificateValidationCallback
/// </summary>
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
#endregion Properties
#region Methods
/// <summary>
/// Returns a string with essential information for debugging.
/// </summary>
public static string ToDebugReport()
{
string report = "C# SDK (Tribufu.Generated) Debug Report:\n";
report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " Version of the API: 1.1.0\n";
report += " SDK Package Version: 1.0.0\n";
return report;
}
/// <summary>
/// Add Api Key Header.
/// </summary>
/// <param name="key">Api Key name.</param>
/// <param name="value">Api Key value.</param>
/// <returns></returns>
public void AddApiKey(string key, string value)
{
ApiKey[key] = value;
}
/// <summary>
/// Sets the API key prefix.
/// </summary>
/// <param name="key">Api Key name.</param>
/// <param name="value">Api Key value.</param>
public void AddApiKeyPrefix(string key, string value)
{
ApiKeyPrefix[key] = value;
}
#endregion Methods
#region Static Members
/// <summary>
/// Merge configurations.
/// </summary>
/// <param name="first">First configuration.</param>
/// <param name="second">Second configuration.</param>
/// <return>Merged configuration.</return>
public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)
{
if (second == null) return first ?? GlobalConfiguration.Instance;
Dictionary<string, string> apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Dictionary<string, string> apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Dictionary<string, string> defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value;
foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value;
foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value;
var config = new Configuration
{
ApiKey = apiKey,
ApiKeyPrefix = apiKeyPrefix,
DefaultHeaders = defaultHeaders,
BasePath = second.BasePath ?? first.BasePath,
Timeout = second.Timeout,
Proxy = second.Proxy ?? first.Proxy,
UserAgent = second.UserAgent ?? first.UserAgent,
Username = second.Username ?? first.Username,
Password = second.Password ?? first.Password,
AccessToken = second.AccessToken ?? first.AccessToken,
TempFolderPath = second.TempFolderPath ?? first.TempFolderPath,
DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat,
ClientCertificates = second.ClientCertificates ?? first.ClientCertificates,
UseDefaultCredentials = second.UseDefaultCredentials,
RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback,
};
return config;
}
#endregion Static Members
}
}

View File

@ -0,0 +1,23 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
namespace Tribufu.Generated.Client
{
/// <summary>
/// A delegate to ExceptionFactory method
/// </summary>
/// <param name="methodName">Method name</param>
/// <param name="response">Response</param>
/// <returns>Exceptions</returns>
public delegate Exception ExceptionFactory(string methodName, IApiResponse response);
}

View File

@ -0,0 +1,68 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System.Collections.Generic;
namespace Tribufu.Generated.Client
{
/// <summary>
/// <see cref="GlobalConfiguration"/> provides a compile-time extension point for globally configuring
/// API Clients.
/// </summary>
/// <remarks>
/// A customized implementation via partial class may reside in another file and may
/// be excluded from automatic generation via a .openapi-generator-ignore file.
/// </remarks>
public partial class GlobalConfiguration : Configuration
{
#region Private Members
private static readonly object GlobalConfigSync = new { };
private static IReadableConfiguration _globalConfiguration;
#endregion Private Members
#region Constructors
/// <inheritdoc />
private GlobalConfiguration()
{
}
/// <inheritdoc />
public GlobalConfiguration(IDictionary<string, string> defaultHeader, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath)
{
}
static GlobalConfiguration()
{
Instance = new GlobalConfiguration();
}
#endregion Constructors
/// <summary>
/// Gets or sets the default Configuration.
/// </summary>
/// <value>Configuration.</value>
public static IReadableConfiguration Instance
{
get { return _globalConfiguration; }
set
{
lock (GlobalConfigSync)
{
_globalConfiguration = value;
}
}
}
}
}

View File

@ -0,0 +1,34 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
namespace Tribufu.Generated.Client
{
/// <summary>
/// Http methods supported by swagger
/// </summary>
public enum HttpMethod
{
/// <summary>HTTP GET request.</summary>
Get,
/// <summary>HTTP POST request.</summary>
Post,
/// <summary>HTTP PUT request.</summary>
Put,
/// <summary>HTTP DELETE request.</summary>
Delete,
/// <summary>HTTP HEAD request.</summary>
Head,
/// <summary>HTTP OPTIONS request.</summary>
Options,
/// <summary>HTTP PATCH request.</summary>
Patch
}
}

View File

@ -0,0 +1,38 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Represents configuration aspects required to interact with the API endpoints.
/// </summary>
public interface IApiAccessor
{
/// <summary>
/// Gets or sets the configuration object
/// </summary>
/// <value>An instance of the Configuration</value>
IReadableConfiguration Configuration { get; set; }
/// <summary>
/// Gets the base path of the API client.
/// </summary>
/// <value>The base path</value>
string GetBasePath();
/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
ExceptionFactory ExceptionFactory { get; set; }
}
}

View File

@ -0,0 +1,101 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Threading.Tasks;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Contract for Asynchronous RESTful API interactions.
///
/// This interface allows consumers to provide a custom API accessor client.
/// </summary>
public interface IAsynchronousClient
{
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the GET http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
}
}

View File

@ -0,0 +1,142 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Represents a readable-only configuration contract.
/// </summary>
public interface IReadableConfiguration
{
/// <summary>
/// Gets the access token.
/// </summary>
/// <value>Access token.</value>
string AccessToken { get; }
/// <summary>
/// Gets the API key.
/// </summary>
/// <value>API key.</value>
IDictionary<string, string> ApiKey { get; }
/// <summary>
/// Gets the API key prefix.
/// </summary>
/// <value>API key prefix.</value>
IDictionary<string, string> ApiKeyPrefix { get; }
/// <summary>
/// Gets the base path.
/// </summary>
/// <value>Base path.</value>
string BasePath { get; }
/// <summary>
/// Gets the date time format.
/// </summary>
/// <value>Date time format.</value>
string DateTimeFormat { get; }
/// <summary>
/// Gets the default header.
/// </summary>
/// <value>Default header.</value>
[Obsolete("Use DefaultHeaders instead.")]
IDictionary<string, string> DefaultHeader { get; }
/// <summary>
/// Gets the default headers.
/// </summary>
/// <value>Default headers.</value>
IDictionary<string, string> DefaultHeaders { get; }
/// <summary>
/// Gets the temp folder path.
/// </summary>
/// <value>Temp folder path.</value>
string TempFolderPath { get; }
/// <summary>
/// Gets the HTTP connection timeout.
/// </summary>
/// <value>HTTP connection timeout.</value>
TimeSpan Timeout { get; }
/// <summary>
/// Gets the proxy.
/// </summary>
/// <value>Proxy.</value>
WebProxy Proxy { get; }
/// <summary>
/// Gets the user agent.
/// </summary>
/// <value>User agent.</value>
string UserAgent { get; }
/// <summary>
/// Gets the username.
/// </summary>
/// <value>Username.</value>
string Username { get; }
/// <summary>
/// Gets the password.
/// </summary>
/// <value>Password.</value>
string Password { get; }
/// <summary>
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
/// </summary>
bool UseDefaultCredentials { get; }
/// <summary>
/// Get the servers associated with the operation.
/// </summary>
/// <value>Operation servers.</value>
IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers { get; }
/// <summary>
/// Gets the API key with prefix.
/// </summary>
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
/// <returns>API key with prefix.</returns>
string GetApiKeyWithPrefix(string apiKeyIdentifier);
/// <summary>
/// Gets the Operation server url at the provided index.
/// </summary>
/// <param name="operation">Operation server name.</param>
/// <param name="index">Index of the operation server settings.</param>
/// <returns></returns>
string GetOperationServerUrl(string operation, int index);
/// <summary>
/// Gets certificate collection to be sent with requests.
/// </summary>
/// <value>X509 Certificate collection.</value>
X509CertificateCollection ClientCertificates { get; }
/// <summary>
/// Callback function for handling the validation of remote certificates. Useful for certificate pinning and
/// overriding certificate errors in the scope of a request.
/// </summary>
RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; }
}
}

View File

@ -0,0 +1,94 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.IO;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Contract for Synchronous RESTful API interactions.
///
/// This interface allows consumers to provide a custom API accessor client.
/// </summary>
public interface ISynchronousClient
{
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the GET http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the POST http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the PUT http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the DELETE http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the HEAD http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the OPTIONS http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
/// <summary>
/// Executes a blocking call to some <paramref name="path"/> using the PATCH http verb.
/// </summary>
/// <param name="path">The relative path to invoke.</param>
/// <param name="options">The request parameters to pass along to the client.</param>
/// <param name="configuration">Per-request configurable settings.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
}
}

View File

@ -0,0 +1,296 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
namespace Tribufu.Generated.Client
{
/// <summary>
/// A dictionary in which one key has many associated values.
/// </summary>
/// <typeparam name="TKey">The type of the key</typeparam>
/// <typeparam name="TValue">The type of the value associated with the key.</typeparam>
public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>>
{
#region Private Fields
private readonly Dictionary<TKey, IList<TValue>> _dictionary;
#endregion Private Fields
#region Constructors
/// <summary>
/// Empty Constructor.
/// </summary>
public Multimap()
{
_dictionary = new Dictionary<TKey, IList<TValue>>();
}
/// <summary>
/// Constructor with comparer.
/// </summary>
/// <param name="comparer"></param>
public Multimap(IEqualityComparer<TKey> comparer)
{
_dictionary = new Dictionary<TKey, IList<TValue>>(comparer);
}
#endregion Constructors
#region Enumerators
/// <summary>
/// To get the enumerator.
/// </summary>
/// <returns>Enumerator</returns>
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
{
return _dictionary.GetEnumerator();
}
/// <summary>
/// To get the enumerator.
/// </summary>
/// <returns>Enumerator</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return _dictionary.GetEnumerator();
}
#endregion Enumerators
#region Public Members
/// <summary>
/// Add values to Multimap
/// </summary>
/// <param name="item">Key value pair</param>
public void Add(KeyValuePair<TKey, IList<TValue>> item)
{
if (!TryAdd(item.Key, item.Value))
throw new InvalidOperationException("Could not add values to Multimap.");
}
/// <summary>
/// Add Multimap to Multimap
/// </summary>
/// <param name="multimap">Multimap</param>
public void Add(Multimap<TKey, TValue> multimap)
{
foreach (var item in multimap)
{
if (!TryAdd(item.Key, item.Value))
throw new InvalidOperationException("Could not add values to Multimap.");
}
}
/// <summary>
/// Clear Multimap
/// </summary>
public void Clear()
{
_dictionary.Clear();
}
/// <summary>
/// Determines whether Multimap contains the specified item.
/// </summary>
/// <param name="item">Key value pair</param>
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
/// <returns>true if the Multimap contains the item; otherwise, false.</returns>
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
{
throw new NotImplementedException();
}
/// <summary>
/// Copy items of the Multimap to an array,
/// starting at a particular array index.
/// </summary>
/// <param name="array">The array that is the destination of the items copied
/// from Multimap. The array must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
{
throw new NotImplementedException();
}
/// <summary>
/// Removes the specified item from the Multimap.
/// </summary>
/// <param name="item">Key value pair</param>
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
{
throw new NotImplementedException();
}
/// <summary>
/// Gets the number of items contained in the Multimap.
/// </summary>
public int Count => _dictionary.Count;
/// <summary>
/// Gets a value indicating whether the Multimap is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Adds an item with the provided key and value to the Multimap.
/// </summary>
/// <param name="key">The object to use as the key of the item to add.</param>
/// <param name="value">The object to use as the value of the item to add.</param>
/// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception>
public void Add(TKey key, IList<TValue> value)
{
if (value != null && value.Count > 0)
{
if (_dictionary.TryGetValue(key, out var list))
{
foreach (var k in value) list.Add(k);
}
else
{
list = new List<TValue>(value);
if (!TryAdd(key, list))
throw new InvalidOperationException("Could not add values to Multimap.");
}
}
}
/// <summary>
/// Determines whether the Multimap contains an item with the specified key.
/// </summary>
/// <param name="key">The key to locate in the Multimap.</param>
/// <returns>true if the Multimap contains an item with
/// the key; otherwise, false.</returns>
public bool ContainsKey(TKey key)
{
return _dictionary.ContainsKey(key);
}
/// <summary>
/// Removes item with the specified key from the Multimap.
/// </summary>
/// <param name="key">The key to locate in the Multimap.</param>
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
public bool Remove(TKey key)
{
return TryRemove(key, out var _);
}
/// <summary>
/// Gets the value associated with the specified key.
/// </summary>
/// <param name="key">The key whose value to get.</param>
/// <param name="value">When this method returns, the value associated with the specified key, if the
/// key is found; otherwise, the default value for the type of the value parameter.
/// This parameter is passed uninitialized.</param>
/// <returns> true if the object that implements Multimap contains
/// an item with the specified key; otherwise, false.</returns>
public bool TryGetValue(TKey key, out IList<TValue> value)
{
return _dictionary.TryGetValue(key, out value);
}
/// <summary>
/// Gets or sets the item with the specified key.
/// </summary>
/// <param name="key">The key of the item to get or set.</param>
/// <returns>The value of the specified key.</returns>
public IList<TValue> this[TKey key]
{
get => _dictionary[key];
set => _dictionary[key] = value;
}
/// <summary>
/// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
/// </summary>
public ICollection<TKey> Keys => _dictionary.Keys;
/// <summary>
/// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
/// </summary>
public ICollection<IList<TValue>> Values => _dictionary.Values;
/// <summary>
/// Copy the items of the Multimap to an System.Array,
/// starting at a particular System.Array index.
/// </summary>
/// <param name="array">The one-dimensional System.Array that is the destination of the items copied
/// from Multimap. The System.Array must have zero-based indexing.</param>
/// <param name="index">The zero-based index in array at which copying begins.</param>
public void CopyTo(Array array, int index)
{
((ICollection)_dictionary).CopyTo(array, index);
}
/// <summary>
/// Adds an item with the provided key and value to the Multimap.
/// </summary>
/// <param name="key">The object to use as the key of the item to add.</param>
/// <param name="value">The object to use as the value of the item to add.</param>
/// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception>
public void Add(TKey key, TValue value)
{
if (value != null)
{
if (_dictionary.TryGetValue(key, out var list))
{
list.Add(value);
}
else
{
list = new List<TValue> { value };
if (!TryAdd(key, list))
throw new InvalidOperationException("Could not add value to Multimap.");
}
}
}
#endregion Public Members
#region Private Members
/**
* Helper method to encapsulate generator differences between dictionary types.
*/
private bool TryRemove(TKey key, out IList<TValue> value)
{
_dictionary.TryGetValue(key, out value);
return _dictionary.Remove(key);
}
/**
* Helper method to encapsulate generator differences between dictionary types.
*/
private bool TryAdd(TKey key, IList<TValue> value)
{
try
{
_dictionary.Add(key, value);
}
catch (ArgumentException)
{
return false;
}
return true;
}
#endregion Private Members
}
}

View File

@ -0,0 +1,30 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Newtonsoft.Json.Converters;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
/// </summary>
public class OpenAPIDateConverter : IsoDateTimeConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class.
/// </summary>
public OpenAPIDateConverter()
{
// full-date = date-fullyear "-" date-month "-" date-mday
DateTimeFormat = "yyyy-MM-dd";
}
}
}

View File

@ -0,0 +1,85 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
namespace Tribufu.Generated.Client
{
/// <summary>
/// A container for generalized request inputs. This type allows consumers to extend the request functionality
/// by abstracting away from the default (built-in) request framework (e.g. RestSharp).
/// </summary>
public class RequestOptions
{
/// <summary>
/// Parameters to be bound to path parts of the Request's URL
/// </summary>
public Dictionary<string, string> PathParameters { get; set; }
/// <summary>
/// Query parameters to be applied to the request.
/// Keys may have 1 or more values associated.
/// </summary>
public Multimap<string, string> QueryParameters { get; set; }
/// <summary>
/// Header parameters to be applied to the request.
/// Keys may have 1 or more values associated.
/// </summary>
public Multimap<string, string> HeaderParameters { get; set; }
/// <summary>
/// Form parameters to be sent along with the request.
/// </summary>
public Dictionary<string, string> FormParameters { get; set; }
/// <summary>
/// File parameters to be sent along with the request.
/// </summary>
public Multimap<string, Stream> FileParameters { get; set; }
/// <summary>
/// Cookies to be sent along with the request.
/// </summary>
public List<Cookie> Cookies { get; set; }
/// <summary>
/// Operation associated with the request path.
/// </summary>
public string Operation { get; set; }
/// <summary>
/// Index associated with the operation.
/// </summary>
public int OperationIndex { get; set; }
/// <summary>
/// Any data associated with a request body.
/// </summary>
public Object Data { get; set; }
/// <summary>
/// Constructs a new instance of <see cref="RequestOptions"/>
/// </summary>
public RequestOptions()
{
PathParameters = new Dictionary<string, string>();
QueryParameters = new Multimap<string, string>();
HeaderParameters = new Multimap<string, string>();
FormParameters = new Dictionary<string, string>();
FileParameters = new Multimap<string, Stream>();
Cookies = new List<Cookie>();
}
}
}

View File

@ -0,0 +1,32 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Polly;
using RestSharp;
namespace Tribufu.Generated.Client
{
/// <summary>
/// Configuration class to set the polly retry policies to be applied to the requests.
/// </summary>
public static class RetryConfiguration
{
/// <summary>
/// Retry policy
/// </summary>
public static Policy<RestResponse> RetryPolicy { get; set; }
/// <summary>
/// Async retry policy
/// </summary>
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
}
}

View File

@ -0,0 +1,77 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification
/// </summary>
public abstract partial class AbstractOpenAPISchema
{
/// <summary>
/// Custom JSON serializer
/// </summary>
static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
{
// OpenAPI generated types generally hide default constructors.
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
MissingMemberHandling = MissingMemberHandling.Error,
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy
{
OverrideSpecifiedNames = false
}
}
};
/// <summary>
/// Custom JSON serializer for objects with additional properties
/// </summary>
static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
{
// OpenAPI generated types generally hide default constructors.
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
MissingMemberHandling = MissingMemberHandling.Ignore,
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy
{
OverrideSpecifiedNames = false
}
}
};
/// <summary>
/// Gets or Sets the actual instance
/// </summary>
public abstract Object ActualInstance { get; set; }
/// <summary>
/// Gets or Sets IsNullable to indicate whether the instance is nullable
/// </summary>
public bool IsNullable { get; protected set; }
/// <summary>
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf`
/// </summary>
public string SchemaType { get; protected set; }
/// <summary>
/// Converts the instance into JSON string.
/// </summary>
public abstract string ToJson();
}
}

View File

@ -0,0 +1,146 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Account
/// </summary>
[DataContract(Name = "Account")]
public partial class Account : IValidatableObject
{
/// <summary>
/// Gets or Sets Provider
/// </summary>
[DataMember(Name = "provider", EmitDefaultValue = false)]
public LoginProvider? Provider { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Account" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="provider">provider.</param>
/// <param name="userId">userId.</param>
/// <param name="authorized">authorized.</param>
/// <param name="fields">fields.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Account(string id = default(string), string name = default(string), LoginProvider? provider = default(LoginProvider?), string userId = default(string), bool authorized = default(bool), Object fields = default(Object), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Provider = provider;
this.UserId = userId;
this.Authorized = authorized;
this.Fields = fields;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = true)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets UserId
/// </summary>
[DataMember(Name = "user_id", EmitDefaultValue = false)]
public string UserId { get; set; }
/// <summary>
/// Gets or Sets Authorized
/// </summary>
[DataMember(Name = "authorized", EmitDefaultValue = true)]
public bool Authorized { get; set; }
/// <summary>
/// Gets or Sets Fields
/// </summary>
[DataMember(Name = "fields", EmitDefaultValue = true)]
public Object Fields { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Account {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Provider: ").Append(Provider).Append("\n");
sb.Append(" UserId: ").Append(UserId).Append("\n");
sb.Append(" Authorized: ").Append(Authorized).Append("\n");
sb.Append(" Fields: ").Append(Fields).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,284 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Application
/// </summary>
[DataContract(Name = "Application")]
public partial class Application : IValidatableObject
{
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public ApplicationType? Type { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Application" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="type">type.</param>
/// <param name="organizationId">organizationId.</param>
/// <param name="iconUrl">iconUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
/// <param name="libraryImageUrl">libraryImageUrl.</param>
/// <param name="parentId">parentId.</param>
/// <param name="slug">slug.</param>
/// <param name="visibility">visibility.</param>
/// <param name="password">password.</param>
/// <param name="primary">primary.</param>
/// <param name="userCount">userCount.</param>
/// <param name="achievementCount">achievementCount.</param>
/// <param name="badgeCount">badgeCount.</param>
/// <param name="downloadCount">downloadCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Application(string id = default(string), string name = default(string), string description = default(string), ApplicationType? type = default(ApplicationType?), string organizationId = default(string), string iconUrl = default(string), string bannerUrl = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string parentId = default(string), string slug = default(string), int visibility = default(int), string password = default(string), int primary = default(int), int userCount = default(int), int achievementCount = default(int), int? badgeCount = default(int?), int downloadCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Description = description;
this.Type = type;
this.OrganizationId = organizationId;
this.IconUrl = iconUrl;
this.BannerUrl = bannerUrl;
this.CapsuleImageUrl = capsuleImageUrl;
this.LibraryImageUrl = libraryImageUrl;
this.ParentId = parentId;
this.Slug = slug;
this.Visibility = visibility;
this.Password = password;
this.Primary = primary;
this.UserCount = userCount;
this.AchievementCount = achievementCount;
this.BadgeCount = badgeCount;
this.DownloadCount = downloadCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets OrganizationId
/// </summary>
[DataMember(Name = "organization_id", EmitDefaultValue = true)]
public string OrganizationId { get; set; }
/// <summary>
/// Gets or Sets IconUrl
/// </summary>
[DataMember(Name = "icon_url", EmitDefaultValue = true)]
public string IconUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets CapsuleImageUrl
/// </summary>
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
public string CapsuleImageUrl { get; set; }
/// <summary>
/// Gets or Sets LibraryImageUrl
/// </summary>
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
public string LibraryImageUrl { get; set; }
/// <summary>
/// Gets or Sets ParentId
/// </summary>
[DataMember(Name = "parent_id", EmitDefaultValue = true)]
public string ParentId { get; set; }
/// <summary>
/// Gets or Sets Slug
/// </summary>
[DataMember(Name = "slug", EmitDefaultValue = true)]
public string Slug { get; set; }
/// <summary>
/// Gets or Sets Visibility
/// </summary>
[DataMember(Name = "visibility", EmitDefaultValue = false)]
public int Visibility { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name = "password", EmitDefaultValue = true)]
public string Password { get; set; }
/// <summary>
/// Gets or Sets Primary
/// </summary>
[DataMember(Name = "primary", EmitDefaultValue = false)]
public int Primary { get; set; }
/// <summary>
/// Gets or Sets UserCount
/// </summary>
[DataMember(Name = "user_count", EmitDefaultValue = false)]
public int UserCount { get; set; }
/// <summary>
/// Gets or Sets AchievementCount
/// </summary>
[DataMember(Name = "achievement_count", EmitDefaultValue = false)]
public int AchievementCount { get; set; }
/// <summary>
/// Gets or Sets BadgeCount
/// </summary>
[DataMember(Name = "badge_count", EmitDefaultValue = true)]
public int? BadgeCount { get; set; }
/// <summary>
/// Gets or Sets DownloadCount
/// </summary>
[DataMember(Name = "download_count", EmitDefaultValue = false)]
public int DownloadCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Application {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" OrganizationId: ").Append(OrganizationId).Append("\n");
sb.Append(" IconUrl: ").Append(IconUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
sb.Append(" ParentId: ").Append(ParentId).Append("\n");
sb.Append(" Slug: ").Append(Slug).Append("\n");
sb.Append(" Visibility: ").Append(Visibility).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" Primary: ").Append(Primary).Append("\n");
sb.Append(" UserCount: ").Append(UserCount).Append("\n");
sb.Append(" AchievementCount: ").Append(AchievementCount).Append("\n");
sb.Append(" BadgeCount: ").Append(BadgeCount).Append("\n");
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 75)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
}
// IconUrl (string) maxLength
if (this.IconUrl != null && this.IconUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for IconUrl, length must be less than 255.", new [] { "IconUrl" });
}
// BannerUrl (string) maxLength
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
}
// CapsuleImageUrl (string) maxLength
if (this.CapsuleImageUrl != null && this.CapsuleImageUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for CapsuleImageUrl, length must be less than 255.", new [] { "CapsuleImageUrl" });
}
// LibraryImageUrl (string) maxLength
if (this.LibraryImageUrl != null && this.LibraryImageUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for LibraryImageUrl, length must be less than 255.", new [] { "LibraryImageUrl" });
}
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines ApplicationType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ApplicationType
{
/// <summary>
/// Enum Application for value: application
/// </summary>
[EnumMember(Value = "application")]
Application,
/// <summary>
/// Enum Game for value: game
/// </summary>
[EnumMember(Value = "game")]
Game
}
}

View File

@ -0,0 +1,137 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// AuthorizeRequest
/// </summary>
[DataContract(Name = "AuthorizeRequest")]
public partial class AuthorizeRequest : IValidatableObject
{
/// <summary>
/// Gets or Sets ResponseType
/// </summary>
[DataMember(Name = "response_type", EmitDefaultValue = false)]
public ResponseType? ResponseType { get; set; }
/// <summary>
/// Gets or Sets CodeChallengeMethod
/// </summary>
[DataMember(Name = "code_challenge_method", EmitDefaultValue = false)]
public CodeChallengeMethod? CodeChallengeMethod { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="AuthorizeRequest" /> class.
/// </summary>
/// <param name="responseType">responseType.</param>
/// <param name="clientId">clientId.</param>
/// <param name="codeChallenge">codeChallenge.</param>
/// <param name="codeChallengeMethod">codeChallengeMethod.</param>
/// <param name="redirectUri">redirectUri.</param>
/// <param name="scope">scope.</param>
/// <param name="state">state.</param>
public AuthorizeRequest(ResponseType? responseType = default(ResponseType?), string clientId = default(string), string codeChallenge = default(string), CodeChallengeMethod? codeChallengeMethod = default(CodeChallengeMethod?), string redirectUri = default(string), string scope = default(string), string state = default(string))
{
this.ResponseType = responseType;
this.ClientId = clientId;
this.CodeChallenge = codeChallenge;
this.CodeChallengeMethod = codeChallengeMethod;
this.RedirectUri = redirectUri;
this.Scope = scope;
this.State = state;
}
/// <summary>
/// Gets or Sets ClientId
/// </summary>
[DataMember(Name = "client_id", EmitDefaultValue = true)]
public string ClientId { get; set; }
/// <summary>
/// Gets or Sets CodeChallenge
/// </summary>
[DataMember(Name = "code_challenge", EmitDefaultValue = true)]
public string CodeChallenge { get; set; }
/// <summary>
/// Gets or Sets RedirectUri
/// </summary>
[DataMember(Name = "redirect_uri", EmitDefaultValue = true)]
public string RedirectUri { get; set; }
/// <summary>
/// Gets or Sets Scope
/// </summary>
[DataMember(Name = "scope", EmitDefaultValue = true)]
public string Scope { get; set; }
/// <summary>
/// Gets or Sets State
/// </summary>
[DataMember(Name = "state", EmitDefaultValue = true)]
public string State { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class AuthorizeRequest {\n");
sb.Append(" ResponseType: ").Append(ResponseType).Append("\n");
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
sb.Append(" CodeChallenge: ").Append(CodeChallenge).Append("\n");
sb.Append(" CodeChallengeMethod: ").Append(CodeChallengeMethod).Append("\n");
sb.Append(" RedirectUri: ").Append(RedirectUri).Append("\n");
sb.Append(" Scope: ").Append(Scope).Append("\n");
sb.Append(" State: ").Append(State).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines CodeChallengeMethod
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CodeChallengeMethod
{
/// <summary>
/// Enum Plain for value: plain
/// </summary>
[EnumMember(Value = "plain")]
Plain,
/// <summary>
/// Enum S256 for value: S256
/// </summary>
[EnumMember(Value = "S256")]
S256
}
}

View File

@ -0,0 +1,92 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// CryptoViewModel
/// </summary>
[DataContract(Name = "CryptoViewModel")]
public partial class CryptoViewModel : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="CryptoViewModel" /> class.
/// </summary>
/// <param name="encoded">encoded.</param>
/// <param name="decoded">decoded.</param>
public CryptoViewModel(string encoded = default(string), string decoded = default(string))
{
this.Encoded = encoded;
this.Decoded = decoded;
}
/// <summary>
/// Gets or Sets Encoded
/// </summary>
[DataMember(Name = "encoded", EmitDefaultValue = true)]
public string Encoded { get; set; }
/// <summary>
/// Gets or Sets Decoded
/// </summary>
[DataMember(Name = "decoded", EmitDefaultValue = true)]
public string Decoded { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class CryptoViewModel {\n");
sb.Append(" Encoded: ").Append(Encoded).Append("\n");
sb.Append(" Decoded: ").Append(Decoded).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,401 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Game
/// </summary>
[DataContract(Name = "Game")]
public partial class Game : IValidatableObject
{
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public ApplicationType? Type { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Game" /> class.
/// </summary>
/// <param name="gamePort">gamePort.</param>
/// <param name="queryPort">queryPort.</param>
/// <param name="rconPort">rconPort.</param>
/// <param name="serverCount">serverCount.</param>
/// <param name="steamAppId">steamAppId.</param>
/// <param name="steamServerAppId">steamServerAppId.</param>
/// <param name="enableServers">enableServers.</param>
/// <param name="rustGamedigId">rustGamedigId.</param>
/// <param name="nodeGamedigId">nodeGamedigId.</param>
/// <param name="serverConnectUrl">serverConnectUrl.</param>
/// <param name="serverTags">serverTags.</param>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="type">type.</param>
/// <param name="organizationId">organizationId.</param>
/// <param name="iconUrl">iconUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
/// <param name="libraryImageUrl">libraryImageUrl.</param>
/// <param name="parentId">parentId.</param>
/// <param name="slug">slug.</param>
/// <param name="visibility">visibility.</param>
/// <param name="password">password.</param>
/// <param name="primary">primary.</param>
/// <param name="userCount">userCount.</param>
/// <param name="achievementCount">achievementCount.</param>
/// <param name="badgeCount">badgeCount.</param>
/// <param name="downloadCount">downloadCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Game(int? gamePort = default(int?), int? queryPort = default(int?), int? rconPort = default(int?), int serverCount = default(int), int? steamAppId = default(int?), int? steamServerAppId = default(int?), bool enableServers = default(bool), string rustGamedigId = default(string), string nodeGamedigId = default(string), string serverConnectUrl = default(string), string serverTags = default(string), string id = default(string), string name = default(string), string description = default(string), ApplicationType? type = default(ApplicationType?), string organizationId = default(string), string iconUrl = default(string), string bannerUrl = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string parentId = default(string), string slug = default(string), int visibility = default(int), string password = default(string), int primary = default(int), int userCount = default(int), int achievementCount = default(int), int? badgeCount = default(int?), int downloadCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.GamePort = gamePort;
this.QueryPort = queryPort;
this.RconPort = rconPort;
this.ServerCount = serverCount;
this.SteamAppId = steamAppId;
this.SteamServerAppId = steamServerAppId;
this.EnableServers = enableServers;
this.RustGamedigId = rustGamedigId;
this.NodeGamedigId = nodeGamedigId;
this.ServerConnectUrl = serverConnectUrl;
this.ServerTags = serverTags;
this.Id = id;
this.Name = name;
this.Description = description;
this.Type = type;
this.OrganizationId = organizationId;
this.IconUrl = iconUrl;
this.BannerUrl = bannerUrl;
this.CapsuleImageUrl = capsuleImageUrl;
this.LibraryImageUrl = libraryImageUrl;
this.ParentId = parentId;
this.Slug = slug;
this.Visibility = visibility;
this.Password = password;
this.Primary = primary;
this.UserCount = userCount;
this.AchievementCount = achievementCount;
this.BadgeCount = badgeCount;
this.DownloadCount = downloadCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets GamePort
/// </summary>
[DataMember(Name = "game_port", EmitDefaultValue = true)]
public int? GamePort { get; set; }
/// <summary>
/// Gets or Sets QueryPort
/// </summary>
[DataMember(Name = "query_port", EmitDefaultValue = true)]
public int? QueryPort { get; set; }
/// <summary>
/// Gets or Sets RconPort
/// </summary>
[DataMember(Name = "rcon_port", EmitDefaultValue = true)]
public int? RconPort { get; set; }
/// <summary>
/// Gets or Sets ServerCount
/// </summary>
[DataMember(Name = "server_count", EmitDefaultValue = false)]
public int ServerCount { get; set; }
/// <summary>
/// Gets or Sets SteamAppId
/// </summary>
[DataMember(Name = "steam_app_id", EmitDefaultValue = true)]
public int? SteamAppId { get; set; }
/// <summary>
/// Gets or Sets SteamServerAppId
/// </summary>
[DataMember(Name = "steam_server_app_id", EmitDefaultValue = true)]
public int? SteamServerAppId { get; set; }
/// <summary>
/// Gets or Sets EnableServers
/// </summary>
[DataMember(Name = "enable_servers", EmitDefaultValue = true)]
public bool EnableServers { get; set; }
/// <summary>
/// Gets or Sets RustGamedigId
/// </summary>
[DataMember(Name = "rust_gamedig_id", EmitDefaultValue = true)]
public string RustGamedigId { get; set; }
/// <summary>
/// Gets or Sets NodeGamedigId
/// </summary>
[DataMember(Name = "node_gamedig_id", EmitDefaultValue = true)]
public string NodeGamedigId { get; set; }
/// <summary>
/// Gets or Sets ServerConnectUrl
/// </summary>
[DataMember(Name = "server_connect_url", EmitDefaultValue = true)]
public string ServerConnectUrl { get; set; }
/// <summary>
/// Gets or Sets ServerTags
/// </summary>
[DataMember(Name = "server_tags", EmitDefaultValue = true)]
public string ServerTags { get; set; }
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets OrganizationId
/// </summary>
[DataMember(Name = "organization_id", EmitDefaultValue = true)]
public string OrganizationId { get; set; }
/// <summary>
/// Gets or Sets IconUrl
/// </summary>
[DataMember(Name = "icon_url", EmitDefaultValue = true)]
public string IconUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets CapsuleImageUrl
/// </summary>
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
public string CapsuleImageUrl { get; set; }
/// <summary>
/// Gets or Sets LibraryImageUrl
/// </summary>
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
public string LibraryImageUrl { get; set; }
/// <summary>
/// Gets or Sets ParentId
/// </summary>
[DataMember(Name = "parent_id", EmitDefaultValue = true)]
public string ParentId { get; set; }
/// <summary>
/// Gets or Sets Slug
/// </summary>
[DataMember(Name = "slug", EmitDefaultValue = true)]
public string Slug { get; set; }
/// <summary>
/// Gets or Sets Visibility
/// </summary>
[DataMember(Name = "visibility", EmitDefaultValue = false)]
public int Visibility { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name = "password", EmitDefaultValue = true)]
public string Password { get; set; }
/// <summary>
/// Gets or Sets Primary
/// </summary>
[DataMember(Name = "primary", EmitDefaultValue = false)]
public int Primary { get; set; }
/// <summary>
/// Gets or Sets UserCount
/// </summary>
[DataMember(Name = "user_count", EmitDefaultValue = false)]
public int UserCount { get; set; }
/// <summary>
/// Gets or Sets AchievementCount
/// </summary>
[DataMember(Name = "achievement_count", EmitDefaultValue = false)]
public int AchievementCount { get; set; }
/// <summary>
/// Gets or Sets BadgeCount
/// </summary>
[DataMember(Name = "badge_count", EmitDefaultValue = true)]
public int? BadgeCount { get; set; }
/// <summary>
/// Gets or Sets DownloadCount
/// </summary>
[DataMember(Name = "download_count", EmitDefaultValue = false)]
public int DownloadCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Game {\n");
sb.Append(" GamePort: ").Append(GamePort).Append("\n");
sb.Append(" QueryPort: ").Append(QueryPort).Append("\n");
sb.Append(" RconPort: ").Append(RconPort).Append("\n");
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
sb.Append(" SteamAppId: ").Append(SteamAppId).Append("\n");
sb.Append(" SteamServerAppId: ").Append(SteamServerAppId).Append("\n");
sb.Append(" EnableServers: ").Append(EnableServers).Append("\n");
sb.Append(" RustGamedigId: ").Append(RustGamedigId).Append("\n");
sb.Append(" NodeGamedigId: ").Append(NodeGamedigId).Append("\n");
sb.Append(" ServerConnectUrl: ").Append(ServerConnectUrl).Append("\n");
sb.Append(" ServerTags: ").Append(ServerTags).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" OrganizationId: ").Append(OrganizationId).Append("\n");
sb.Append(" IconUrl: ").Append(IconUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
sb.Append(" ParentId: ").Append(ParentId).Append("\n");
sb.Append(" Slug: ").Append(Slug).Append("\n");
sb.Append(" Visibility: ").Append(Visibility).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" Primary: ").Append(Primary).Append("\n");
sb.Append(" UserCount: ").Append(UserCount).Append("\n");
sb.Append(" AchievementCount: ").Append(AchievementCount).Append("\n");
sb.Append(" BadgeCount: ").Append(BadgeCount).Append("\n");
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// RustGamedigId (string) maxLength
if (this.RustGamedigId != null && this.RustGamedigId.Length > 45)
{
yield return new ValidationResult("Invalid value for RustGamedigId, length must be less than 45.", new [] { "RustGamedigId" });
}
// NodeGamedigId (string) maxLength
if (this.NodeGamedigId != null && this.NodeGamedigId.Length > 45)
{
yield return new ValidationResult("Invalid value for NodeGamedigId, length must be less than 45.", new [] { "NodeGamedigId" });
}
// ServerConnectUrl (string) maxLength
if (this.ServerConnectUrl != null && this.ServerConnectUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for ServerConnectUrl, length must be less than 255.", new [] { "ServerConnectUrl" });
}
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 75)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
}
// IconUrl (string) maxLength
if (this.IconUrl != null && this.IconUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for IconUrl, length must be less than 255.", new [] { "IconUrl" });
}
// BannerUrl (string) maxLength
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
}
// CapsuleImageUrl (string) maxLength
if (this.CapsuleImageUrl != null && this.CapsuleImageUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for CapsuleImageUrl, length must be less than 255.", new [] { "CapsuleImageUrl" });
}
// LibraryImageUrl (string) maxLength
if (this.LibraryImageUrl != null && this.LibraryImageUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for LibraryImageUrl, length must be less than 255.", new [] { "LibraryImageUrl" });
}
yield break;
}
}
}

View File

@ -0,0 +1,407 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// GameServer
/// </summary>
[DataContract(Name = "GameServer")]
public partial class GameServer : IValidatableObject
{
/// <summary>
/// Gets or Sets Status
/// </summary>
[DataMember(Name = "status", EmitDefaultValue = false)]
public ServerStatus? Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="GameServer" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="address">address.</param>
/// <param name="gamePort">gamePort.</param>
/// <param name="queryPort">queryPort.</param>
/// <param name="gameId">gameId.</param>
/// <param name="gameIconUrl">gameIconUrl.</param>
/// <param name="varVersion">varVersion.</param>
/// <param name="featured">featured.</param>
/// <param name="clusterId">clusterId.</param>
/// <param name="websiteUrl">websiteUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="ownerId">ownerId.</param>
/// <param name="uptime">uptime.</param>
/// <param name="status">status.</param>
/// <param name="ping">ping.</param>
/// <param name="map">map.</param>
/// <param name="usedSlots">usedSlots.</param>
/// <param name="maxSlots">maxSlots.</param>
/// <param name="motd">motd.</param>
/// <param name="players">players.</param>
/// <param name="lastOnline">lastOnline.</param>
/// <param name="country">country.</param>
/// <param name="steam">steam.</param>
/// <param name="discordServerId">discordServerId.</param>
/// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
/// <param name="tags">tags.</param>
/// <param name="commentCount">commentCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public GameServer(string id = default(string), string name = default(string), string description = default(string), string address = default(string), int? gamePort = default(int?), int queryPort = default(int), string gameId = default(string), string gameIconUrl = default(string), string varVersion = default(string), bool featured = default(bool), string clusterId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), double uptime = default(double), ServerStatus? status = default(ServerStatus?), int? ping = default(int?), string map = default(string), int? usedSlots = default(int?), int? maxSlots = default(int?), string motd = default(string), string players = default(string), DateTime? lastOnline = default(DateTime?), string country = default(string), bool steam = default(bool), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Description = description;
this.Address = address;
this.GamePort = gamePort;
this.QueryPort = queryPort;
this.GameId = gameId;
this.GameIconUrl = gameIconUrl;
this.VarVersion = varVersion;
this.Featured = featured;
this.ClusterId = clusterId;
this.WebsiteUrl = websiteUrl;
this.BannerUrl = bannerUrl;
this.OwnerId = ownerId;
this.Uptime = uptime;
this.Status = status;
this.Ping = ping;
this.Map = map;
this.UsedSlots = usedSlots;
this.MaxSlots = maxSlots;
this.Motd = motd;
this.Players = players;
this.LastOnline = lastOnline;
this.Country = country;
this.Steam = steam;
this.DiscordServerId = discordServerId;
this.YoutubeVideoUrl = youtubeVideoUrl;
this.Tags = tags;
this.CommentCount = commentCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets Address
/// </summary>
[DataMember(Name = "address", EmitDefaultValue = true)]
public string Address { get; set; }
/// <summary>
/// Gets or Sets GamePort
/// </summary>
[DataMember(Name = "game_port", EmitDefaultValue = true)]
public int? GamePort { get; set; }
/// <summary>
/// Gets or Sets QueryPort
/// </summary>
[DataMember(Name = "query_port", EmitDefaultValue = false)]
public int QueryPort { get; set; }
/// <summary>
/// Gets or Sets GameId
/// </summary>
[DataMember(Name = "game_id", EmitDefaultValue = false)]
public string GameId { get; set; }
/// <summary>
/// Gets or Sets GameIconUrl
/// </summary>
[DataMember(Name = "game_icon_url", EmitDefaultValue = true)]
public string GameIconUrl { get; set; }
/// <summary>
/// Gets or Sets VarVersion
/// </summary>
[DataMember(Name = "version", EmitDefaultValue = true)]
public string VarVersion { get; set; }
/// <summary>
/// Gets or Sets Featured
/// </summary>
[DataMember(Name = "featured", EmitDefaultValue = true)]
public bool Featured { get; set; }
/// <summary>
/// Gets or Sets ClusterId
/// </summary>
[DataMember(Name = "cluster_id", EmitDefaultValue = true)]
public string ClusterId { get; set; }
/// <summary>
/// Gets or Sets WebsiteUrl
/// </summary>
[DataMember(Name = "website_url", EmitDefaultValue = true)]
public string WebsiteUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets OwnerId
/// </summary>
[DataMember(Name = "owner_id", EmitDefaultValue = true)]
public string OwnerId { get; set; }
/// <summary>
/// Gets or Sets Uptime
/// </summary>
[DataMember(Name = "uptime", EmitDefaultValue = false)]
public double Uptime { get; set; }
/// <summary>
/// Gets or Sets Ping
/// </summary>
[DataMember(Name = "ping", EmitDefaultValue = true)]
public int? Ping { get; set; }
/// <summary>
/// Gets or Sets Map
/// </summary>
[DataMember(Name = "map", EmitDefaultValue = true)]
public string Map { get; set; }
/// <summary>
/// Gets or Sets UsedSlots
/// </summary>
[DataMember(Name = "used_slots", EmitDefaultValue = true)]
public int? UsedSlots { get; set; }
/// <summary>
/// Gets or Sets MaxSlots
/// </summary>
[DataMember(Name = "max_slots", EmitDefaultValue = true)]
public int? MaxSlots { get; set; }
/// <summary>
/// Gets or Sets Motd
/// </summary>
[DataMember(Name = "motd", EmitDefaultValue = true)]
public string Motd { get; set; }
/// <summary>
/// Gets or Sets Players
/// </summary>
[DataMember(Name = "players", EmitDefaultValue = true)]
public string Players { get; set; }
/// <summary>
/// Gets or Sets LastOnline
/// </summary>
[DataMember(Name = "last_online", EmitDefaultValue = true)]
public DateTime? LastOnline { get; set; }
/// <summary>
/// Gets or Sets Country
/// </summary>
[DataMember(Name = "country", EmitDefaultValue = true)]
public string Country { get; set; }
/// <summary>
/// Gets or Sets Steam
/// </summary>
[DataMember(Name = "steam", EmitDefaultValue = true)]
public bool Steam { get; set; }
/// <summary>
/// Gets or Sets DiscordServerId
/// </summary>
[DataMember(Name = "discord_server_id", EmitDefaultValue = true)]
public string DiscordServerId { get; set; }
/// <summary>
/// Gets or Sets YoutubeVideoUrl
/// </summary>
[DataMember(Name = "youtube_video_url", EmitDefaultValue = true)]
public string YoutubeVideoUrl { get; set; }
/// <summary>
/// Gets or Sets Tags
/// </summary>
[DataMember(Name = "tags", EmitDefaultValue = true)]
public string Tags { get; set; }
/// <summary>
/// Gets or Sets CommentCount
/// </summary>
[DataMember(Name = "comment_count", EmitDefaultValue = false)]
public int CommentCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GameServer {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Address: ").Append(Address).Append("\n");
sb.Append(" GamePort: ").Append(GamePort).Append("\n");
sb.Append(" QueryPort: ").Append(QueryPort).Append("\n");
sb.Append(" GameId: ").Append(GameId).Append("\n");
sb.Append(" GameIconUrl: ").Append(GameIconUrl).Append("\n");
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
sb.Append(" Featured: ").Append(Featured).Append("\n");
sb.Append(" ClusterId: ").Append(ClusterId).Append("\n");
sb.Append(" WebsiteUrl: ").Append(WebsiteUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
sb.Append(" Uptime: ").Append(Uptime).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" Ping: ").Append(Ping).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
sb.Append(" UsedSlots: ").Append(UsedSlots).Append("\n");
sb.Append(" MaxSlots: ").Append(MaxSlots).Append("\n");
sb.Append(" Motd: ").Append(Motd).Append("\n");
sb.Append(" Players: ").Append(Players).Append("\n");
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
sb.Append(" Country: ").Append(Country).Append("\n");
sb.Append(" Steam: ").Append(Steam).Append("\n");
sb.Append(" DiscordServerId: ").Append(DiscordServerId).Append("\n");
sb.Append(" YoutubeVideoUrl: ").Append(YoutubeVideoUrl).Append("\n");
sb.Append(" Tags: ").Append(Tags).Append("\n");
sb.Append(" CommentCount: ").Append(CommentCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 75)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
}
// Address (string) maxLength
if (this.Address != null && this.Address.Length > 255)
{
yield return new ValidationResult("Invalid value for Address, length must be less than 255.", new [] { "Address" });
}
// VarVersion (string) maxLength
if (this.VarVersion != null && this.VarVersion.Length > 45)
{
yield return new ValidationResult("Invalid value for VarVersion, length must be less than 45.", new [] { "VarVersion" });
}
// WebsiteUrl (string) maxLength
if (this.WebsiteUrl != null && this.WebsiteUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for WebsiteUrl, length must be less than 255.", new [] { "WebsiteUrl" });
}
// BannerUrl (string) maxLength
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
}
// Map (string) maxLength
if (this.Map != null && this.Map.Length > 45)
{
yield return new ValidationResult("Invalid value for Map, length must be less than 45.", new [] { "Map" });
}
// Motd (string) maxLength
if (this.Motd != null && this.Motd.Length > 255)
{
yield return new ValidationResult("Invalid value for Motd, length must be less than 255.", new [] { "Motd" });
}
// Country (string) maxLength
if (this.Country != null && this.Country.Length > 2)
{
yield return new ValidationResult("Invalid value for Country, length must be less than 2.", new [] { "Country" });
}
// YoutubeVideoUrl (string) maxLength
if (this.YoutubeVideoUrl != null && this.YoutubeVideoUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for YoutubeVideoUrl, length must be less than 255.", new [] { "YoutubeVideoUrl" });
}
yield break;
}
}
}

View File

@ -0,0 +1,224 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// GameServerCluster
/// </summary>
[DataContract(Name = "GameServerCluster")]
public partial class GameServerCluster : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="GameServerCluster" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="gameId">gameId.</param>
/// <param name="websiteUrl">websiteUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="ownerId">ownerId.</param>
/// <param name="discordServerId">discordServerId.</param>
/// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
/// <param name="tags">tags.</param>
/// <param name="commentCount">commentCount.</param>
/// <param name="serverCount">serverCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public GameServerCluster(string id = default(string), string name = default(string), string description = default(string), string gameId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), int serverCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Description = description;
this.GameId = gameId;
this.WebsiteUrl = websiteUrl;
this.BannerUrl = bannerUrl;
this.OwnerId = ownerId;
this.DiscordServerId = discordServerId;
this.YoutubeVideoUrl = youtubeVideoUrl;
this.Tags = tags;
this.CommentCount = commentCount;
this.ServerCount = serverCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets GameId
/// </summary>
[DataMember(Name = "game_id", EmitDefaultValue = false)]
public string GameId { get; set; }
/// <summary>
/// Gets or Sets WebsiteUrl
/// </summary>
[DataMember(Name = "website_url", EmitDefaultValue = true)]
public string WebsiteUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets OwnerId
/// </summary>
[DataMember(Name = "owner_id", EmitDefaultValue = false)]
public string OwnerId { get; set; }
/// <summary>
/// Gets or Sets DiscordServerId
/// </summary>
[DataMember(Name = "discord_server_id", EmitDefaultValue = true)]
public string DiscordServerId { get; set; }
/// <summary>
/// Gets or Sets YoutubeVideoUrl
/// </summary>
[DataMember(Name = "youtube_video_url", EmitDefaultValue = true)]
public string YoutubeVideoUrl { get; set; }
/// <summary>
/// Gets or Sets Tags
/// </summary>
[DataMember(Name = "tags", EmitDefaultValue = true)]
public string Tags { get; set; }
/// <summary>
/// Gets or Sets CommentCount
/// </summary>
[DataMember(Name = "comment_count", EmitDefaultValue = false)]
public int CommentCount { get; set; }
/// <summary>
/// Gets or Sets ServerCount
/// </summary>
[DataMember(Name = "server_count", EmitDefaultValue = false)]
public int ServerCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GameServerCluster {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" GameId: ").Append(GameId).Append("\n");
sb.Append(" WebsiteUrl: ").Append(WebsiteUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
sb.Append(" DiscordServerId: ").Append(DiscordServerId).Append("\n");
sb.Append(" YoutubeVideoUrl: ").Append(YoutubeVideoUrl).Append("\n");
sb.Append(" Tags: ").Append(Tags).Append("\n");
sb.Append(" CommentCount: ").Append(CommentCount).Append("\n");
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 75)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
}
// WebsiteUrl (string) maxLength
if (this.WebsiteUrl != null && this.WebsiteUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for WebsiteUrl, length must be less than 255.", new [] { "WebsiteUrl" });
}
// BannerUrl (string) maxLength
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
}
// YoutubeVideoUrl (string) maxLength
if (this.YoutubeVideoUrl != null && this.YoutubeVideoUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for YoutubeVideoUrl, length must be less than 255.", new [] { "YoutubeVideoUrl" });
}
yield break;
}
}
}

View File

@ -0,0 +1,60 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines GrantType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum GrantType
{
/// <summary>
/// Enum AuthorizationCode for value: authorization_code
/// </summary>
[EnumMember(Value = "authorization_code")]
AuthorizationCode,
/// <summary>
/// Enum ClientCredentials for value: client_credentials
/// </summary>
[EnumMember(Value = "client_credentials")]
ClientCredentials,
/// <summary>
/// Enum Password for value: password
/// </summary>
[EnumMember(Value = "password")]
Password,
/// <summary>
/// Enum RefreshToken for value: refresh_token
/// </summary>
[EnumMember(Value = "refresh_token")]
RefreshToken
}
}

View File

@ -0,0 +1,218 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Group
/// </summary>
[DataContract(Name = "Group")]
public partial class Group : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="Group" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="uuid">uuid.</param>
/// <param name="name">name.</param>
/// <param name="tag">tag.</param>
/// <param name="description">description.</param>
/// <param name="type">type.</param>
/// <param name="privacy">privacy.</param>
/// <param name="ownerId">ownerId.</param>
/// <param name="verified">verified.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="memberCount">memberCount.</param>
/// <param name="followerCount">followerCount.</param>
/// <param name="viewCount">viewCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Group(string id = default(string), Guid uuid = default(Guid), string name = default(string), string tag = default(string), string description = default(string), int type = default(int), int privacy = default(int), string ownerId = default(string), bool verified = default(bool), string photoUrl = default(string), string bannerUrl = default(string), int memberCount = default(int), int followerCount = default(int), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Uuid = uuid;
this.Name = name;
this.Tag = tag;
this.Description = description;
this.Type = type;
this.Privacy = privacy;
this.OwnerId = ownerId;
this.Verified = verified;
this.PhotoUrl = photoUrl;
this.BannerUrl = bannerUrl;
this.MemberCount = memberCount;
this.FollowerCount = followerCount;
this.ViewCount = viewCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Tag
/// </summary>
[DataMember(Name = "tag", EmitDefaultValue = true)]
public string Tag { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public int Type { get; set; }
/// <summary>
/// Gets or Sets Privacy
/// </summary>
[DataMember(Name = "privacy", EmitDefaultValue = false)]
public int Privacy { get; set; }
/// <summary>
/// Gets or Sets OwnerId
/// </summary>
[DataMember(Name = "owner_id", EmitDefaultValue = false)]
public string OwnerId { get; set; }
/// <summary>
/// Gets or Sets Verified
/// </summary>
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets MemberCount
/// </summary>
[DataMember(Name = "member_count", EmitDefaultValue = false)]
public int MemberCount { get; set; }
/// <summary>
/// Gets or Sets FollowerCount
/// </summary>
[DataMember(Name = "follower_count", EmitDefaultValue = false)]
public int FollowerCount { get; set; }
/// <summary>
/// Gets or Sets ViewCount
/// </summary>
[DataMember(Name = "view_count", EmitDefaultValue = false)]
public int ViewCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Group {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Tag: ").Append(Tag).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Privacy: ").Append(Privacy).Append("\n");
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" MemberCount: ").Append(MemberCount).Append("\n");
sb.Append(" FollowerCount: ").Append(FollowerCount).Append("\n");
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,137 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// GroupGame
/// </summary>
[DataContract(Name = "GroupGame")]
public partial class GroupGame : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupGame" /> class.
/// </summary>
/// <param name="groupId">groupId.</param>
/// <param name="group">group.</param>
/// <param name="applicationId">applicationId.</param>
/// <param name="application">application.</param>
/// <param name="stats">stats.</param>
/// <param name="acquired">acquired.</param>
/// <param name="lastUsed">lastUsed.</param>
public GroupGame(string groupId = default(string), Group group = default(Group), string applicationId = default(string), Application application = default(Application), Object stats = default(Object), DateTime acquired = default(DateTime), DateTime? lastUsed = default(DateTime?))
{
this.GroupId = groupId;
this.Group = group;
this.ApplicationId = applicationId;
this.Application = application;
this.Stats = stats;
this.Acquired = acquired;
this.LastUsed = lastUsed;
}
/// <summary>
/// Gets or Sets GroupId
/// </summary>
[DataMember(Name = "group_id", EmitDefaultValue = false)]
public string GroupId { get; set; }
/// <summary>
/// Gets or Sets Group
/// </summary>
[DataMember(Name = "group", EmitDefaultValue = false)]
public Group Group { get; set; }
/// <summary>
/// Gets or Sets ApplicationId
/// </summary>
[DataMember(Name = "application_id", EmitDefaultValue = false)]
public string ApplicationId { get; set; }
/// <summary>
/// Gets or Sets Application
/// </summary>
[DataMember(Name = "application", EmitDefaultValue = false)]
public Application Application { get; set; }
/// <summary>
/// Gets or Sets Stats
/// </summary>
[DataMember(Name = "stats", EmitDefaultValue = true)]
public Object Stats { get; set; }
/// <summary>
/// Gets or Sets Acquired
/// </summary>
[DataMember(Name = "acquired", EmitDefaultValue = false)]
public DateTime Acquired { get; set; }
/// <summary>
/// Gets or Sets LastUsed
/// </summary>
[DataMember(Name = "last_used", EmitDefaultValue = true)]
public DateTime? LastUsed { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GroupGame {\n");
sb.Append(" GroupId: ").Append(GroupId).Append("\n");
sb.Append(" Group: ").Append(Group).Append("\n");
sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n");
sb.Append(" Application: ").Append(Application).Append("\n");
sb.Append(" Stats: ").Append(Stats).Append("\n");
sb.Append(" Acquired: ").Append(Acquired).Append("\n");
sb.Append(" LastUsed: ").Append(LastUsed).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,155 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// GroupMember
/// </summary>
[DataContract(Name = "GroupMember")]
public partial class GroupMember : IValidatableObject
{
/// <summary>
/// Gets or Sets Rank
/// </summary>
[DataMember(Name = "rank", EmitDefaultValue = false)]
public GroupRank? Rank { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="GroupMember" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="uuid">uuid.</param>
/// <param name="name">name.</param>
/// <param name="displayName">displayName.</param>
/// <param name="verified">verified.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="lastOnline">lastOnline.</param>
/// <param name="rank">rank.</param>
/// <param name="since">since.</param>
public GroupMember(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), bool verified = default(bool), string photoUrl = default(string), DateTime? lastOnline = default(DateTime?), GroupRank? rank = default(GroupRank?), DateTime since = default(DateTime))
{
this.Id = id;
this.Uuid = uuid;
this.Name = name;
this.DisplayName = displayName;
this.Verified = verified;
this.PhotoUrl = photoUrl;
this.LastOnline = lastOnline;
this.Rank = rank;
this.Since = since;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets DisplayName
/// </summary>
[DataMember(Name = "display_name", EmitDefaultValue = true)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or Sets Verified
/// </summary>
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets LastOnline
/// </summary>
[DataMember(Name = "last_online", EmitDefaultValue = true)]
public DateTime? LastOnline { get; set; }
/// <summary>
/// Gets or Sets Since
/// </summary>
[DataMember(Name = "since", EmitDefaultValue = false)]
public DateTime Since { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GroupMember {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
sb.Append(" Rank: ").Append(Rank).Append("\n");
sb.Append(" Since: ").Append(Since).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,54 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines GroupRank
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum GroupRank
{
/// <summary>
/// Enum Member for value: member
/// </summary>
[EnumMember(Value = "member")]
Member,
/// <summary>
/// Enum Leader for value: leader
/// </summary>
[EnumMember(Value = "leader")]
Leader,
/// <summary>
/// Enum Owner for value: owner
/// </summary>
[EnumMember(Value = "owner")]
Owner
}
}

View File

@ -0,0 +1,83 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// HashViewModel
/// </summary>
[DataContract(Name = "HashViewModel")]
public partial class HashViewModel : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="HashViewModel" /> class.
/// </summary>
/// <param name="value">value.</param>
public HashViewModel(string value = default(string))
{
this.Value = value;
}
/// <summary>
/// Gets or Sets Value
/// </summary>
[DataMember(Name = "value", EmitDefaultValue = true)]
public string Value { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class HashViewModel {\n");
sb.Append(" Value: ").Append(Value).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,92 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// IntrospectRequest
/// </summary>
[DataContract(Name = "IntrospectRequest")]
public partial class IntrospectRequest : IValidatableObject
{
/// <summary>
/// Gets or Sets TokenTypeHint
/// </summary>
[DataMember(Name = "token_type_hint", EmitDefaultValue = false)]
public TokenHintType? TokenTypeHint { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="IntrospectRequest" /> class.
/// </summary>
/// <param name="token">token.</param>
/// <param name="tokenTypeHint">tokenTypeHint.</param>
public IntrospectRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?))
{
this.Token = token;
this.TokenTypeHint = tokenTypeHint;
}
/// <summary>
/// Gets or Sets Token
/// </summary>
[DataMember(Name = "token", EmitDefaultValue = true)]
public string Token { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class IntrospectRequest {\n");
sb.Append(" Token: ").Append(Token).Append("\n");
sb.Append(" TokenTypeHint: ").Append(TokenTypeHint).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,320 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// IpAddress
/// </summary>
[DataContract(Name = "IpAddress")]
public partial class IpAddress : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="IpAddress" /> class.
/// </summary>
/// <param name="address">address.</param>
/// <param name="varVersion">varVersion.</param>
/// <param name="network">network.</param>
/// <param name="reserved">reserved.</param>
/// <param name="asn">asn.</param>
/// <param name="isp">isp.</param>
/// <param name="continent">continent.</param>
/// <param name="country">country.</param>
/// <param name="region">region.</param>
/// <param name="city">city.</param>
/// <param name="postalCode">postalCode.</param>
/// <param name="callingCode">callingCode.</param>
/// <param name="tld">tld.</param>
/// <param name="language">language.</param>
/// <param name="timezone">timezone.</param>
/// <param name="currency">currency.</param>
/// <param name="latitude">latitude.</param>
/// <param name="longitude">longitude.</param>
public IpAddress(string address = default(string), int varVersion = default(int), string network = default(string), bool reserved = default(bool), string asn = default(string), string isp = default(string), string continent = default(string), string country = default(string), string region = default(string), string city = default(string), string postalCode = default(string), string callingCode = default(string), string tld = default(string), string language = default(string), string timezone = default(string), string currency = default(string), float? latitude = default(float?), float? longitude = default(float?))
{
this.Address = address;
this.VarVersion = varVersion;
this.Network = network;
this.Reserved = reserved;
this.Asn = asn;
this.Isp = isp;
this.Continent = continent;
this.Country = country;
this.Region = region;
this.City = city;
this.PostalCode = postalCode;
this.CallingCode = callingCode;
this.Tld = tld;
this.Language = language;
this.Timezone = timezone;
this.Currency = currency;
this.Latitude = latitude;
this.Longitude = longitude;
}
/// <summary>
/// Gets or Sets Address
/// </summary>
[DataMember(Name = "address", EmitDefaultValue = true)]
public string Address { get; set; }
/// <summary>
/// Gets or Sets VarVersion
/// </summary>
[DataMember(Name = "version", EmitDefaultValue = false)]
public int VarVersion { get; set; }
/// <summary>
/// Gets or Sets Network
/// </summary>
[DataMember(Name = "network", EmitDefaultValue = true)]
public string Network { get; set; }
/// <summary>
/// Gets or Sets Reserved
/// </summary>
[DataMember(Name = "reserved", EmitDefaultValue = true)]
public bool Reserved { get; set; }
/// <summary>
/// Gets or Sets Asn
/// </summary>
[DataMember(Name = "asn", EmitDefaultValue = true)]
public string Asn { get; set; }
/// <summary>
/// Gets or Sets Isp
/// </summary>
[DataMember(Name = "isp", EmitDefaultValue = true)]
public string Isp { get; set; }
/// <summary>
/// Gets or Sets Continent
/// </summary>
[DataMember(Name = "continent", EmitDefaultValue = true)]
public string Continent { get; set; }
/// <summary>
/// Gets or Sets Country
/// </summary>
[DataMember(Name = "country", EmitDefaultValue = true)]
public string Country { get; set; }
/// <summary>
/// Gets or Sets Region
/// </summary>
[DataMember(Name = "region", EmitDefaultValue = true)]
public string Region { get; set; }
/// <summary>
/// Gets or Sets City
/// </summary>
[DataMember(Name = "city", EmitDefaultValue = true)]
public string City { get; set; }
/// <summary>
/// Gets or Sets PostalCode
/// </summary>
[DataMember(Name = "postal_code", EmitDefaultValue = true)]
public string PostalCode { get; set; }
/// <summary>
/// Gets or Sets CallingCode
/// </summary>
[DataMember(Name = "calling_code", EmitDefaultValue = true)]
public string CallingCode { get; set; }
/// <summary>
/// Gets or Sets Tld
/// </summary>
[DataMember(Name = "tld", EmitDefaultValue = true)]
public string Tld { get; set; }
/// <summary>
/// Gets or Sets Language
/// </summary>
[DataMember(Name = "language", EmitDefaultValue = true)]
public string Language { get; set; }
/// <summary>
/// Gets or Sets Timezone
/// </summary>
[DataMember(Name = "timezone", EmitDefaultValue = true)]
public string Timezone { get; set; }
/// <summary>
/// Gets or Sets Currency
/// </summary>
[DataMember(Name = "currency", EmitDefaultValue = true)]
public string Currency { get; set; }
/// <summary>
/// Gets or Sets Latitude
/// </summary>
[DataMember(Name = "latitude", EmitDefaultValue = true)]
public float? Latitude { get; set; }
/// <summary>
/// Gets or Sets Longitude
/// </summary>
[DataMember(Name = "longitude", EmitDefaultValue = true)]
public float? Longitude { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class IpAddress {\n");
sb.Append(" Address: ").Append(Address).Append("\n");
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
sb.Append(" Network: ").Append(Network).Append("\n");
sb.Append(" Reserved: ").Append(Reserved).Append("\n");
sb.Append(" Asn: ").Append(Asn).Append("\n");
sb.Append(" Isp: ").Append(Isp).Append("\n");
sb.Append(" Continent: ").Append(Continent).Append("\n");
sb.Append(" Country: ").Append(Country).Append("\n");
sb.Append(" Region: ").Append(Region).Append("\n");
sb.Append(" City: ").Append(City).Append("\n");
sb.Append(" PostalCode: ").Append(PostalCode).Append("\n");
sb.Append(" CallingCode: ").Append(CallingCode).Append("\n");
sb.Append(" Tld: ").Append(Tld).Append("\n");
sb.Append(" Language: ").Append(Language).Append("\n");
sb.Append(" Timezone: ").Append(Timezone).Append("\n");
sb.Append(" Currency: ").Append(Currency).Append("\n");
sb.Append(" Latitude: ").Append(Latitude).Append("\n");
sb.Append(" Longitude: ").Append(Longitude).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Address (string) maxLength
if (this.Address != null && this.Address.Length > 255)
{
yield return new ValidationResult("Invalid value for Address, length must be less than 255.", new [] { "Address" });
}
// Network (string) maxLength
if (this.Network != null && this.Network.Length > 255)
{
yield return new ValidationResult("Invalid value for Network, length must be less than 255.", new [] { "Network" });
}
// Asn (string) maxLength
if (this.Asn != null && this.Asn.Length > 10)
{
yield return new ValidationResult("Invalid value for Asn, length must be less than 10.", new [] { "Asn" });
}
// Isp (string) maxLength
if (this.Isp != null && this.Isp.Length > 255)
{
yield return new ValidationResult("Invalid value for Isp, length must be less than 255.", new [] { "Isp" });
}
// Continent (string) maxLength
if (this.Continent != null && this.Continent.Length > 2)
{
yield return new ValidationResult("Invalid value for Continent, length must be less than 2.", new [] { "Continent" });
}
// Country (string) maxLength
if (this.Country != null && this.Country.Length > 2)
{
yield return new ValidationResult("Invalid value for Country, length must be less than 2.", new [] { "Country" });
}
// Region (string) maxLength
if (this.Region != null && this.Region.Length > 255)
{
yield return new ValidationResult("Invalid value for Region, length must be less than 255.", new [] { "Region" });
}
// City (string) maxLength
if (this.City != null && this.City.Length > 255)
{
yield return new ValidationResult("Invalid value for City, length must be less than 255.", new [] { "City" });
}
// PostalCode (string) maxLength
if (this.PostalCode != null && this.PostalCode.Length > 45)
{
yield return new ValidationResult("Invalid value for PostalCode, length must be less than 45.", new [] { "PostalCode" });
}
// CallingCode (string) maxLength
if (this.CallingCode != null && this.CallingCode.Length > 4)
{
yield return new ValidationResult("Invalid value for CallingCode, length must be less than 4.", new [] { "CallingCode" });
}
// Tld (string) maxLength
if (this.Tld != null && this.Tld.Length > 3)
{
yield return new ValidationResult("Invalid value for Tld, length must be less than 3.", new [] { "Tld" });
}
// Language (string) maxLength
if (this.Language != null && this.Language.Length > 5)
{
yield return new ValidationResult("Invalid value for Language, length must be less than 5.", new [] { "Language" });
}
// Timezone (string) maxLength
if (this.Timezone != null && this.Timezone.Length > 45)
{
yield return new ValidationResult("Invalid value for Timezone, length must be less than 45.", new [] { "Timezone" });
}
// Currency (string) maxLength
if (this.Currency != null && this.Currency.Length > 3)
{
yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" });
}
yield break;
}
}
}

View File

@ -0,0 +1,128 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// LeaderboardItem
/// </summary>
[DataContract(Name = "LeaderboardItem")]
public partial class LeaderboardItem : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="LeaderboardItem" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="displayName">displayName.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="level">level.</param>
/// <param name="experience">experience.</param>
/// <param name="points">points.</param>
public LeaderboardItem(string name = default(string), string displayName = default(string), string photoUrl = default(string), int level = default(int), double experience = default(double), double points = default(double))
{
this.Name = name;
this.DisplayName = displayName;
this.PhotoUrl = photoUrl;
this.Level = level;
this.Experience = experience;
this.Points = points;
}
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets DisplayName
/// </summary>
[DataMember(Name = "display_name", EmitDefaultValue = true)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets Level
/// </summary>
[DataMember(Name = "level", EmitDefaultValue = false)]
public int Level { get; set; }
/// <summary>
/// Gets or Sets Experience
/// </summary>
[DataMember(Name = "experience", EmitDefaultValue = false)]
public double Experience { get; set; }
/// <summary>
/// Gets or Sets Points
/// </summary>
[DataMember(Name = "points", EmitDefaultValue = false)]
public double Points { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class LeaderboardItem {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" Level: ").Append(Level).Append("\n");
sb.Append(" Experience: ").Append(Experience).Append("\n");
sb.Append(" Points: ").Append(Points).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines LeaderboardOrder
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum LeaderboardOrder
{
/// <summary>
/// Enum Level for value: level
/// </summary>
[EnumMember(Value = "level")]
Level,
/// <summary>
/// Enum Points for value: points
/// </summary>
[EnumMember(Value = "points")]
Points
}
}

View File

@ -0,0 +1,78 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines LoginProvider
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum LoginProvider
{
/// <summary>
/// Enum Steam for value: steam
/// </summary>
[EnumMember(Value = "steam")]
Steam,
/// <summary>
/// Enum Epic for value: epic
/// </summary>
[EnumMember(Value = "epic")]
Epic,
/// <summary>
/// Enum Discord for value: discord
/// </summary>
[EnumMember(Value = "discord")]
Discord,
/// <summary>
/// Enum Microsoft for value: microsoft
/// </summary>
[EnumMember(Value = "microsoft")]
Microsoft,
/// <summary>
/// Enum Playstation for value: playstation
/// </summary>
[EnumMember(Value = "playstation")]
Playstation,
/// <summary>
/// Enum Google for value: google
/// </summary>
[EnumMember(Value = "google")]
Google,
/// <summary>
/// Enum Apple for value: apple
/// </summary>
[EnumMember(Value = "apple")]
Apple
}
}

View File

@ -0,0 +1,92 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// LoginRequest
/// </summary>
[DataContract(Name = "LoginRequest")]
public partial class LoginRequest : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="LoginRequest" /> class.
/// </summary>
/// <param name="login">login.</param>
/// <param name="password">password.</param>
public LoginRequest(string login = default(string), string password = default(string))
{
this.Login = login;
this.Password = password;
}
/// <summary>
/// Gets or Sets Login
/// </summary>
[DataMember(Name = "login", EmitDefaultValue = true)]
public string Login { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name = "password", EmitDefaultValue = true)]
public string Password { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class LoginRequest {\n");
sb.Append(" Login: ").Append(Login).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,110 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// LoginResponse
/// </summary>
[DataContract(Name = "LoginResponse")]
public partial class LoginResponse : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="LoginResponse" /> class.
/// </summary>
/// <param name="user">user.</param>
/// <param name="accessToken">accessToken.</param>
/// <param name="refreshToken">refreshToken.</param>
/// <param name="expiresIn">expiresIn.</param>
public LoginResponse(UserInfo user = default(UserInfo), string accessToken = default(string), string refreshToken = default(string), long expiresIn = default(long))
{
this.User = user;
this.AccessToken = accessToken;
this.RefreshToken = refreshToken;
this.ExpiresIn = expiresIn;
}
/// <summary>
/// Gets or Sets User
/// </summary>
[DataMember(Name = "user", EmitDefaultValue = false)]
public UserInfo User { get; set; }
/// <summary>
/// Gets or Sets AccessToken
/// </summary>
[DataMember(Name = "access_token", EmitDefaultValue = true)]
public string AccessToken { get; set; }
/// <summary>
/// Gets or Sets RefreshToken
/// </summary>
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
public string RefreshToken { get; set; }
/// <summary>
/// Gets or Sets ExpiresIn
/// </summary>
[DataMember(Name = "expires_in", EmitDefaultValue = false)]
public long ExpiresIn { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class LoginResponse {\n");
sb.Append(" User: ").Append(User).Append("\n");
sb.Append(" AccessToken: ").Append(AccessToken).Append("\n");
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
sb.Append(" ExpiresIn: ").Append(ExpiresIn).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,188 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Package
/// </summary>
[DataContract(Name = "Package")]
public partial class Package : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="Package" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="imageUrl">imageUrl.</param>
/// <param name="authorId">authorId.</param>
/// <param name="varVersion">varVersion.</param>
/// <param name="fileUrl">fileUrl.</param>
/// <param name="rawSize">rawSize.</param>
/// <param name="downloadCount">downloadCount.</param>
/// <param name="lastDownload">lastDownload.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Package(string id = default(string), string name = default(string), string description = default(string), string imageUrl = default(string), string authorId = default(string), string varVersion = default(string), string fileUrl = default(string), double rawSize = default(double), int downloadCount = default(int), DateTime? lastDownload = default(DateTime?), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Description = description;
this.ImageUrl = imageUrl;
this.AuthorId = authorId;
this.VarVersion = varVersion;
this.FileUrl = fileUrl;
this.RawSize = rawSize;
this.DownloadCount = downloadCount;
this.LastDownload = lastDownload;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets ImageUrl
/// </summary>
[DataMember(Name = "image_url", EmitDefaultValue = true)]
public string ImageUrl { get; set; }
/// <summary>
/// Gets or Sets AuthorId
/// </summary>
[DataMember(Name = "author_id", EmitDefaultValue = false)]
public string AuthorId { get; set; }
/// <summary>
/// Gets or Sets VarVersion
/// </summary>
[DataMember(Name = "version", EmitDefaultValue = true)]
public string VarVersion { get; set; }
/// <summary>
/// Gets or Sets FileUrl
/// </summary>
[DataMember(Name = "file_url", EmitDefaultValue = true)]
public string FileUrl { get; set; }
/// <summary>
/// Gets or Sets RawSize
/// </summary>
[DataMember(Name = "raw_size", EmitDefaultValue = false)]
public double RawSize { get; set; }
/// <summary>
/// Gets or Sets DownloadCount
/// </summary>
[DataMember(Name = "download_count", EmitDefaultValue = false)]
public int DownloadCount { get; set; }
/// <summary>
/// Gets or Sets LastDownload
/// </summary>
[DataMember(Name = "last_download", EmitDefaultValue = true)]
public DateTime? LastDownload { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Package {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n");
sb.Append(" AuthorId: ").Append(AuthorId).Append("\n");
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
sb.Append(" FileUrl: ").Append(FileUrl).Append("\n");
sb.Append(" RawSize: ").Append(RawSize).Append("\n");
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
sb.Append(" LastDownload: ").Append(LastDownload).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 45)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 45.", new [] { "Name" });
}
yield break;
}
}
}

View File

@ -0,0 +1,236 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Profile
/// </summary>
[DataContract(Name = "Profile")]
public partial class Profile : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="Profile" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="uuid">uuid.</param>
/// <param name="name">name.</param>
/// <param name="displayName">displayName.</param>
/// <param name="verified">verified.</param>
/// <param name="level">level.</param>
/// <param name="experience">experience.</param>
/// <param name="publicBirthday">publicBirthday.</param>
/// <param name="birthday">birthday.</param>
/// <param name="points">points.</param>
/// <param name="location">location.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="lastOnline">lastOnline.</param>
/// <param name="biography">biography.</param>
/// <param name="viewCount">viewCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Profile(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), bool verified = default(bool), int level = default(int), double experience = default(double), bool publicBirthday = default(bool), DateOnly? birthday = default(DateOnly?), double points = default(double), string location = default(string), string photoUrl = default(string), string bannerUrl = default(string), DateTime? lastOnline = default(DateTime?), string biography = default(string), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Uuid = uuid;
this.Name = name;
this.DisplayName = displayName;
this.Verified = verified;
this.Level = level;
this.Experience = experience;
this.PublicBirthday = publicBirthday;
this.Birthday = birthday;
this.Points = points;
this.Location = location;
this.PhotoUrl = photoUrl;
this.BannerUrl = bannerUrl;
this.LastOnline = lastOnline;
this.Biography = biography;
this.ViewCount = viewCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets DisplayName
/// </summary>
[DataMember(Name = "display_name", EmitDefaultValue = true)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or Sets Verified
/// </summary>
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
/// <summary>
/// Gets or Sets Level
/// </summary>
[DataMember(Name = "level", EmitDefaultValue = false)]
public int Level { get; set; }
/// <summary>
/// Gets or Sets Experience
/// </summary>
[DataMember(Name = "experience", EmitDefaultValue = false)]
public double Experience { get; set; }
/// <summary>
/// Gets or Sets PublicBirthday
/// </summary>
[DataMember(Name = "public_birthday", EmitDefaultValue = true)]
public bool PublicBirthday { get; set; }
/// <summary>
/// Gets or Sets Birthday
/// </summary>
[DataMember(Name = "birthday", EmitDefaultValue = true)]
public DateOnly? Birthday { get; set; }
/// <summary>
/// Gets or Sets Points
/// </summary>
[DataMember(Name = "points", EmitDefaultValue = false)]
public double Points { get; set; }
/// <summary>
/// Gets or Sets Location
/// </summary>
[DataMember(Name = "location", EmitDefaultValue = true)]
public string Location { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets LastOnline
/// </summary>
[DataMember(Name = "last_online", EmitDefaultValue = true)]
public DateTime? LastOnline { get; set; }
/// <summary>
/// Gets or Sets Biography
/// </summary>
[DataMember(Name = "biography", EmitDefaultValue = true)]
public string Biography { get; set; }
/// <summary>
/// Gets or Sets ViewCount
/// </summary>
[DataMember(Name = "view_count", EmitDefaultValue = false)]
public int ViewCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Profile {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" Level: ").Append(Level).Append("\n");
sb.Append(" Experience: ").Append(Experience).Append("\n");
sb.Append(" PublicBirthday: ").Append(PublicBirthday).Append("\n");
sb.Append(" Birthday: ").Append(Birthday).Append("\n");
sb.Append(" Points: ").Append(Points).Append("\n");
sb.Append(" Location: ").Append(Location).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
sb.Append(" Biography: ").Append(Biography).Append("\n");
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,173 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// ProfileGame
/// </summary>
[DataContract(Name = "ProfileGame")]
public partial class ProfileGame : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="ProfileGame" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
/// <param name="libraryImageUrl">libraryImageUrl.</param>
/// <param name="slug">slug.</param>
/// <param name="timeUsed">timeUsed.</param>
/// <param name="unlockedAchievements">unlockedAchievements.</param>
/// <param name="totalAchievements">totalAchievements.</param>
/// <param name="stats">stats.</param>
/// <param name="acquired">acquired.</param>
/// <param name="lastUsed">lastUsed.</param>
public ProfileGame(string id = default(string), string name = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string slug = default(string), double timeUsed = default(double), int unlockedAchievements = default(int), int totalAchievements = default(int), Object stats = default(Object), DateTime acquired = default(DateTime), DateTime? lastUsed = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.CapsuleImageUrl = capsuleImageUrl;
this.LibraryImageUrl = libraryImageUrl;
this.Slug = slug;
this.TimeUsed = timeUsed;
this.UnlockedAchievements = unlockedAchievements;
this.TotalAchievements = totalAchievements;
this.Stats = stats;
this.Acquired = acquired;
this.LastUsed = lastUsed;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets CapsuleImageUrl
/// </summary>
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
public string CapsuleImageUrl { get; set; }
/// <summary>
/// Gets or Sets LibraryImageUrl
/// </summary>
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
public string LibraryImageUrl { get; set; }
/// <summary>
/// Gets or Sets Slug
/// </summary>
[DataMember(Name = "slug", EmitDefaultValue = true)]
public string Slug { get; set; }
/// <summary>
/// Gets or Sets TimeUsed
/// </summary>
[DataMember(Name = "time_used", EmitDefaultValue = false)]
public double TimeUsed { get; set; }
/// <summary>
/// Gets or Sets UnlockedAchievements
/// </summary>
[DataMember(Name = "unlocked_achievements", EmitDefaultValue = false)]
public int UnlockedAchievements { get; set; }
/// <summary>
/// Gets or Sets TotalAchievements
/// </summary>
[DataMember(Name = "total_achievements", EmitDefaultValue = false)]
public int TotalAchievements { get; set; }
/// <summary>
/// Gets or Sets Stats
/// </summary>
[DataMember(Name = "stats", EmitDefaultValue = true)]
public Object Stats { get; set; }
/// <summary>
/// Gets or Sets Acquired
/// </summary>
[DataMember(Name = "acquired", EmitDefaultValue = false)]
public DateTime Acquired { get; set; }
/// <summary>
/// Gets or Sets LastUsed
/// </summary>
[DataMember(Name = "last_used", EmitDefaultValue = true)]
public DateTime? LastUsed { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class ProfileGame {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
sb.Append(" Slug: ").Append(Slug).Append("\n");
sb.Append(" TimeUsed: ").Append(TimeUsed).Append("\n");
sb.Append(" UnlockedAchievements: ").Append(UnlockedAchievements).Append("\n");
sb.Append(" TotalAchievements: ").Append(TotalAchievements).Append("\n");
sb.Append(" Stats: ").Append(Stats).Append("\n");
sb.Append(" Acquired: ").Append(Acquired).Append("\n");
sb.Append(" LastUsed: ").Append(LastUsed).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,164 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// ProfileGroup
/// </summary>
[DataContract(Name = "ProfileGroup")]
public partial class ProfileGroup : IValidatableObject
{
/// <summary>
/// Gets or Sets Rank
/// </summary>
[DataMember(Name = "rank", EmitDefaultValue = false)]
public GroupRank? Rank { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ProfileGroup" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="uuid">uuid.</param>
/// <param name="name">name.</param>
/// <param name="tag">tag.</param>
/// <param name="privacy">privacy.</param>
/// <param name="verified">verified.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="memberCount">memberCount.</param>
/// <param name="rank">rank.</param>
/// <param name="since">since.</param>
public ProfileGroup(string id = default(string), Guid uuid = default(Guid), string name = default(string), string tag = default(string), int privacy = default(int), bool verified = default(bool), string photoUrl = default(string), int memberCount = default(int), GroupRank? rank = default(GroupRank?), DateTime since = default(DateTime))
{
this.Id = id;
this.Uuid = uuid;
this.Name = name;
this.Tag = tag;
this.Privacy = privacy;
this.Verified = verified;
this.PhotoUrl = photoUrl;
this.MemberCount = memberCount;
this.Rank = rank;
this.Since = since;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Tag
/// </summary>
[DataMember(Name = "tag", EmitDefaultValue = true)]
public string Tag { get; set; }
/// <summary>
/// Gets or Sets Privacy
/// </summary>
[DataMember(Name = "privacy", EmitDefaultValue = false)]
public int Privacy { get; set; }
/// <summary>
/// Gets or Sets Verified
/// </summary>
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets MemberCount
/// </summary>
[DataMember(Name = "member_count", EmitDefaultValue = false)]
public int MemberCount { get; set; }
/// <summary>
/// Gets or Sets Since
/// </summary>
[DataMember(Name = "since", EmitDefaultValue = false)]
public DateTime Since { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class ProfileGroup {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Tag: ").Append(Tag).Append("\n");
sb.Append(" Privacy: ").Append(Privacy).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" MemberCount: ").Append(MemberCount).Append("\n");
sb.Append(" Rank: ").Append(Rank).Append("\n");
sb.Append(" Since: ").Append(Since).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,83 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// RefreshRequest
/// </summary>
[DataContract(Name = "RefreshRequest")]
public partial class RefreshRequest : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="RefreshRequest" /> class.
/// </summary>
/// <param name="refreshToken">refreshToken.</param>
public RefreshRequest(string refreshToken = default(string))
{
this.RefreshToken = refreshToken;
}
/// <summary>
/// Gets or Sets RefreshToken
/// </summary>
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
public string RefreshToken { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RefreshRequest {\n");
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,167 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// RegisterRequest
/// </summary>
[DataContract(Name = "RegisterRequest")]
public partial class RegisterRequest : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="RegisterRequest" /> class.
/// </summary>
[JsonConstructorAttribute]
protected RegisterRequest() { }
/// <summary>
/// Initializes a new instance of the <see cref="RegisterRequest" /> class.
/// </summary>
/// <param name="uuid">uuid.</param>
/// <param name="name">name (required).</param>
/// <param name="email">email.</param>
/// <param name="password">password (required).</param>
public RegisterRequest(Guid? uuid = default(Guid?), string name = default(string), string email = default(string), string password = default(string))
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new ArgumentNullException("name is a required property for RegisterRequest and cannot be null");
}
this.Name = name;
// to ensure "password" is required (not null)
if (password == null)
{
throw new ArgumentNullException("password is a required property for RegisterRequest and cannot be null");
}
this.Password = password;
this.Uuid = uuid;
this.Email = email;
}
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = true)]
public Guid? Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Email
/// </summary>
[DataMember(Name = "email", EmitDefaultValue = true)]
public string Email { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)]
public string Password { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RegisterRequest {\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Email: ").Append(Email).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 45)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 45.", new [] { "Name" });
}
// Name (string) minLength
if (this.Name != null && this.Name.Length < 3)
{
yield return new ValidationResult("Invalid value for Name, length must be greater than 3.", new [] { "Name" });
}
if (this.Name != null) {
// Name (string) pattern
Regex regexName = new Regex(@"^[a-zA-Z0-9-_]*$", RegexOptions.CultureInvariant);
if (!regexName.Match(this.Name).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
}
}
// Email (string) maxLength
if (this.Email != null && this.Email.Length > 255)
{
yield return new ValidationResult("Invalid value for Email, length must be less than 255.", new [] { "Email" });
}
if (this.Email != null) {
// Email (string) pattern
Regex regexEmail = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$", RegexOptions.CultureInvariant);
if (!regexEmail.Match(this.Email).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Email, must match a pattern of " + regexEmail, new [] { "Email" });
}
}
// Password (string) minLength
if (this.Password != null && this.Password.Length < 1)
{
yield return new ValidationResult("Invalid value for Password, length must be greater than 1.", new [] { "Password" });
}
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines ResponseType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ResponseType
{
/// <summary>
/// Enum Code for value: code
/// </summary>
[EnumMember(Value = "code")]
Code,
/// <summary>
/// Enum Token for value: token
/// </summary>
[EnumMember(Value = "token")]
Token
}
}

View File

@ -0,0 +1,92 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// RevokeRequest
/// </summary>
[DataContract(Name = "RevokeRequest")]
public partial class RevokeRequest : IValidatableObject
{
/// <summary>
/// Gets or Sets TokenTypeHint
/// </summary>
[DataMember(Name = "token_type_hint", EmitDefaultValue = false)]
public TokenHintType? TokenTypeHint { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="RevokeRequest" /> class.
/// </summary>
/// <param name="token">token.</param>
/// <param name="tokenTypeHint">tokenTypeHint.</param>
public RevokeRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?))
{
this.Token = token;
this.TokenTypeHint = tokenTypeHint;
}
/// <summary>
/// Gets or Sets Token
/// </summary>
[DataMember(Name = "token", EmitDefaultValue = true)]
public string Token { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RevokeRequest {\n");
sb.Append(" Token: ").Append(Token).Append("\n");
sb.Append(" TokenTypeHint: ").Append(TokenTypeHint).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,110 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// SearchRequest
/// </summary>
[DataContract(Name = "SearchRequest")]
public partial class SearchRequest : IValidatableObject
{
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public SearchType? Type { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="SearchRequest" /> class.
/// </summary>
/// <param name="type">type.</param>
/// <param name="query">query.</param>
/// <param name="page">page.</param>
/// <param name="gameId">gameId.</param>
public SearchRequest(SearchType? type = default(SearchType?), string query = default(string), int? page = default(int?), string gameId = default(string))
{
this.Type = type;
this.Query = query;
this.Page = page;
this.GameId = gameId;
}
/// <summary>
/// Gets or Sets Query
/// </summary>
[DataMember(Name = "query", EmitDefaultValue = true)]
public string Query { get; set; }
/// <summary>
/// Gets or Sets Page
/// </summary>
[DataMember(Name = "page", EmitDefaultValue = true)]
public int? Page { get; set; }
/// <summary>
/// Gets or Sets GameId
/// </summary>
[DataMember(Name = "game_id", EmitDefaultValue = true)]
public string GameId { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class SearchRequest {\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Query: ").Append(Query).Append("\n");
sb.Append(" Page: ").Append(Page).Append("\n");
sb.Append(" GameId: ").Append(GameId).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,60 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines SearchType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum SearchType
{
/// <summary>
/// Enum User for value: user
/// </summary>
[EnumMember(Value = "user")]
User,
/// <summary>
/// Enum Group for value: group
/// </summary>
[EnumMember(Value = "group")]
Group,
/// <summary>
/// Enum Server for value: server
/// </summary>
[EnumMember(Value = "server")]
Server,
/// <summary>
/// Enum Cluster for value: cluster
/// </summary>
[EnumMember(Value = "cluster")]
Cluster
}
}

View File

@ -0,0 +1,101 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// ServerMetrics
/// </summary>
[DataContract(Name = "ServerMetrics")]
public partial class ServerMetrics : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="ServerMetrics" /> class.
/// </summary>
/// <param name="serverCount">serverCount.</param>
/// <param name="packageCount">packageCount.</param>
/// <param name="countryCount">countryCount.</param>
public ServerMetrics(int serverCount = default(int), int packageCount = default(int), int countryCount = default(int))
{
this.ServerCount = serverCount;
this.PackageCount = packageCount;
this.CountryCount = countryCount;
}
/// <summary>
/// Gets or Sets ServerCount
/// </summary>
[DataMember(Name = "server_count", EmitDefaultValue = false)]
public int ServerCount { get; set; }
/// <summary>
/// Gets or Sets PackageCount
/// </summary>
[DataMember(Name = "package_count", EmitDefaultValue = false)]
public int PackageCount { get; set; }
/// <summary>
/// Gets or Sets CountryCount
/// </summary>
[DataMember(Name = "country_count", EmitDefaultValue = false)]
public int CountryCount { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class ServerMetrics {\n");
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
sb.Append(" PackageCount: ").Append(PackageCount).Append("\n");
sb.Append(" CountryCount: ").Append(CountryCount).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,54 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines ServerStatus
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ServerStatus
{
/// <summary>
/// Enum Unknown for value: unknown
/// </summary>
[EnumMember(Value = "unknown")]
Unknown,
/// <summary>
/// Enum Offline for value: offline
/// </summary>
[EnumMember(Value = "offline")]
Offline,
/// <summary>
/// Enum Online for value: online
/// </summary>
[EnumMember(Value = "online")]
Online
}
}

View File

@ -0,0 +1,155 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Subscription
/// </summary>
[DataContract(Name = "Subscription")]
public partial class Subscription : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="Subscription" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name.</param>
/// <param name="description">description.</param>
/// <param name="imageUrl">imageUrl.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public Subscription(string id = default(string), string name = default(string), string description = default(string), string imageUrl = default(string), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Name = name;
this.Description = description;
this.ImageUrl = imageUrl;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets Description
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
/// <summary>
/// Gets or Sets ImageUrl
/// </summary>
[DataMember(Name = "image_url", EmitDefaultValue = true)]
public string ImageUrl { get; set; }
/// <summary>
/// Gets or Sets Prices
/// </summary>
[DataMember(Name = "prices", EmitDefaultValue = true)]
public Dictionary<string, double> Prices { get; private set; }
/// <summary>
/// Returns false as Prices should not be serialized given that it's read-only.
/// </summary>
/// <returns>false (boolean)</returns>
public bool ShouldSerializePrices()
{
return false;
}
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Subscription {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n");
sb.Append(" Prices: ").Append(Prices).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) maxLength
if (this.Name != null && this.Name.Length > 75)
{
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
}
// ImageUrl (string) maxLength
if (this.ImageUrl != null && this.ImageUrl.Length > 255)
{
yield return new ValidationResult("Invalid value for ImageUrl, length must be less than 255.", new [] { "ImageUrl" });
}
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines TokenHintType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum TokenHintType
{
/// <summary>
/// Enum AccessToken for value: access_token
/// </summary>
[EnumMember(Value = "access_token")]
AccessToken,
/// <summary>
/// Enum RefreshToken for value: refresh_token
/// </summary>
[EnumMember(Value = "refresh_token")]
RefreshToken
}
}

View File

@ -0,0 +1,146 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// TokenRequest
/// </summary>
[DataContract(Name = "TokenRequest")]
public partial class TokenRequest : IValidatableObject
{
/// <summary>
/// Gets or Sets GrantType
/// </summary>
[DataMember(Name = "grant_type", EmitDefaultValue = false)]
public GrantType? GrantType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="TokenRequest" /> class.
/// </summary>
/// <param name="grantType">grantType.</param>
/// <param name="code">code.</param>
/// <param name="username">username.</param>
/// <param name="password">password.</param>
/// <param name="refreshToken">refreshToken.</param>
/// <param name="clientId">clientId.</param>
/// <param name="redirectUri">redirectUri.</param>
/// <param name="codeVerifier">codeVerifier.</param>
public TokenRequest(GrantType? grantType = default(GrantType?), string code = default(string), string username = default(string), string password = default(string), string refreshToken = default(string), string clientId = default(string), string redirectUri = default(string), string codeVerifier = default(string))
{
this.GrantType = grantType;
this.Code = code;
this.Username = username;
this.Password = password;
this.RefreshToken = refreshToken;
this.ClientId = clientId;
this.RedirectUri = redirectUri;
this.CodeVerifier = codeVerifier;
}
/// <summary>
/// Gets or Sets Code
/// </summary>
[DataMember(Name = "code", EmitDefaultValue = true)]
public string Code { get; set; }
/// <summary>
/// Gets or Sets Username
/// </summary>
[DataMember(Name = "username", EmitDefaultValue = true)]
public string Username { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name = "password", EmitDefaultValue = true)]
public string Password { get; set; }
/// <summary>
/// Gets or Sets RefreshToken
/// </summary>
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
public string RefreshToken { get; set; }
/// <summary>
/// Gets or Sets ClientId
/// </summary>
[DataMember(Name = "client_id", EmitDefaultValue = true)]
public string ClientId { get; set; }
/// <summary>
/// Gets or Sets RedirectUri
/// </summary>
[DataMember(Name = "redirect_uri", EmitDefaultValue = true)]
public string RedirectUri { get; set; }
/// <summary>
/// Gets or Sets CodeVerifier
/// </summary>
[DataMember(Name = "code_verifier", EmitDefaultValue = true)]
public string CodeVerifier { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class TokenRequest {\n");
sb.Append(" GrantType: ").Append(GrantType).Append("\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Username: ").Append(Username).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
sb.Append(" RedirectUri: ").Append(RedirectUri).Append("\n");
sb.Append(" CodeVerifier: ").Append(CodeVerifier).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,128 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// TokenResponse
/// </summary>
[DataContract(Name = "TokenResponse")]
public partial class TokenResponse : IValidatableObject
{
/// <summary>
/// Gets or Sets TokenType
/// </summary>
[DataMember(Name = "token_type", EmitDefaultValue = false)]
public TokenType? TokenType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="TokenResponse" /> class.
/// </summary>
/// <param name="tokenType">tokenType.</param>
/// <param name="accessToken">accessToken.</param>
/// <param name="refreshToken">refreshToken.</param>
/// <param name="scope">scope.</param>
/// <param name="state">state.</param>
/// <param name="expiresIn">expiresIn.</param>
public TokenResponse(TokenType? tokenType = default(TokenType?), string accessToken = default(string), string refreshToken = default(string), string scope = default(string), string state = default(string), long expiresIn = default(long))
{
this.TokenType = tokenType;
this.AccessToken = accessToken;
this.RefreshToken = refreshToken;
this.Scope = scope;
this.State = state;
this.ExpiresIn = expiresIn;
}
/// <summary>
/// Gets or Sets AccessToken
/// </summary>
[DataMember(Name = "access_token", EmitDefaultValue = true)]
public string AccessToken { get; set; }
/// <summary>
/// Gets or Sets RefreshToken
/// </summary>
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
public string RefreshToken { get; set; }
/// <summary>
/// Gets or Sets Scope
/// </summary>
[DataMember(Name = "scope", EmitDefaultValue = true)]
public string Scope { get; set; }
/// <summary>
/// Gets or Sets State
/// </summary>
[DataMember(Name = "state", EmitDefaultValue = true)]
public string State { get; set; }
/// <summary>
/// Gets or Sets ExpiresIn
/// </summary>
[DataMember(Name = "expires_in", EmitDefaultValue = false)]
public long ExpiresIn { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class TokenResponse {\n");
sb.Append(" TokenType: ").Append(TokenType).Append("\n");
sb.Append(" AccessToken: ").Append(AccessToken).Append("\n");
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
sb.Append(" Scope: ").Append(Scope).Append("\n");
sb.Append(" State: ").Append(State).Append("\n");
sb.Append(" ExpiresIn: ").Append(ExpiresIn).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,42 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines TokenType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum TokenType
{
/// <summary>
/// Enum Bearer for value: bearer
/// </summary>
[EnumMember(Value = "bearer")]
Bearer
}
}

View File

@ -0,0 +1,92 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// UpdateProfile
/// </summary>
[DataContract(Name = "UpdateProfile")]
public partial class UpdateProfile : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateProfile" /> class.
/// </summary>
/// <param name="displayName">displayName.</param>
/// <param name="biography">biography.</param>
public UpdateProfile(string displayName = default(string), string biography = default(string))
{
this.DisplayName = displayName;
this.Biography = biography;
}
/// <summary>
/// Gets or Sets DisplayName
/// </summary>
[DataMember(Name = "display_name", EmitDefaultValue = true)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or Sets Biography
/// </summary>
[DataMember(Name = "biography", EmitDefaultValue = true)]
public string Biography { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class UpdateProfile {\n");
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
sb.Append(" Biography: ").Append(Biography).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,299 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// UserInfo
/// </summary>
[DataContract(Name = "UserInfo")]
public partial class UserInfo : IValidatableObject
{
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public UserType? Type { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="UserInfo" /> class.
/// </summary>
/// <param name="id">id.</param>
/// <param name="uuid">uuid.</param>
/// <param name="name">name.</param>
/// <param name="displayName">displayName.</param>
/// <param name="email">email.</param>
/// <param name="type">type.</param>
/// <param name="flags">flags.</param>
/// <param name="permissions">permissions.</param>
/// <param name="verified">verified.</param>
/// <param name="level">level.</param>
/// <param name="experience">experience.</param>
/// <param name="publicBirthday">publicBirthday.</param>
/// <param name="birthday">birthday.</param>
/// <param name="points">points.</param>
/// <param name="location">location.</param>
/// <param name="language">language.</param>
/// <param name="timezone">timezone.</param>
/// <param name="currency">currency.</param>
/// <param name="photoUrl">photoUrl.</param>
/// <param name="bannerUrl">bannerUrl.</param>
/// <param name="lastOnline">lastOnline.</param>
/// <param name="biography">biography.</param>
/// <param name="viewCount">viewCount.</param>
/// <param name="created">created.</param>
/// <param name="updated">updated.</param>
public UserInfo(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), string email = default(string), UserType? type = default(UserType?), string flags = default(string), string permissions = default(string), bool verified = default(bool), int level = default(int), double experience = default(double), bool publicBirthday = default(bool), DateOnly? birthday = default(DateOnly?), double points = default(double), string location = default(string), string language = default(string), string timezone = default(string), string currency = default(string), string photoUrl = default(string), string bannerUrl = default(string), DateTime? lastOnline = default(DateTime?), string biography = default(string), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
this.Id = id;
this.Uuid = uuid;
this.Name = name;
this.DisplayName = displayName;
this.Email = email;
this.Type = type;
this.Flags = flags;
this.Permissions = permissions;
this.Verified = verified;
this.Level = level;
this.Experience = experience;
this.PublicBirthday = publicBirthday;
this.Birthday = birthday;
this.Points = points;
this.Location = location;
this.Language = language;
this.Timezone = timezone;
this.Currency = currency;
this.PhotoUrl = photoUrl;
this.BannerUrl = bannerUrl;
this.LastOnline = lastOnline;
this.Biography = biography;
this.ViewCount = viewCount;
this.Created = created;
this.Updated = updated;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets DisplayName
/// </summary>
[DataMember(Name = "display_name", EmitDefaultValue = true)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or Sets Email
/// </summary>
[DataMember(Name = "email", EmitDefaultValue = true)]
public string Email { get; set; }
/// <summary>
/// Gets or Sets Flags
/// </summary>
[DataMember(Name = "flags", EmitDefaultValue = false)]
public string Flags { get; set; }
/// <summary>
/// Gets or Sets Permissions
/// </summary>
[DataMember(Name = "permissions", EmitDefaultValue = false)]
public string Permissions { get; set; }
/// <summary>
/// Gets or Sets Verified
/// </summary>
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
/// <summary>
/// Gets or Sets Level
/// </summary>
[DataMember(Name = "level", EmitDefaultValue = false)]
public int Level { get; set; }
/// <summary>
/// Gets or Sets Experience
/// </summary>
[DataMember(Name = "experience", EmitDefaultValue = false)]
public double Experience { get; set; }
/// <summary>
/// Gets or Sets PublicBirthday
/// </summary>
[DataMember(Name = "public_birthday", EmitDefaultValue = true)]
public bool PublicBirthday { get; set; }
/// <summary>
/// Gets or Sets Birthday
/// </summary>
[DataMember(Name = "birthday", EmitDefaultValue = true)]
public DateOnly? Birthday { get; set; }
/// <summary>
/// Gets or Sets Points
/// </summary>
[DataMember(Name = "points", EmitDefaultValue = false)]
public double Points { get; set; }
/// <summary>
/// Gets or Sets Location
/// </summary>
[DataMember(Name = "location", EmitDefaultValue = true)]
public string Location { get; set; }
/// <summary>
/// Gets or Sets Language
/// </summary>
[DataMember(Name = "language", EmitDefaultValue = true)]
public string Language { get; set; }
/// <summary>
/// Gets or Sets Timezone
/// </summary>
[DataMember(Name = "timezone", EmitDefaultValue = true)]
public string Timezone { get; set; }
/// <summary>
/// Gets or Sets Currency
/// </summary>
[DataMember(Name = "currency", EmitDefaultValue = true)]
public string Currency { get; set; }
/// <summary>
/// Gets or Sets PhotoUrl
/// </summary>
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
/// <summary>
/// Gets or Sets BannerUrl
/// </summary>
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
/// <summary>
/// Gets or Sets LastOnline
/// </summary>
[DataMember(Name = "last_online", EmitDefaultValue = true)]
public DateTime? LastOnline { get; set; }
/// <summary>
/// Gets or Sets Biography
/// </summary>
[DataMember(Name = "biography", EmitDefaultValue = true)]
public string Biography { get; set; }
/// <summary>
/// Gets or Sets ViewCount
/// </summary>
[DataMember(Name = "view_count", EmitDefaultValue = false)]
public int ViewCount { get; set; }
/// <summary>
/// Gets or Sets Created
/// </summary>
[DataMember(Name = "created", EmitDefaultValue = false)]
public DateTime Created { get; set; }
/// <summary>
/// Gets or Sets Updated
/// </summary>
[DataMember(Name = "updated", EmitDefaultValue = true)]
public DateTime? Updated { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class UserInfo {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
sb.Append(" Email: ").Append(Email).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Flags: ").Append(Flags).Append("\n");
sb.Append(" Permissions: ").Append(Permissions).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" Level: ").Append(Level).Append("\n");
sb.Append(" Experience: ").Append(Experience).Append("\n");
sb.Append(" PublicBirthday: ").Append(PublicBirthday).Append("\n");
sb.Append(" Birthday: ").Append(Birthday).Append("\n");
sb.Append(" Points: ").Append(Points).Append("\n");
sb.Append(" Location: ").Append(Location).Append("\n");
sb.Append(" Language: ").Append(Language).Append("\n");
sb.Append(" Timezone: ").Append(Timezone).Append("\n");
sb.Append(" Currency: ").Append(Currency).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
sb.Append(" Biography: ").Append(Biography).Append("\n");
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Updated: ").Append(Updated).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
namespace Tribufu.Generated.Model
{
/// <summary>
/// Defines UserType
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum UserType
{
/// <summary>
/// Enum User for value: user
/// </summary>
[EnumMember(Value = "user")]
User,
/// <summary>
/// Enum Bot for value: bot
/// </summary>
[EnumMember(Value = "bot")]
Bot
}
}

View File

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Tribufu.Generated</PackageId>
<Description>Tribufu .NET SDK</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>annotations</Nullable>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="dotenv.net" />
<PackageReference Include="JsonSubTypes" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Polly" />
<PackageReference Include="RestSharp" />
<PackageReference Include="System.ComponentModel.Annotations" />
</ItemGroup>
</Project>

View File

@ -1,21 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Tribufu.Native</PackageId>
<Description>Tribufu Native Interop</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\vendor\win-arm64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-arm64\native\" />
<None Include="..\..\vendor\win-x64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x64\native\" />
<None Include="..\..\vendor\win-x86\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x86\native\" />
</ItemGroup>
</Project>

View File

@ -1,13 +0,0 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System.Runtime.InteropServices;
namespace Tribufu.Native
{
public class TribufuNative
{
[DllImport("tribufu_sdk")]
public static extern void tribufu_sdk_shutdown();
}
}

View File

@ -1,24 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Tribufu</PackageId>
<Description>Tribufu .NET SDK</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>annotations</Nullable>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tribufu.Native\Tribufu.Native.csproj" />
<ProjectReference Include="..\Tribufu.Generated\Tribufu.Generated.csproj" />
</ItemGroup>
</Project>

View File

@ -1,14 +1,183 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System.Net.Http;
using System.Net;
using System.Runtime.InteropServices;
using Tribufu.Generated.Api;
using Tribufu.Generated.Client;
namespace Tribufu
{
public class TribufuApi : TribufuApiGenerated
/// <summary>
/// Tribufu API
/// </summary>
/// <remarks>
/// Use this class to interact with the Tribufu API.
/// </remarks>
public class TribufuApi : TribufuGeneratedApi
{
public TribufuApi(TribufuApiOptions options) : base(options.BaseUrl, new HttpClient())
/// <summary>
/// The default base URL for the Tribufu API.
/// </summary>
public const string DefaultBaseUrl = "https://api.tribufu.com";
/// <summary>
/// Create a <see cref="TribufuApi"/> with the default options.
/// </summary>
/// <returns><see cref="TribufuApi"/> instance with default configuration</returns>
public TribufuApi() : this(string.Empty)
{
}
/// <summary>
/// Create a <see cref="TribufuApi"/> with the given API key.
/// </summary>
/// <remarks>
/// A API key gives you public read only access to the Tribufu API.
/// </remarks>
/// <param name="apiKey">The API key for authentication</param>
/// <returns><see cref="TribufuApi"/> instance configured with the API key</returns>
public TribufuApi(string apiKey) : base(CreateConfiguration(apiKey))
{
}
/// <summary>
/// Create a TribufuApi with the default options.
/// </summary>
/// <returns>TribufuApi instance with default configuration</returns>
public static TribufuApi Default()
{
return new TribufuApi();
}
/// <summary>
/// Create a <see cref="TribufuApi"/> with the given API key.
/// </summary>
/// <remarks>
/// A API key gives you public read only access to the Tribufu API.
/// </remarks>
/// <param name="apiKey">The API key for authentication</param>
/// <returns><see cref="TribufuApi"/> instance configured with the API key</returns>
public static TribufuApi WithApiKey(string apiKey)
{
return new TribufuApi(apiKey);
}
/// <summary>
/// Try to create a <see cref="TribufuApi"/> from environment variables.
/// </summary>
/// <remarks>
/// This will only work if the environment variables are set.
/// </remarks>
/// <param name="prefix">A prefix for the environment variables. Default is "TRIBUFU".</param>
/// <returns><see cref="TribufuApi"/> instance or null if environment variables not set</returns>
/// <example>
/// // Environment variable TRIBUFU_API_KEY must be set
/// var api = TribufuApi.FromEnv();
/// </example>
public static TribufuApi? FromEnv(string? prefix = null)
{
prefix ??= "TRIBUFU";
var apiKey = Environment.GetEnvironmentVariable($"{prefix}_API_KEY");
if (!string.IsNullOrEmpty(apiKey))
{
return WithApiKey(apiKey);
}
return null;
}
/// <summary>
/// Create a <see cref="TribufuApi"/> from environment variables or the default API.
/// </summary>
/// <remarks>
/// This will fallback to the default API if the environment variables are not set.
/// </remarks>
/// <param name="prefix">A prefix for the environment variables. Default is "TRIBUFU".</param>
/// <returns><see cref="TribufuApi"/> instance</returns>
/// <example>
/// // Environment variable TRIBUFU_API_KEY might be unset
/// var api = TribufuApi.FromEnvOrDefault();
/// </example>
public static TribufuApi FromEnvOrDefault(string prefix = "TRIBUFU")
{
return FromEnv(prefix) ?? Default();
}
/// <summary>
/// Gets the version of the Tribufu API client.
/// </summary>
public static string GetVersion()
{
var version = typeof(TribufuApi).Assembly.GetName().Version;
return $"{version?.Major}.{version?.Minor}.{version?.Build}";
}
/// <summary>
/// Gets the user agent string for the Tribufu API client.
/// </summary>
private static string GetUserAgent()
{
var version = GetVersion();
var frameworkDescription = RuntimeInformation.FrameworkDescription.Trim();
var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier.Trim();
return $"Tribufu/{version} ({frameworkDescription}; {runtimeIdentifier})";
}
/// <summary>
/// Get the base URL for the Tribufu API.
/// </summary>
/// <remarks>
/// The base URL can be set using the environment variable TRIBUFU_API_URL.
/// The custom base URL is only used if debug mode is enabled.
/// The default base URL is https://api.tribufu.com.
/// </remarks>
/// <returns>Base URL string</returns>
private static string GetBaseUrl()
{
var baseUrl = Environment.GetEnvironmentVariable("TRIBUFU_API_URL");
if (DebugEnabled() && !string.IsNullOrEmpty(baseUrl))
{
return baseUrl;
}
return DefaultBaseUrl;
}
/// <summary>
/// Checks if debug mode is enabled.
/// </summary>
/// <returns>True if debug mode is enabled, otherwise false</returns>
private static bool DebugEnabled()
{
#if DEBUG
return true;
#else
return false;
#endif
}
/// <summary>
/// Creates a configuration for the Tribufu API client.
/// </summary>
private static Configuration CreateConfiguration(string apiKey)
{
var config = new Configuration
{
BasePath = GetBaseUrl(),
UserAgent = WebUtility.UrlEncode(GetUserAgent()),
};
if (!string.IsNullOrEmpty(apiKey))
{
config.AddApiKeyPrefix("Authorization", "ApiKey");
config.AddApiKey("Authorization", apiKey);
}
return config;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
namespace Tribufu
{
public class TribufuApiOptions
{
public string BaseUrl { get; set; }
public string ApiKey { get; set; }
public TribufuApiOptions(string baseUrl, string apiKey)
{
BaseUrl = baseUrl;
ApiKey = apiKey;
}
}
}

View File

@ -0,0 +1,33 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
namespace Tribufu
{
/// <summary>
/// Tribufu API
/// </summary>
/// <remarks>
/// Helper class to get a singleton instance of the <see cref="TribufuApi"/>.
/// </remarks>
public static class TribufuApiSingleton
{
private static TribufuApi? _instance = null;
/// <summary>
/// Get the singleton instance of <see cref="TribufuApi"/>.
/// </summary>
public static TribufuApi GetInstance()
{
_instance ??= TribufuApi.FromEnvOrDefault();
return _instance;
}
/// <summary>
/// Reset the singleton instance of <see cref="TribufuApi"/>.
/// </summary>
public static void ResetInstance()
{
_instance = null;
}
}
}

View File

@ -1,101 +0,0 @@
{
"runtime": "Default",
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
"json": "",
"url": "https://api.tribufu.com/v1/openapi.json",
"output": null,
"newLineBehavior": "Auto"
}
},
"codeGenerators": {
"openApiToCSharpClient": {
"clientBaseClass": null,
"configurationClass": null,
"generateClientClasses": true,
"suppressClientClassesOutput": false,
"generateClientInterfaces": false,
"suppressClientInterfacesOutput": false,
"clientBaseInterface": null,
"injectHttpClient": true,
"disposeHttpClient": true,
"protectedMethods": [],
"generateExceptionClasses": true,
"exceptionClass": "TribufuApiException",
"wrapDtoExceptions": true,
"useHttpClientCreationMethod": false,
"httpClientType": "System.Net.Http.HttpClient",
"useHttpRequestMessageCreationMethod": false,
"useBaseUrl": true,
"generateBaseUrlProperty": true,
"generateSyncMethods": false,
"generatePrepareRequestAndProcessResponseAsAsyncMethods": false,
"exposeJsonSerializerSettings": false,
"clientClassAccessModifier": "public",
"typeAccessModifier": "public",
"propertySetterAccessModifier": "",
"generateNativeRecords": false,
"generateContractsOutput": false,
"contractsNamespace": null,
"contractsOutputFilePath": null,
"parameterDateTimeFormat": "s",
"parameterDateFormat": "yyyy-MM-dd",
"generateUpdateJsonSerializerSettingsMethod": true,
"useRequestAndResponseSerializationSettings": false,
"serializeTypeInformation": false,
"queryNullValue": "",
"className": "TribufuApiGenerated",
"operationGenerationMode": "SingleClientFromOperationId",
"additionalNamespaceUsages": [],
"additionalContractNamespaceUsages": [],
"generateOptionalParameters": true,
"generateJsonMethods": false,
"enforceFlagEnums": false,
"parameterArrayType": "System.Collections.Generic.IEnumerable",
"parameterDictionaryType": "System.Collections.Generic.IDictionary",
"responseArrayType": "System.Collections.Generic.ICollection",
"responseDictionaryType": "System.Collections.Generic.IDictionary",
"wrapResponses": false,
"wrapResponseMethods": [],
"generateResponseClasses": true,
"responseClass": "SwaggerResponse",
"namespace": "Tribufu",
"requiredPropertiesMustBeDefined": true,
"dateType": "System.DateTimeOffset",
"jsonConverters": null,
"anyType": "object",
"dateTimeType": "System.DateTimeOffset",
"timeType": "System.TimeSpan",
"timeSpanType": "System.TimeSpan",
"arrayType": "System.Collections.Generic.ICollection",
"arrayInstanceType": "System.Collections.ObjectModel.Collection",
"dictionaryType": "System.Collections.Generic.IDictionary",
"dictionaryInstanceType": "System.Collections.Generic.Dictionary",
"arrayBaseType": "System.Collections.ObjectModel.Collection",
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"jsonLibrary": "NewtonsoftJson",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [],
"excludedParameterNames": [],
"handleReferences": false,
"generateImmutableArrayProperties": false,
"generateImmutableDictionaryProperties": false,
"jsonSerializerSettingsTransformationMethod": null,
"inlineNamedArrays": false,
"inlineNamedDictionaries": false,
"inlineNamedTuples": true,
"inlineNamedAny": false,
"generateDtoTypes": true,
"generateOptionalPropertiesAsNullable": false,
"generateNullableReferenceTypes": false,
"templateDirectory": null,
"serviceHost": null,
"serviceSchemes": null,
"output": "TribufuApi.generated.cs",
"newLineBehavior": "LF"
}
}
}

202
vendor/openapi-generator/LICENSE vendored Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
Copyright 2018 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.