diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7d6736d --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +TRIBUFU_API_KEY="" +TRIBUFU_API_URL="https://api.tribufu.com" diff --git a/.gitignore b/.gitignore index cd402ad..b585321 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ bin/ obj/ +.DS_Store +.env *.filters *.user -.DS_Store +desktop.ini diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..1dc3f29 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,9 @@ +docs/ + +.gitignore +*.sln +**.csproj +api/openapi.yaml +appveyor.yml +git_push.sh +README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..e13d875 --- /dev/null +++ b/.openapi-generator/FILES @@ -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 diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..5f84a81 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0 diff --git a/Directory.Build.props b/Directory.Build.props index 62f2166..32e4972 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,13 +1,13 @@ - 1.0.0.0 Tribufu Tribufu Copyright (c) Tribufu. All Rights Reserved. - 1.0.0.0 MIT git - https://github.com/Tribufu/TribufuNet - 1.0.0 + https://github.com/tribufu/sdk-dotnet + 1.1.0 + $(Version).0 + $(NoWarn);0618;1591;1998;2002;8767 diff --git a/Directory.Packages.props b/Directory.Packages.props index cd87747..e95a987 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,8 +3,11 @@ true + + + + - diff --git a/README.md b/README.md index 2d26ce1..e684056 100644 --- a/README.md +++ b/README.md @@ -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) + +## Frameworks supported -## License + +## 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 +``` + +## 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; +``` + +## 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. + + +## 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(httpClient => + new PetApi(httpClient)); +``` + + + +## 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); + } + + } + } +} +``` + + +## 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. + + + +## 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) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### ApiKey + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header -[MIT License]: https://github.com/tribufu/sdk-dotnet/blob/main/LICENSE.txt diff --git a/Tribufu.Sdk.sln b/Tribufu.Sdk.sln deleted file mode 100644 index 1f89370..0000000 --- a/Tribufu.Sdk.sln +++ /dev/null @@ -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 diff --git a/Tribufu.sln b/Tribufu.sln new file mode 100644 index 0000000..b3ff43a --- /dev/null +++ b/Tribufu.sln @@ -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 diff --git a/scripts/generate.ps1 b/scripts/generate.ps1 new file mode 100644 index 0000000..c2c8b9a --- /dev/null +++ b/scripts/generate.ps1 @@ -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 diff --git a/scripts/nswag.ps1 b/scripts/nswag.ps1 deleted file mode 100644 index 13d4968..0000000 --- a/scripts/nswag.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -nswag run ./src/Tribufu/api.nswag diff --git a/scripts/pack.sh b/scripts/package.sh similarity index 100% rename from scripts/pack.sh rename to scripts/package.sh diff --git a/src/Tribufu.Example/Program.cs b/src/Tribufu.Example/Program.cs new file mode 100644 index 0000000..5462790 --- /dev/null +++ b/src/Tribufu.Example/Program.cs @@ -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); + } + } + } +} diff --git a/src/Tribufu.Example/Tribufu.Example.csproj b/src/Tribufu.Example/Tribufu.Example.csproj new file mode 100644 index 0000000..25a4537 --- /dev/null +++ b/src/Tribufu.Example/Tribufu.Example.csproj @@ -0,0 +1,11 @@ + + + enable + enable + Exe + net8.0 + + + + + diff --git a/src/Tribufu.Generated/Api/TribufuGeneratedApi.cs b/src/Tribufu.Generated/Api/TribufuGeneratedApi.cs new file mode 100644 index 0000000..4575450 --- /dev/null +++ b/src/Tribufu.Generated/Api/TribufuGeneratedApi.cs @@ -0,0 +1,15035 @@ +/* + * 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.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Tribufu.Generated.Client; +using Tribufu.Generated.Model; + +namespace Tribufu.Generated.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITribufuGeneratedApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Authorize the client to access the user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void Authorize(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0); + + /// + /// Authorize the client to access the user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0); + /// + /// Change the email of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void ChangeEmail(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Change the email of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse ChangeEmailWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Change the password of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void ChangePassword(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Change the password of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse ChangePasswordWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Claim a game server. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void ClaimGameServer(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Claim a game server. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse ClaimGameServerWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Convert a string to base64 or vice versa. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// CryptoViewModel + CryptoViewModel ConvertBase64(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0); + + /// + /// Convert a string to base64 or vice versa. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CryptoViewModel + ApiResponse ConvertBase64WithHttpInfo(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0); + /// + /// Create a new game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void CreateGameServer(Object? body = default(Object?), int operationIndex = 0); + + /// + /// Create a new game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateGameServerWithHttpInfo(Object? body = default(Object?), int operationIndex = 0); + /// + /// Create a new game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void CreateGameServerCluster(Object? body = default(Object?), int operationIndex = 0); + + /// + /// Create a new game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateGameServerClusterWithHttpInfo(Object? body = default(Object?), int operationIndex = 0); + /// + /// Create a new group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void CreateGroup(Object? body = default(Object?), int operationIndex = 0); + + /// + /// Create a new group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateGroupWithHttpInfo(Object? body = default(Object?), int operationIndex = 0); + /// + /// Create a new token with grant type. + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// TokenResponse + TokenResponse CreateToken(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0); + + /// + /// Create a new token with grant type. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of TokenResponse + ApiResponse CreateTokenWithHttpInfo(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0); + /// + /// Delete a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + void DeleteGameServer(string id, int operationIndex = 0); + + /// + /// Delete a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteGameServerWithHttpInfo(string id, int operationIndex = 0); + /// + /// Delete a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + void DeleteGameServerCluster(string id, int operationIndex = 0); + + /// + /// Delete a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteGameServerClusterWithHttpInfo(string id, int operationIndex = 0); + /// + /// Delete a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + void DeleteGroup(string id, int operationIndex = 0); + + /// + /// Delete a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteGroupWithHttpInfo(string id, int operationIndex = 0); + /// + /// Generate one or more flake ids. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<string> + List GenerateFlakeId(int? amount = default(int?), int operationIndex = 0); + + /// + /// Generate one or more flake ids. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> GenerateFlakeIdWithHttpInfo(int? amount = default(int?), int operationIndex = 0); + /// + /// Generate one or more flake ids from a timestamp. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// List<string> + List GenerateFlakeIdFromTimestamp(string timestamp, int? amount = default(int?), int operationIndex = 0); + + /// + /// Generate one or more flake ids from a timestamp. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> GenerateFlakeIdFromTimestampWithHttpInfo(string timestamp, int? amount = default(int?), int operationIndex = 0); + /// + /// Generate a random password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// HashViewModel + HashViewModel GeneratePassword(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0); + + /// + /// Generate a random password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + ApiResponse GeneratePasswordWithHttpInfo(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0); + /// + /// Generate one or more uuids with a specific version. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Guid> + List GenerateUuid(int? version = default(int?), int? amount = default(int?), int operationIndex = 0); + + /// + /// Generate one or more uuids with a specific version. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> GenerateUuidWithHttpInfo(int? version = default(int?), int? amount = default(int?), int operationIndex = 0); + /// + /// Get current client information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + void GetClientInfo(int operationIndex = 0); + + /// + /// Get current client information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse GetClientInfoWithHttpInfo(int operationIndex = 0); + /// + /// Get current ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<IpAddress> + List GetCurrentIpAddress(int operationIndex = 0); + + /// + /// Get current ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<IpAddress> + ApiResponse> GetCurrentIpAddressWithHttpInfo(int operationIndex = 0); + /// + /// Get a game by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Game + Game GetGameById(string id, int operationIndex = 0); + + /// + /// Get a game by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Game + ApiResponse GetGameByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of game server clusters of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServerCluster> + List GetGameClustersByGameId(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game server clusters of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServerCluster> + ApiResponse> GetGameClustersByGameIdWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of game items. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Object> + List GetGameItems(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game items. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Object> + ApiResponse> GetGameItemsWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a game server by address and query port. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// GameServer + GameServer GetGameServerByAddressAndQueryPort(string address, int port, int operationIndex = 0); + + /// + /// Get a game server by address and query port. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of GameServer + ApiResponse GetGameServerByAddressAndQueryPortWithHttpInfo(string address, int port, int operationIndex = 0); + /// + /// Get a game server by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GameServer + GameServer GetGameServerById(string id, int operationIndex = 0); + + /// + /// Get a game server by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GameServer + ApiResponse GetGameServerByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a game server cluster by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GameServerCluster + GameServerCluster GetGameServerClusterById(string id, int operationIndex = 0); + + /// + /// Get a game server cluster by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GameServerCluster + ApiResponse GetGameServerClusterByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of game server clusters. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServerCluster> + List GetGameServerClusters(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game server clusters. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServerCluster> + ApiResponse> GetGameServerClustersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + List GetGameServers(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + ApiResponse> GetGameServersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of game servers from a country. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + List GetGameServersByCountry(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game servers from a country. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + ApiResponse> GetGameServersByCountryWithHttpInfo(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of game servers of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + List GetGameServersByGameId(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of game servers of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + ApiResponse> GetGameServersByGameIdWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of countries with the number of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Dictionary<string, int> + Dictionary GetGameServersCountries(int operationIndex = 0); + + /// + /// Get a list of countries with the number of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetGameServersCountriesWithHttpInfo(int operationIndex = 0); + /// + /// Get metrics about the tracked game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ServerMetrics + ServerMetrics GetGameServersMetrics(int operationIndex = 0); + + /// + /// Get metrics about the tracked game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ServerMetrics + ApiResponse GetGameServersMetricsWithHttpInfo(int operationIndex = 0); + /// + /// Get a list of games. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Game> + List GetGames(int operationIndex = 0); + + /// + /// Get a list of games. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Game> + ApiResponse> GetGamesWithHttpInfo(int operationIndex = 0); + /// + /// Get a group by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + Group GetGroupById(string id, int operationIndex = 0); + + /// + /// Get a group by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + ApiResponse GetGroupByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a group by tag. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + Group GetGroupByTag(string tag, int operationIndex = 0); + + /// + /// Get a group by tag. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + ApiResponse GetGroupByTagWithHttpInfo(string tag, int operationIndex = 0); + /// + /// Get a group by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + Group GetGroupByUuid(Guid uuid, int operationIndex = 0); + + /// + /// Get a group by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + ApiResponse GetGroupByUuidWithHttpInfo(Guid uuid, int operationIndex = 0); + /// + /// Get a list of games of a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<GroupGame> + List GetGroupGames(string id, int operationIndex = 0); + + /// + /// Get a list of games of a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<GroupGame> + ApiResponse> GetGroupGamesWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of members in a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<GroupMember> + List GetGroupMembers(string id, int operationIndex = 0); + + /// + /// Get a list of members in a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<GroupMember> + ApiResponse> GetGroupMembersWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of groups. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Group> + List GetGroups(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of groups. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Group> + ApiResponse> GetGroupsWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// IpAddress + IpAddress GetIpAddress(string address, int operationIndex = 0); + + /// + /// Get a ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of IpAddress + ApiResponse GetIpAddressWithHttpInfo(string address, int operationIndex = 0); + /// + /// Get a list of ip addresses. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<IpAddress> + List GetIpAddresses(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of ip addresses. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<IpAddress> + ApiResponse> GetIpAddressesWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get the top 20 leaderboard users. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<LeaderboardItem> + List GetLeaderboard(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0); + + /// + /// Get the top 20 leaderboard users. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<LeaderboardItem> + ApiResponse> GetLeaderboardWithHttpInfo(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0); + /// + /// Get current user information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// UserInfo + [Obsolete] + UserInfo GetMe(int operationIndex = 0); + + /// + /// Get current user information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of UserInfo + [Obsolete] + ApiResponse GetMeWithHttpInfo(int operationIndex = 0); + /// + /// Get a package by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Package + Package GetPackageById(string id, int operationIndex = 0); + + /// + /// Get a package by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Package + ApiResponse GetPackageByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of packages. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Package> + List GetPackages(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of packages. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Package> + ApiResponse> GetPackagesWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get the public keys for the client. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + void GetPublicKeys(int operationIndex = 0); + + /// + /// Get the public keys for the client. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse GetPublicKeysWithHttpInfo(int operationIndex = 0); + /// + /// Get a subscription by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Subscription + Subscription GetSubscriptionById(string id, int operationIndex = 0); + + /// + /// Get a subscription by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Subscription + ApiResponse GetSubscriptionByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of subscriptions. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Subscription> + List GetSubscriptions(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of subscriptions. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Subscription> + ApiResponse> GetSubscriptionsWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of connected accounts of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Account> + List GetUserAccounts(string id, int operationIndex = 0); + + /// + /// Get a list of connected accounts of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Account> + ApiResponse> GetUserAccountsWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a user profile by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + Profile GetUserById(string id, int operationIndex = 0); + + /// + /// Get a user profile by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + ApiResponse GetUserByIdWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a user profile by name. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + Profile GetUserByName(string name, int operationIndex = 0); + + /// + /// Get a user profile by name. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + ApiResponse GetUserByNameWithHttpInfo(string name, int operationIndex = 0); + /// + /// Get a user profile by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + Profile GetUserByUuid(Guid uuid, int operationIndex = 0); + + /// + /// Get a user profile by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + ApiResponse GetUserByUuidWithHttpInfo(Guid uuid, int operationIndex = 0); + /// + /// Get a list of friends of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Object> + List GetUserFriends(string id, int operationIndex = 0); + + /// + /// Get a list of friends of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Object> + ApiResponse> GetUserFriendsWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of games the user has played. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<ProfileGame> + List GetUserGames(string id, int operationIndex = 0); + + /// + /// Get a list of games the user has played. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<ProfileGame> + ApiResponse> GetUserGamesWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of groups the user is a member of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<ProfileGroup> + List GetUserGroups(string id, int operationIndex = 0); + + /// + /// Get a list of groups the user is a member of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<ProfileGroup> + ApiResponse> GetUserGroupsWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get current user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// UserInfo + UserInfo GetUserInfo(int operationIndex = 0); + + /// + /// Get current user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of UserInfo + ApiResponse GetUserInfoWithHttpInfo(int operationIndex = 0); + /// + /// Get a list of punishments the user has received. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Object> + List GetUserPunishments(string id, int operationIndex = 0); + + /// + /// Get a list of punishments the user has received. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Object> + ApiResponse> GetUserPunishmentsWithHttpInfo(string id, int operationIndex = 0); + /// + /// Get a list of servers the user is owner of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + List GetUserServers(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of servers the user is owner of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + ApiResponse> GetUserServersWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Get a list of user profiles. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Profile> + List GetUsers(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + + /// + /// Get a list of user profiles. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Profile> + ApiResponse> GetUsersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0); + /// + /// Hash a string using argon2. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + HashViewModel HashArgon2(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + + /// + /// Hash a string using argon2. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + ApiResponse HashArgon2WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + /// + /// Hash a string using bcrypt. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + HashViewModel HashBcrypt(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + + /// + /// Hash a string using bcrypt. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + ApiResponse HashBcryptWithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + /// + /// Hash a string using md5. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + HashViewModel HashMd5(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + + /// + /// Hash a string using md5. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + ApiResponse HashMd5WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + /// + /// Hash a string using sha256. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + HashViewModel HashSha256(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + + /// + /// Hash a string using sha256. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + ApiResponse HashSha256WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0); + /// + /// Introspect a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void IntrospectToken(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0); + + /// + /// Introspect a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse IntrospectTokenWithHttpInfo(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0); + /// + /// Login with name or email and password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + [Obsolete] + LoginResponse Login(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0); + + /// + /// Login with name or email and password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + [Obsolete] + ApiResponse LoginWithHttpInfo(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0); + /// + /// Invalidate credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + [Obsolete] + void Logout(int operationIndex = 0); + + /// + /// Invalidate credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + [Obsolete] + ApiResponse LogoutWithHttpInfo(int operationIndex = 0); + /// + /// Refresh credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + [Obsolete] + LoginResponse Refresh(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0); + + /// + /// Refresh credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + [Obsolete] + ApiResponse RefreshWithHttpInfo(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0); + /// + /// Create a new user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + LoginResponse Register(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0); + + /// + /// Create a new user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + ApiResponse RegisterWithHttpInfo(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0); + /// + /// Revoke a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + void RevokeToken(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0); + + /// + /// Revoke a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse RevokeTokenWithHttpInfo(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0); + /// + /// Advanced search for servers or players. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<Object> + List Search(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0); + + /// + /// Advanced search for servers or players. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Object> + ApiResponse> SearchWithHttpInfo(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0); + /// + /// Update a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void UpdateGameServer(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Update a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateGameServerWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Update a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void UpdateGameServerCluster(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Update a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateGameServerClusterWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Update a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + void UpdateGroup(string id, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Update a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateGroupWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0); + /// + /// Update a user profile. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Profile + Profile UpdateUserProfile(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0); + + /// + /// Update a user profile. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Profile + ApiResponse UpdateUserProfileWithHttpInfo(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITribufuGeneratedApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Authorize the client to access the user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task AuthorizeAsync(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Authorize the client to access the user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> AuthorizeWithHttpInfoAsync(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Change the email of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task ChangeEmailAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Change the email of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> ChangeEmailWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Change the password of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task ChangePasswordAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Change the password of a user. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> ChangePasswordWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Claim a game server. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task ClaimGameServerAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Claim a game server. + /// + /// + /// This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> ClaimGameServerWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Convert a string to base64 or vice versa. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CryptoViewModel + System.Threading.Tasks.Task ConvertBase64Async(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Convert a string to base64 or vice versa. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CryptoViewModel) + System.Threading.Tasks.Task> ConvertBase64WithHttpInfoAsync(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Create a new game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateGameServerAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create a new game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateGameServerWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Create a new game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateGameServerClusterAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create a new game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateGameServerClusterWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Create a new group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateGroupAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create a new group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateGroupWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Create a new token with grant type. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TokenResponse + System.Threading.Tasks.Task CreateTokenAsync(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create a new token with grant type. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TokenResponse) + System.Threading.Tasks.Task> CreateTokenWithHttpInfoAsync(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Delete a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteGameServerAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteGameServerWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Delete a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteGameServerClusterAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteGameServerClusterWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Delete a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteGroupAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteGroupWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Generate one or more flake ids. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> GenerateFlakeIdAsync(int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Generate one or more flake ids. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> GenerateFlakeIdWithHttpInfoAsync(int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Generate one or more flake ids from a timestamp. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> GenerateFlakeIdFromTimestampAsync(string timestamp, int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Generate one or more flake ids from a timestamp. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> GenerateFlakeIdFromTimestampWithHttpInfoAsync(string timestamp, int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Generate a random password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + System.Threading.Tasks.Task GeneratePasswordAsync(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Generate a random password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + System.Threading.Tasks.Task> GeneratePasswordWithHttpInfoAsync(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Generate one or more uuids with a specific version. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> GenerateUuidAsync(int? version = default(int?), int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Generate one or more uuids with a specific version. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> GenerateUuidWithHttpInfoAsync(int? version = default(int?), int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get current client information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task GetClientInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get current client information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> GetClientInfoWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get current ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<IpAddress> + System.Threading.Tasks.Task> GetCurrentIpAddressAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get current ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<IpAddress>) + System.Threading.Tasks.Task>> GetCurrentIpAddressWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a game by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Game + System.Threading.Tasks.Task GetGameByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a game by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Game) + System.Threading.Tasks.Task> GetGameByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game server clusters of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServerCluster> + System.Threading.Tasks.Task> GetGameClustersByGameIdAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game server clusters of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServerCluster>) + System.Threading.Tasks.Task>> GetGameClustersByGameIdWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game items. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> GetGameItemsAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game items. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> GetGameItemsWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a game server by address and query port. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServer + System.Threading.Tasks.Task GetGameServerByAddressAndQueryPortAsync(string address, int port, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a game server by address and query port. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServer) + System.Threading.Tasks.Task> GetGameServerByAddressAndQueryPortWithHttpInfoAsync(string address, int port, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a game server by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServer + System.Threading.Tasks.Task GetGameServerByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a game server by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServer) + System.Threading.Tasks.Task> GetGameServerByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a game server cluster by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServerCluster + System.Threading.Tasks.Task GetGameServerClusterByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a game server cluster by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServerCluster) + System.Threading.Tasks.Task> GetGameServerClusterByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game server clusters. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServerCluster> + System.Threading.Tasks.Task> GetGameServerClustersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game server clusters. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServerCluster>) + System.Threading.Tasks.Task>> GetGameServerClustersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + System.Threading.Tasks.Task> GetGameServersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + System.Threading.Tasks.Task>> GetGameServersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game servers from a country. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + System.Threading.Tasks.Task> GetGameServersByCountryAsync(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game servers from a country. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + System.Threading.Tasks.Task>> GetGameServersByCountryWithHttpInfoAsync(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of game servers of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + System.Threading.Tasks.Task> GetGameServersByGameIdAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of game servers of a game. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + System.Threading.Tasks.Task>> GetGameServersByGameIdWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of countries with the number of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetGameServersCountriesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of countries with the number of game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetGameServersCountriesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get metrics about the tracked game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ServerMetrics + System.Threading.Tasks.Task GetGameServersMetricsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get metrics about the tracked game servers. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ServerMetrics) + System.Threading.Tasks.Task> GetGameServersMetricsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of games. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Game> + System.Threading.Tasks.Task> GetGamesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of games. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Game>) + System.Threading.Tasks.Task>> GetGamesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a group by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + System.Threading.Tasks.Task GetGroupByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a group by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + System.Threading.Tasks.Task> GetGroupByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a group by tag. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + System.Threading.Tasks.Task GetGroupByTagAsync(string tag, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a group by tag. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + System.Threading.Tasks.Task> GetGroupByTagWithHttpInfoAsync(string tag, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a group by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + System.Threading.Tasks.Task GetGroupByUuidAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a group by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + System.Threading.Tasks.Task> GetGroupByUuidWithHttpInfoAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of games of a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GroupGame> + System.Threading.Tasks.Task> GetGroupGamesAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of games of a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GroupGame>) + System.Threading.Tasks.Task>> GetGroupGamesWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of members in a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GroupMember> + System.Threading.Tasks.Task> GetGroupMembersAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of members in a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GroupMember>) + System.Threading.Tasks.Task>> GetGroupMembersWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of groups. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Group> + System.Threading.Tasks.Task> GetGroupsAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of groups. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Group>) + System.Threading.Tasks.Task>> GetGroupsWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of IpAddress + System.Threading.Tasks.Task GetIpAddressAsync(string address, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a ip address location. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (IpAddress) + System.Threading.Tasks.Task> GetIpAddressWithHttpInfoAsync(string address, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of ip addresses. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<IpAddress> + System.Threading.Tasks.Task> GetIpAddressesAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of ip addresses. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<IpAddress>) + System.Threading.Tasks.Task>> GetIpAddressesWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get the top 20 leaderboard users. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<LeaderboardItem> + System.Threading.Tasks.Task> GetLeaderboardAsync(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get the top 20 leaderboard users. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<LeaderboardItem>) + System.Threading.Tasks.Task>> GetLeaderboardWithHttpInfoAsync(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get current user information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UserInfo + [Obsolete] + System.Threading.Tasks.Task GetMeAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get current user information. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UserInfo) + [Obsolete] + System.Threading.Tasks.Task> GetMeWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a package by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Package + System.Threading.Tasks.Task GetPackageByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a package by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Package) + System.Threading.Tasks.Task> GetPackageByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of packages. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Package> + System.Threading.Tasks.Task> GetPackagesAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of packages. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Package>) + System.Threading.Tasks.Task>> GetPackagesWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get the public keys for the client. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task GetPublicKeysAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get the public keys for the client. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> GetPublicKeysWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a subscription by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Subscription + System.Threading.Tasks.Task GetSubscriptionByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a subscription by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Subscription) + System.Threading.Tasks.Task> GetSubscriptionByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of subscriptions. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Subscription> + System.Threading.Tasks.Task> GetSubscriptionsAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of subscriptions. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Subscription>) + System.Threading.Tasks.Task>> GetSubscriptionsWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of connected accounts of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Account> + System.Threading.Tasks.Task> GetUserAccountsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of connected accounts of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Account>) + System.Threading.Tasks.Task>> GetUserAccountsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a user profile by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + System.Threading.Tasks.Task GetUserByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a user profile by id. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + System.Threading.Tasks.Task> GetUserByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a user profile by name. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + System.Threading.Tasks.Task GetUserByNameAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a user profile by name. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a user profile by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + System.Threading.Tasks.Task GetUserByUuidAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a user profile by uuid. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + System.Threading.Tasks.Task> GetUserByUuidWithHttpInfoAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of friends of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> GetUserFriendsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of friends of the user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> GetUserFriendsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of games the user has played. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<ProfileGame> + System.Threading.Tasks.Task> GetUserGamesAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of games the user has played. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileGame>) + System.Threading.Tasks.Task>> GetUserGamesWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of groups the user is a member of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<ProfileGroup> + System.Threading.Tasks.Task> GetUserGroupsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of groups the user is a member of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileGroup>) + System.Threading.Tasks.Task>> GetUserGroupsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get current user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UserInfo + System.Threading.Tasks.Task GetUserInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get current user information. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UserInfo) + System.Threading.Tasks.Task> GetUserInfoWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of punishments the user has received. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> GetUserPunishmentsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of punishments the user has received. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> GetUserPunishmentsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of servers the user is owner of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + System.Threading.Tasks.Task> GetUserServersAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of servers the user is owner of. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + System.Threading.Tasks.Task>> GetUserServersWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get a list of user profiles. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Profile> + System.Threading.Tasks.Task> GetUsersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get a list of user profiles. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Profile>) + System.Threading.Tasks.Task>> GetUsersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Hash a string using argon2. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + System.Threading.Tasks.Task HashArgon2Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Hash a string using argon2. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + System.Threading.Tasks.Task> HashArgon2WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Hash a string using bcrypt. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + System.Threading.Tasks.Task HashBcryptAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Hash a string using bcrypt. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + System.Threading.Tasks.Task> HashBcryptWithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Hash a string using md5. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + System.Threading.Tasks.Task HashMd5Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Hash a string using md5. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + System.Threading.Tasks.Task> HashMd5WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Hash a string using sha256. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + System.Threading.Tasks.Task HashSha256Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Hash a string using sha256. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + System.Threading.Tasks.Task> HashSha256WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Introspect a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task IntrospectTokenAsync(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Introspect a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> IntrospectTokenWithHttpInfoAsync(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Login with name or email and password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + [Obsolete] + System.Threading.Tasks.Task LoginAsync(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Login with name or email and password. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + [Obsolete] + System.Threading.Tasks.Task> LoginWithHttpInfoAsync(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Invalidate credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + [Obsolete] + System.Threading.Tasks.Task LogoutAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Invalidate credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + [Obsolete] + System.Threading.Tasks.Task> LogoutWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Refresh credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + [Obsolete] + System.Threading.Tasks.Task RefreshAsync(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Refresh credentials. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + [Obsolete] + System.Threading.Tasks.Task> RefreshWithHttpInfoAsync(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Create a new user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + System.Threading.Tasks.Task RegisterAsync(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create a new user. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + System.Threading.Tasks.Task> RegisterWithHttpInfoAsync(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Revoke a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task RevokeTokenAsync(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Revoke a token. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> RevokeTokenWithHttpInfoAsync(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Advanced search for servers or players. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> SearchAsync(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Advanced search for servers or players. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> SearchWithHttpInfoAsync(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Update a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateGameServerAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Update a game server. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateGameServerWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Update a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateGameServerClusterAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Update a game server cluster. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateGameServerClusterWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Update a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateGroupAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Update a group. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateGroupWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Update a user profile. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + System.Threading.Tasks.Task UpdateUserProfileAsync(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Update a user profile. + /// + /// + /// <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + System.Threading.Tasks.Task> UpdateUserProfileWithHttpInfoAsync(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITribufuGeneratedApi : ITribufuGeneratedApiSync, ITribufuGeneratedApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class TribufuGeneratedApi : ITribufuGeneratedApi + { + private Tribufu.Generated.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public TribufuGeneratedApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public TribufuGeneratedApi(string basePath) + { + this.Configuration = Tribufu.Generated.Client.Configuration.MergeConfigurations( + Tribufu.Generated.Client.GlobalConfiguration.Instance, + new Tribufu.Generated.Client.Configuration { BasePath = basePath } + ); + this.Client = new Tribufu.Generated.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Tribufu.Generated.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Tribufu.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public TribufuGeneratedApi(Tribufu.Generated.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Tribufu.Generated.Client.Configuration.MergeConfigurations( + Tribufu.Generated.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Tribufu.Generated.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Tribufu.Generated.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Tribufu.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public TribufuGeneratedApi(Tribufu.Generated.Client.ISynchronousClient client, Tribufu.Generated.Client.IAsynchronousClient asyncClient, Tribufu.Generated.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Tribufu.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Tribufu.Generated.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Tribufu.Generated.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Tribufu.Generated.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Tribufu.Generated.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Authorize the client to access the user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void Authorize(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0) + { + AuthorizeWithHttpInfo(authorizeRequest); + } + + /// + /// Authorize the client to access the user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = authorizeRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Authorize"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/oauth2/authorize", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Authorize", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Authorize the client to access the user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task AuthorizeAsync(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await AuthorizeWithHttpInfoAsync(authorizeRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Authorize the client to access the user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.authorize</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AuthorizeWithHttpInfoAsync(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = authorizeRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Authorize"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/oauth2/authorize", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Authorize", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Change the email of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void ChangeEmail(string id, Object? body = default(Object?), int operationIndex = 0) + { + ChangeEmailWithHttpInfo(id, body); + } + + /// + /// Change the email of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse ChangeEmailWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ChangeEmail"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ChangeEmail"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/users/{id}/email", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ChangeEmail", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Change the email of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task ChangeEmailAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await ChangeEmailWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Change the email of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.email.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> ChangeEmailWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ChangeEmail"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ChangeEmail"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/users/{id}/email", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ChangeEmail", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Change the password of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void ChangePassword(string id, Object? body = default(Object?), int operationIndex = 0) + { + ChangePasswordWithHttpInfo(id, body); + } + + /// + /// Change the password of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse ChangePasswordWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ChangePassword"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ChangePassword"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/users/{id}/password", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ChangePassword", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Change the password of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task ChangePasswordAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await ChangePasswordWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Change the password of a user. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.identity.user.password.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> ChangePasswordWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ChangePassword"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ChangePassword"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/users/{id}/password", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ChangePassword", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Claim a game server. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void ClaimGameServer(string id, Object? body = default(Object?), int operationIndex = 0) + { + ClaimGameServerWithHttpInfo(id, body); + } + + /// + /// Claim a game server. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse ClaimGameServerWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ClaimGameServer"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ClaimGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/servers/{id}/claim", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ClaimGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Claim a game server. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task ClaimGameServerAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await ClaimGameServerWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Claim a game server. This endpoint is not available with an api key, only with a bearer token.<br/><br/><b>🔒 Required permissions:</b> <code>tribufu.community.game.server.claim</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> ClaimGameServerWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->ClaimGameServer"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ClaimGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/servers/{id}/claim", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ClaimGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Convert a string to base64 or vice versa. <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// CryptoViewModel + public CryptoViewModel ConvertBase64(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = ConvertBase64WithHttpInfo(cryptoViewModel); + return localVarResponse.Data; + } + + /// + /// Convert a string to base64 or vice versa. <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CryptoViewModel + public Tribufu.Generated.Client.ApiResponse ConvertBase64WithHttpInfo(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = cryptoViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ConvertBase64"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/utils/base64", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ConvertBase64", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Convert a string to base64 or vice versa. <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CryptoViewModel + public async System.Threading.Tasks.Task ConvertBase64Async(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await ConvertBase64WithHttpInfoAsync(cryptoViewModel, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Convert a string to base64 or vice versa. <b>🔒 Required permissions:</b> <code>tribufu.utils.convert.base64</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CryptoViewModel) + public async System.Threading.Tasks.Task> ConvertBase64WithHttpInfoAsync(CryptoViewModel? cryptoViewModel = default(CryptoViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = cryptoViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.ConvertBase64"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/utils/base64", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ConvertBase64", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void CreateGameServer(Object? body = default(Object?), int operationIndex = 0) + { + CreateGameServerWithHttpInfo(body); + } + + /// + /// Create a new game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse CreateGameServerWithHttpInfo(Object? body = default(Object?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/servers", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateGameServerAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await CreateGameServerWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a new game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateGameServerWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/servers", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void CreateGameServerCluster(Object? body = default(Object?), int operationIndex = 0) + { + CreateGameServerClusterWithHttpInfo(body); + } + + /// + /// Create a new game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse CreateGameServerClusterWithHttpInfo(Object? body = default(Object?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/clusters", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateGameServerClusterAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await CreateGameServerClusterWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a new game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateGameServerClusterWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/clusters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void CreateGroup(Object? body = default(Object?), int operationIndex = 0) + { + CreateGroupWithHttpInfo(body); + } + + /// + /// Create a new group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse CreateGroupWithHttpInfo(Object? body = default(Object?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/groups", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateGroupAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await CreateGroupWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a new group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateGroupWithHttpInfoAsync(Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/groups", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new token with grant type. + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// TokenResponse + public TokenResponse CreateToken(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = CreateTokenWithHttpInfo(tokenRequest); + return localVarResponse.Data; + } + + /// + /// Create a new token with grant type. + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of TokenResponse + public Tribufu.Generated.Client.ApiResponse CreateTokenWithHttpInfo(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = tokenRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/oauth2/token", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new token with grant type. + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TokenResponse + public async System.Threading.Tasks.Task CreateTokenAsync(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await CreateTokenWithHttpInfoAsync(tokenRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a new token with grant type. + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TokenResponse) + public async System.Threading.Tasks.Task> CreateTokenWithHttpInfoAsync(TokenRequest? tokenRequest = default(TokenRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = tokenRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.CreateToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/oauth2/token", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + public void DeleteGameServer(string id, int operationIndex = 0) + { + DeleteGameServerWithHttpInfo(id); + } + + /// + /// Delete a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse DeleteGameServerWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGameServer"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/v1/servers/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteGameServerAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await DeleteGameServerWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteGameServerWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGameServer"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/v1/servers/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + public void DeleteGameServerCluster(string id, int operationIndex = 0) + { + DeleteGameServerClusterWithHttpInfo(id); + } + + /// + /// Delete a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse DeleteGameServerClusterWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGameServerCluster"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/v1/clusters/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteGameServerClusterAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await DeleteGameServerClusterWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteGameServerClusterWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGameServerCluster"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/v1/clusters/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + public void DeleteGroup(string id, int operationIndex = 0) + { + DeleteGroupWithHttpInfo(id); + } + + /// + /// Delete a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse DeleteGroupWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGroup"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/v1/groups/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteGroupAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await DeleteGroupWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.delete</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteGroupWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->DeleteGroup"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.DeleteGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/v1/groups/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more flake ids. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<string> + public List GenerateFlakeId(int? amount = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GenerateFlakeIdWithHttpInfo(amount); + return localVarResponse.Data; + } + + /// + /// Generate one or more flake ids. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + public Tribufu.Generated.Client.ApiResponse> GenerateFlakeIdWithHttpInfo(int? amount = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateFlakeId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/utils/flake", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateFlakeId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more flake ids. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> GenerateFlakeIdAsync(int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GenerateFlakeIdWithHttpInfoAsync(amount, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Generate one or more flake ids. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> GenerateFlakeIdWithHttpInfoAsync(int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateFlakeId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/utils/flake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateFlakeId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more flake ids from a timestamp. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// List<string> + public List GenerateFlakeIdFromTimestamp(string timestamp, int? amount = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GenerateFlakeIdFromTimestampWithHttpInfo(timestamp, amount); + return localVarResponse.Data; + } + + /// + /// Generate one or more flake ids from a timestamp. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + public Tribufu.Generated.Client.ApiResponse> GenerateFlakeIdFromTimestampWithHttpInfo(string timestamp, int? amount = default(int?), int operationIndex = 0) + { + // verify the required parameter 'timestamp' is set + if (timestamp == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'timestamp' when calling TribufuGeneratedApi->GenerateFlakeIdFromTimestamp"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("timestamp", Tribufu.Generated.Client.ClientUtils.ParameterToString(timestamp)); // path parameter + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateFlakeIdFromTimestamp"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/utils/flake/{timestamp}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateFlakeIdFromTimestamp", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more flake ids from a timestamp. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> GenerateFlakeIdFromTimestampAsync(string timestamp, int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GenerateFlakeIdFromTimestampWithHttpInfoAsync(timestamp, amount, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Generate one or more flake ids from a timestamp. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.flake.timestamp</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> GenerateFlakeIdFromTimestampWithHttpInfoAsync(string timestamp, int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'timestamp' is set + if (timestamp == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'timestamp' when calling TribufuGeneratedApi->GenerateFlakeIdFromTimestamp"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("timestamp", Tribufu.Generated.Client.ClientUtils.ParameterToString(timestamp)); // path parameter + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateFlakeIdFromTimestamp"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/utils/flake/{timestamp}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateFlakeIdFromTimestamp", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate a random password. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// HashViewModel + public HashViewModel GeneratePassword(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GeneratePasswordWithHttpInfo(length, symbols); + return localVarResponse.Data; + } + + /// + /// Generate a random password. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + public Tribufu.Generated.Client.ApiResponse GeneratePasswordWithHttpInfo(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (length != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "length", length)); + } + if (symbols != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "symbols", symbols)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GeneratePassword"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/utils/password", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GeneratePassword", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate a random password. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + public async System.Threading.Tasks.Task GeneratePasswordAsync(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GeneratePasswordWithHttpInfoAsync(length, symbols, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Generate a random password. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.password</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + public async System.Threading.Tasks.Task> GeneratePasswordWithHttpInfoAsync(int? length = default(int?), bool? symbols = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (length != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "length", length)); + } + if (symbols != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "symbols", symbols)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GeneratePassword"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/utils/password", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GeneratePassword", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more uuids with a specific version. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Guid> + public List GenerateUuid(int? version = default(int?), int? amount = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GenerateUuidWithHttpInfo(version, amount); + return localVarResponse.Data; + } + + /// + /// Generate one or more uuids with a specific version. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Tribufu.Generated.Client.ApiResponse> GenerateUuidWithHttpInfo(int? version = default(int?), int? amount = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (version != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + } + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/utils/uuid", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Generate one or more uuids with a specific version. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> GenerateUuidAsync(int? version = default(int?), int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GenerateUuidWithHttpInfoAsync(version, amount, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Generate one or more uuids with a specific version. <b>🔒 Required permissions:</b> <code>tribufu.utils.generate.uuid</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> GenerateUuidWithHttpInfoAsync(int? version = default(int?), int? amount = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (version != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + } + if (amount != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "amount", amount)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GenerateUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/utils/uuid", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GenerateUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current client information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + public void GetClientInfo(int operationIndex = 0) + { + GetClientInfoWithHttpInfo(); + } + + /// + /// Get current client information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse GetClientInfoWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetClientInfo"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/oauth2/clientinfo", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetClientInfo", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current client information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task GetClientInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await GetClientInfoWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get current client information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> GetClientInfoWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetClientInfo"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/oauth2/clientinfo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetClientInfo", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<IpAddress> + public List GetCurrentIpAddress(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetCurrentIpAddressWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get current ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<IpAddress> + public Tribufu.Generated.Client.ApiResponse> GetCurrentIpAddressWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetCurrentIpAddress"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/geoip", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCurrentIpAddress", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<IpAddress> + public async System.Threading.Tasks.Task> GetCurrentIpAddressAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetCurrentIpAddressWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get current ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.current</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<IpAddress>) + public async System.Threading.Tasks.Task>> GetCurrentIpAddressWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetCurrentIpAddress"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/geoip", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCurrentIpAddress", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Game + public Game GetGameById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGameByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a game by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Game + public Tribufu.Generated.Client.ApiResponse GetGameByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/games/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Game + public async System.Threading.Tasks.Task GetGameByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGameByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a game by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Game) + public async System.Threading.Tasks.Task> GetGameByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/games/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game server clusters of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServerCluster> + public List GetGameClustersByGameId(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameClustersByGameIdWithHttpInfo(id, page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game server clusters of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServerCluster> + public Tribufu.Generated.Client.ApiResponse> GetGameClustersByGameIdWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameClustersByGameId"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameClustersByGameId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/games/{id}/clusters", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameClustersByGameId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game server clusters of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServerCluster> + public async System.Threading.Tasks.Task> GetGameClustersByGameIdAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameClustersByGameIdWithHttpInfoAsync(id, page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game server clusters of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServerCluster>) + public async System.Threading.Tasks.Task>> GetGameClustersByGameIdWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameClustersByGameId"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameClustersByGameId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/games/{id}/clusters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameClustersByGameId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game items. <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Object> + public List GetGameItems(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameItemsWithHttpInfo(id, page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game items. <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Object> + public Tribufu.Generated.Client.ApiResponse> GetGameItemsWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameItems"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameItems"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/games/{id}/items", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameItems", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game items. <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> GetGameItemsAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameItemsWithHttpInfoAsync(id, page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game items. <b>🔒 Required permissions:</b> <code>tribufu.community.game.item.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> GetGameItemsWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameItems"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameItems"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/games/{id}/items", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameItems", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server by address and query port. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// GameServer + public GameServer GetGameServerByAddressAndQueryPort(string address, int port, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGameServerByAddressAndQueryPortWithHttpInfo(address, port); + return localVarResponse.Data; + } + + /// + /// Get a game server by address and query port. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of GameServer + public Tribufu.Generated.Client.ApiResponse GetGameServerByAddressAndQueryPortWithHttpInfo(string address, int port, int operationIndex = 0) + { + // verify the required parameter 'address' is set + if (address == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'address' when calling TribufuGeneratedApi->GetGameServerByAddressAndQueryPort"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("address", Tribufu.Generated.Client.ClientUtils.ParameterToString(address)); // path parameter + localVarRequestOptions.PathParameters.Add("port", Tribufu.Generated.Client.ClientUtils.ParameterToString(port)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerByAddressAndQueryPort"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/servers/address/{address}:{port}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerByAddressAndQueryPort", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server by address and query port. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServer + public async System.Threading.Tasks.Task GetGameServerByAddressAndQueryPortAsync(string address, int port, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGameServerByAddressAndQueryPortWithHttpInfoAsync(address, port, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a game server by address and query port. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get.address</code> + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServer) + public async System.Threading.Tasks.Task> GetGameServerByAddressAndQueryPortWithHttpInfoAsync(string address, int port, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'address' is set + if (address == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'address' when calling TribufuGeneratedApi->GetGameServerByAddressAndQueryPort"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("address", Tribufu.Generated.Client.ClientUtils.ParameterToString(address)); // path parameter + localVarRequestOptions.PathParameters.Add("port", Tribufu.Generated.Client.ClientUtils.ParameterToString(port)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerByAddressAndQueryPort"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/servers/address/{address}:{port}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerByAddressAndQueryPort", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GameServer + public GameServer GetGameServerById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGameServerByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a game server by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GameServer + public Tribufu.Generated.Client.ApiResponse GetGameServerByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServerById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/servers/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServer + public async System.Threading.Tasks.Task GetGameServerByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGameServerByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a game server by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServer) + public async System.Threading.Tasks.Task> GetGameServerByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServerById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/servers/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server cluster by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GameServerCluster + public GameServerCluster GetGameServerClusterById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGameServerClusterByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a game server cluster by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GameServerCluster + public Tribufu.Generated.Client.ApiResponse GetGameServerClusterByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServerClusterById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerClusterById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/clusters/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerClusterById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a game server cluster by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GameServerCluster + public async System.Threading.Tasks.Task GetGameServerClusterByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGameServerClusterByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a game server cluster by id. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GameServerCluster) + public async System.Threading.Tasks.Task> GetGameServerClusterByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServerClusterById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerClusterById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/clusters/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerClusterById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game server clusters. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServerCluster> + public List GetGameServerClusters(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameServerClustersWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game server clusters. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServerCluster> + public Tribufu.Generated.Client.ApiResponse> GetGameServerClustersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerClusters"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/clusters", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerClusters", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game server clusters. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServerCluster> + public async System.Threading.Tasks.Task> GetGameServerClustersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameServerClustersWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game server clusters. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServerCluster>) + public async System.Threading.Tasks.Task>> GetGameServerClustersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServerClusters"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/clusters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServerClusters", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + public List GetGameServers(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameServersWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + public Tribufu.Generated.Client.ApiResponse> GetGameServersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/servers", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + public async System.Threading.Tasks.Task> GetGameServersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameServersWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + public async System.Threading.Tasks.Task>> GetGameServersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/servers", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers from a country. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + public List GetGameServersByCountry(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameServersByCountryWithHttpInfo(country, page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers from a country. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + public Tribufu.Generated.Client.ApiResponse> GetGameServersByCountryWithHttpInfo(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'country' when calling TribufuGeneratedApi->GetGameServersByCountry"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("country", Tribufu.Generated.Client.ClientUtils.ParameterToString(country)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersByCountry"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/servers/country/{country}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersByCountry", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers from a country. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + public async System.Threading.Tasks.Task> GetGameServersByCountryAsync(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameServersByCountryWithHttpInfoAsync(country, page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers from a country. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list.country</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + public async System.Threading.Tasks.Task>> GetGameServersByCountryWithHttpInfoAsync(string country, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'country' when calling TribufuGeneratedApi->GetGameServersByCountry"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("country", Tribufu.Generated.Client.ClientUtils.ParameterToString(country)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersByCountry"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/servers/country/{country}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersByCountry", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + public List GetGameServersByGameId(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameServersByGameIdWithHttpInfo(id, page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + public Tribufu.Generated.Client.ApiResponse> GetGameServersByGameIdWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServersByGameId"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersByGameId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/games/{id}/servers", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersByGameId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of game servers of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + public async System.Threading.Tasks.Task> GetGameServersByGameIdAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameServersByGameIdWithHttpInfoAsync(id, page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of game servers of a game. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + public async System.Threading.Tasks.Task>> GetGameServersByGameIdWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGameServersByGameId"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersByGameId"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/games/{id}/servers", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersByGameId", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of countries with the number of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Dictionary<string, int> + public Dictionary GetGameServersCountries(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGameServersCountriesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get a list of countries with the number of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Dictionary<string, int> + public Tribufu.Generated.Client.ApiResponse> GetGameServersCountriesWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersCountries"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/servers/countries", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersCountries", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of countries with the number of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetGameServersCountriesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGameServersCountriesWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of countries with the number of game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.country.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetGameServersCountriesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersCountries"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/servers/countries", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersCountries", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get metrics about the tracked game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ServerMetrics + public ServerMetrics GetGameServersMetrics(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGameServersMetricsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get metrics about the tracked game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ServerMetrics + public Tribufu.Generated.Client.ApiResponse GetGameServersMetricsWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersMetrics"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/servers/metrics", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersMetrics", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get metrics about the tracked game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ServerMetrics + public async System.Threading.Tasks.Task GetGameServersMetricsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGameServersMetricsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get metrics about the tracked game servers. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.metric.get</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ServerMetrics) + public async System.Threading.Tasks.Task> GetGameServersMetricsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGameServersMetrics"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/servers/metrics", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGameServersMetrics", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games. <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Game> + public List GetGames(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGamesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get a list of games. <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Game> + public Tribufu.Generated.Client.ApiResponse> GetGamesWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/games", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games. <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Game> + public async System.Threading.Tasks.Task> GetGamesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGamesWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of games. <b>🔒 Required permissions:</b> <code>tribufu.community.game.list</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Game>) + public async System.Threading.Tasks.Task>> GetGamesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/games", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by id. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + public Group GetGroupById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGroupByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a group by id. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + public Tribufu.Generated.Client.ApiResponse GetGroupByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/groups/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by id. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + public async System.Threading.Tasks.Task GetGroupByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGroupByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a group by id. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + public async System.Threading.Tasks.Task> GetGroupByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/groups/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by tag. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + public Group GetGroupByTag(string tag, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGroupByTagWithHttpInfo(tag); + return localVarResponse.Data; + } + + /// + /// Get a group by tag. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + public Tribufu.Generated.Client.ApiResponse GetGroupByTagWithHttpInfo(string tag, int operationIndex = 0) + { + // verify the required parameter 'tag' is set + if (tag == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'tag' when calling TribufuGeneratedApi->GetGroupByTag"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("tag", Tribufu.Generated.Client.ClientUtils.ParameterToString(tag)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupByTag"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/groups/tag/{tag}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupByTag", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by tag. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + public async System.Threading.Tasks.Task GetGroupByTagAsync(string tag, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGroupByTagWithHttpInfoAsync(tag, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a group by tag. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.tag</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + public async System.Threading.Tasks.Task> GetGroupByTagWithHttpInfoAsync(string tag, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'tag' is set + if (tag == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'tag' when calling TribufuGeneratedApi->GetGroupByTag"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("tag", Tribufu.Generated.Client.ClientUtils.ParameterToString(tag)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupByTag"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/groups/tag/{tag}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupByTag", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Group + public Group GetGroupByUuid(Guid uuid, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetGroupByUuidWithHttpInfo(uuid); + return localVarResponse.Data; + } + + /// + /// Get a group by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Group + public Tribufu.Generated.Client.ApiResponse GetGroupByUuidWithHttpInfo(Guid uuid, int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("uuid", Tribufu.Generated.Client.ClientUtils.ParameterToString(uuid)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupByUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/groups/uuid/{uuid}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupByUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a group by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Group + public async System.Threading.Tasks.Task GetGroupByUuidAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetGroupByUuidWithHttpInfoAsync(uuid, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a group by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.group.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Group) + public async System.Threading.Tasks.Task> GetGroupByUuidWithHttpInfoAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("uuid", Tribufu.Generated.Client.ClientUtils.ParameterToString(uuid)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupByUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/groups/uuid/{uuid}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupByUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games of a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<GroupGame> + public List GetGroupGames(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGroupGamesWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of games of a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<GroupGame> + public Tribufu.Generated.Client.ApiResponse> GetGroupGamesWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupGames"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/groups/{id}/games", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games of a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GroupGame> + public async System.Threading.Tasks.Task> GetGroupGamesAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGroupGamesWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of games of a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GroupGame>) + public async System.Threading.Tasks.Task>> GetGroupGamesWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupGames"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/groups/{id}/games", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of members in a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<GroupMember> + public List GetGroupMembers(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGroupMembersWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of members in a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<GroupMember> + public Tribufu.Generated.Client.ApiResponse> GetGroupMembersWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupMembers"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupMembers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/groups/{id}/members", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupMembers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of members in a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GroupMember> + public async System.Threading.Tasks.Task> GetGroupMembersAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGroupMembersWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of members in a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.member.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GroupMember>) + public async System.Threading.Tasks.Task>> GetGroupMembersWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetGroupMembers"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroupMembers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/groups/{id}/members", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroupMembers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of groups. <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Group> + public List GetGroups(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetGroupsWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of groups. <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Group> + public Tribufu.Generated.Client.ApiResponse> GetGroupsWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroups"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/groups", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroups", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of groups. <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Group> + public async System.Threading.Tasks.Task> GetGroupsAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetGroupsWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of groups. <b>🔒 Required permissions:</b> <code>tribufu.community.group.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Group>) + public async System.Threading.Tasks.Task>> GetGroupsWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetGroups"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/groups", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetGroups", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// IpAddress + public IpAddress GetIpAddress(string address, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetIpAddressWithHttpInfo(address); + return localVarResponse.Data; + } + + /// + /// Get a ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of IpAddress + public Tribufu.Generated.Client.ApiResponse GetIpAddressWithHttpInfo(string address, int operationIndex = 0) + { + // verify the required parameter 'address' is set + if (address == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'address' when calling TribufuGeneratedApi->GetIpAddress"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("address", Tribufu.Generated.Client.ClientUtils.ParameterToString(address)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetIpAddress"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/geoip/addresses/{address}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetIpAddress", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of IpAddress + public async System.Threading.Tasks.Task GetIpAddressAsync(string address, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetIpAddressWithHttpInfoAsync(address, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a ip address location. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (IpAddress) + public async System.Threading.Tasks.Task> GetIpAddressWithHttpInfoAsync(string address, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'address' is set + if (address == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'address' when calling TribufuGeneratedApi->GetIpAddress"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("address", Tribufu.Generated.Client.ClientUtils.ParameterToString(address)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetIpAddress"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/geoip/addresses/{address}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetIpAddress", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of ip addresses. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<IpAddress> + public List GetIpAddresses(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetIpAddressesWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of ip addresses. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<IpAddress> + public Tribufu.Generated.Client.ApiResponse> GetIpAddressesWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetIpAddresses"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/geoip/addresses", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetIpAddresses", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of ip addresses. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<IpAddress> + public async System.Threading.Tasks.Task> GetIpAddressesAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetIpAddressesWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of ip addresses. <b>🔒 Required permissions:</b> <code>tribufu.geoip.address.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<IpAddress>) + public async System.Threading.Tasks.Task>> GetIpAddressesWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetIpAddresses"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/geoip/addresses", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetIpAddresses", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get the top 20 leaderboard users. <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<LeaderboardItem> + public List GetLeaderboard(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetLeaderboardWithHttpInfo(order); + return localVarResponse.Data; + } + + /// + /// Get the top 20 leaderboard users. <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<LeaderboardItem> + public Tribufu.Generated.Client.ApiResponse> GetLeaderboardWithHttpInfo(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (order != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "Order", order)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetLeaderboard"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/leaderboard", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLeaderboard", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get the top 20 leaderboard users. <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<LeaderboardItem> + public async System.Threading.Tasks.Task> GetLeaderboardAsync(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetLeaderboardWithHttpInfoAsync(order, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get the top 20 leaderboard users. <b>🔒 Required permissions:</b> <code>tribufu.community.leaderboard.get</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<LeaderboardItem>) + public async System.Threading.Tasks.Task>> GetLeaderboardWithHttpInfoAsync(LeaderboardOrder? order = default(LeaderboardOrder?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (order != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "Order", order)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetLeaderboard"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/leaderboard", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLeaderboard", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current user information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// UserInfo + [Obsolete] + public UserInfo GetMe(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetMeWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get current user information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of UserInfo + [Obsolete] + public Tribufu.Generated.Client.ApiResponse GetMeWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetMe"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/me", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMe", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current user information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UserInfo + [Obsolete] + public async System.Threading.Tasks.Task GetMeAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetMeWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get current user information. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UserInfo) + [Obsolete] + public async System.Threading.Tasks.Task> GetMeWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetMe"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/me", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMe", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a package by id. <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Package + public Package GetPackageById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetPackageByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a package by id. <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Package + public Tribufu.Generated.Client.ApiResponse GetPackageByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetPackageById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPackageById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/packages/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPackageById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a package by id. <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Package + public async System.Threading.Tasks.Task GetPackageByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetPackageByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a package by id. <b>🔒 Required permissions:</b> <code>tribufu.community.package.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Package) + public async System.Threading.Tasks.Task> GetPackageByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetPackageById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPackageById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/packages/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPackageById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of packages. <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Package> + public List GetPackages(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetPackagesWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of packages. <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Package> + public Tribufu.Generated.Client.ApiResponse> GetPackagesWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPackages"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/packages", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPackages", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of packages. <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Package> + public async System.Threading.Tasks.Task> GetPackagesAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetPackagesWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of packages. <b>🔒 Required permissions:</b> <code>tribufu.community.package.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Package>) + public async System.Threading.Tasks.Task>> GetPackagesWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPackages"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/packages", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPackages", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get the public keys for the client. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + public void GetPublicKeys(int operationIndex = 0) + { + GetPublicKeysWithHttpInfo(); + } + + /// + /// Get the public keys for the client. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse GetPublicKeysWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPublicKeys"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/oauth2/jwks", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPublicKeys", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get the public keys for the client. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task GetPublicKeysAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await GetPublicKeysWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the public keys for the client. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.client.keys</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> GetPublicKeysWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetPublicKeys"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/oauth2/jwks", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPublicKeys", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a subscription by id. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Subscription + public Subscription GetSubscriptionById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetSubscriptionByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a subscription by id. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Subscription + public Tribufu.Generated.Client.ApiResponse GetSubscriptionByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetSubscriptionById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetSubscriptionById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/subscriptions/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSubscriptionById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a subscription by id. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Subscription + public async System.Threading.Tasks.Task GetSubscriptionByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetSubscriptionByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a subscription by id. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Subscription) + public async System.Threading.Tasks.Task> GetSubscriptionByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetSubscriptionById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetSubscriptionById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/subscriptions/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSubscriptionById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of subscriptions. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Subscription> + public List GetSubscriptions(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetSubscriptionsWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of subscriptions. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Subscription> + public Tribufu.Generated.Client.ApiResponse> GetSubscriptionsWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetSubscriptions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/subscriptions", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSubscriptions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of subscriptions. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Subscription> + public async System.Threading.Tasks.Task> GetSubscriptionsAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetSubscriptionsWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of subscriptions. <b>🔒 Required permissions:</b> <code>tribufu.store.subscription.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Subscription>) + public async System.Threading.Tasks.Task>> GetSubscriptionsWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetSubscriptions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/subscriptions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSubscriptions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of connected accounts of the user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Account> + public List GetUserAccounts(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserAccountsWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of connected accounts of the user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Account> + public Tribufu.Generated.Client.ApiResponse> GetUserAccountsWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserAccounts"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserAccounts"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/accounts", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserAccounts", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of connected accounts of the user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Account> + public async System.Threading.Tasks.Task> GetUserAccountsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserAccountsWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of connected accounts of the user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.account.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Account>) + public async System.Threading.Tasks.Task>> GetUserAccountsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserAccounts"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserAccounts"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/accounts", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserAccounts", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by id. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + public Profile GetUserById(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetUserByIdWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a user profile by id. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + public Tribufu.Generated.Client.ApiResponse GetUserByIdWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserById"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/users/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by id. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + public async System.Threading.Tasks.Task GetUserByIdAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetUserByIdWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a user profile by id. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + public async System.Threading.Tasks.Task> GetUserByIdWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserById"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/users/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by name. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + public Profile GetUserByName(string name, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetUserByNameWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get a user profile by name. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + public Tribufu.Generated.Client.ApiResponse GetUserByNameWithHttpInfo(string name, int operationIndex = 0) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'name' when calling TribufuGeneratedApi->GetUserByName"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", Tribufu.Generated.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserByName"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/users/name/{name}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by name. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + public async System.Threading.Tasks.Task GetUserByNameAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetUserByNameWithHttpInfoAsync(name, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a user profile by name. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.name</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + public async System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'name' when calling TribufuGeneratedApi->GetUserByName"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", Tribufu.Generated.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserByName"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/users/name/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Profile + public Profile GetUserByUuid(Guid uuid, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetUserByUuidWithHttpInfo(uuid); + return localVarResponse.Data; + } + + /// + /// Get a user profile by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Profile + public Tribufu.Generated.Client.ApiResponse GetUserByUuidWithHttpInfo(Guid uuid, int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("uuid", Tribufu.Generated.Client.ClientUtils.ParameterToString(uuid)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserByUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/users/uuid/{uuid}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a user profile by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + public async System.Threading.Tasks.Task GetUserByUuidAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetUserByUuidWithHttpInfoAsync(uuid, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a user profile by uuid. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.get.uuid</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + public async System.Threading.Tasks.Task> GetUserByUuidWithHttpInfoAsync(Guid uuid, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("uuid", Tribufu.Generated.Client.ClientUtils.ParameterToString(uuid)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserByUuid"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/users/uuid/{uuid}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByUuid", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of friends of the user. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Object> + public List GetUserFriends(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserFriendsWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of friends of the user. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Object> + public Tribufu.Generated.Client.ApiResponse> GetUserFriendsWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserFriends"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserFriends"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/friends", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserFriends", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of friends of the user. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> GetUserFriendsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserFriendsWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of friends of the user. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.friend.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> GetUserFriendsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserFriends"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserFriends"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/friends", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserFriends", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games the user has played. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<ProfileGame> + public List GetUserGames(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserGamesWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of games the user has played. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<ProfileGame> + public Tribufu.Generated.Client.ApiResponse> GetUserGamesWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserGames"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/games", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of games the user has played. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<ProfileGame> + public async System.Threading.Tasks.Task> GetUserGamesAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserGamesWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of games the user has played. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileGame>) + public async System.Threading.Tasks.Task>> GetUserGamesWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserGames"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserGames"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/games", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserGames", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of groups the user is a member of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<ProfileGroup> + public List GetUserGroups(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserGroupsWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of groups the user is a member of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<ProfileGroup> + public Tribufu.Generated.Client.ApiResponse> GetUserGroupsWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserGroups"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserGroups"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/groups", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserGroups", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of groups the user is a member of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<ProfileGroup> + public async System.Threading.Tasks.Task> GetUserGroupsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserGroupsWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of groups the user is a member of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.group.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileGroup>) + public async System.Threading.Tasks.Task>> GetUserGroupsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserGroups"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserGroups"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/groups", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserGroups", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// UserInfo + public UserInfo GetUserInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = GetUserInfoWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get current user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of UserInfo + public Tribufu.Generated.Client.ApiResponse GetUserInfoWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserInfo"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/oauth2/userinfo", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserInfo", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get current user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of UserInfo + public async System.Threading.Tasks.Task GetUserInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await GetUserInfoWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get current user information. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.user.info</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UserInfo) + public async System.Threading.Tasks.Task> GetUserInfoWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserInfo"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/oauth2/userinfo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserInfo", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of punishments the user has received. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<Object> + public List GetUserPunishments(string id, int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserPunishmentsWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Get a list of punishments the user has received. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<Object> + public Tribufu.Generated.Client.ApiResponse> GetUserPunishmentsWithHttpInfo(string id, int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserPunishments"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserPunishments"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/punishments", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserPunishments", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of punishments the user has received. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> GetUserPunishmentsAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserPunishmentsWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of punishments the user has received. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.punishment.list</code> + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> GetUserPunishmentsWithHttpInfoAsync(string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserPunishments"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserPunishments"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/punishments", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserPunishments", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of servers the user is owner of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<GameServer> + public List GetUserServers(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUserServersWithHttpInfo(id, page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of servers the user is owner of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<GameServer> + public Tribufu.Generated.Client.ApiResponse> GetUserServersWithHttpInfo(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserServers"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserServers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users/{id}/servers", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserServers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of servers the user is owner of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<GameServer> + public async System.Threading.Tasks.Task> GetUserServersAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUserServersWithHttpInfoAsync(id, page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of servers the user is owner of. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.game.server.list</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<GameServer>) + public async System.Threading.Tasks.Task>> GetUserServersWithHttpInfoAsync(string id, int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->GetUserServers"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUserServers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users/{id}/servers", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserServers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of user profiles. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// List<Profile> + public List GetUsers(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = GetUsersWithHttpInfo(page, limit); + return localVarResponse.Data; + } + + /// + /// Get a list of user profiles. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Profile> + public Tribufu.Generated.Client.ApiResponse> GetUsersWithHttpInfo(int? page = default(int?), int? limit = default(int?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUsers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/v1/users", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUsers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get a list of user profiles. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Profile> + public async System.Threading.Tasks.Task> GetUsersAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await GetUsersWithHttpInfoAsync(page, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get a list of user profiles. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.list</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Profile>) + public async System.Threading.Tasks.Task>> GetUsersWithHttpInfoAsync(int? page = default(int?), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Tribufu.Generated.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "TribufuGeneratedApi.GetUsers"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/v1/users", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUsers", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using argon2. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + public HashViewModel HashArgon2(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = HashArgon2WithHttpInfo(hashViewModel); + return localVarResponse.Data; + } + + /// + /// Hash a string using argon2. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + public Tribufu.Generated.Client.ApiResponse HashArgon2WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashArgon2"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/utils/argon2", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashArgon2", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using argon2. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + public async System.Threading.Tasks.Task HashArgon2Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await HashArgon2WithHttpInfoAsync(hashViewModel, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hash a string using argon2. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.argon2</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + public async System.Threading.Tasks.Task> HashArgon2WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashArgon2"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/utils/argon2", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashArgon2", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using bcrypt. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + public HashViewModel HashBcrypt(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = HashBcryptWithHttpInfo(hashViewModel); + return localVarResponse.Data; + } + + /// + /// Hash a string using bcrypt. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + public Tribufu.Generated.Client.ApiResponse HashBcryptWithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashBcrypt"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/utils/bcrypt", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashBcrypt", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using bcrypt. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + public async System.Threading.Tasks.Task HashBcryptAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await HashBcryptWithHttpInfoAsync(hashViewModel, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hash a string using bcrypt. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.bcrypt</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + public async System.Threading.Tasks.Task> HashBcryptWithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashBcrypt"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/utils/bcrypt", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashBcrypt", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using md5. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + public HashViewModel HashMd5(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = HashMd5WithHttpInfo(hashViewModel); + return localVarResponse.Data; + } + + /// + /// Hash a string using md5. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + public Tribufu.Generated.Client.ApiResponse HashMd5WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashMd5"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/utils/md5", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashMd5", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using md5. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + public async System.Threading.Tasks.Task HashMd5Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await HashMd5WithHttpInfoAsync(hashViewModel, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hash a string using md5. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.md5</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + public async System.Threading.Tasks.Task> HashMd5WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashMd5"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/utils/md5", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashMd5", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using sha256. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// HashViewModel + public HashViewModel HashSha256(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = HashSha256WithHttpInfo(hashViewModel); + return localVarResponse.Data; + } + + /// + /// Hash a string using sha256. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of HashViewModel + public Tribufu.Generated.Client.ApiResponse HashSha256WithHttpInfo(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashSha256"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/utils/sha256", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashSha256", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hash a string using sha256. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of HashViewModel + public async System.Threading.Tasks.Task HashSha256Async(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await HashSha256WithHttpInfoAsync(hashViewModel, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hash a string using sha256. <b>🔒 Required permissions:</b> <code>tribufu.utils.hash.sha256</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HashViewModel) + public async System.Threading.Tasks.Task> HashSha256WithHttpInfoAsync(HashViewModel? hashViewModel = default(HashViewModel?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = hashViewModel; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.HashSha256"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/utils/sha256", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HashSha256", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Introspect a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void IntrospectToken(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0) + { + IntrospectTokenWithHttpInfo(introspectRequest); + } + + /// + /// Introspect a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse IntrospectTokenWithHttpInfo(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = introspectRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.IntrospectToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/oauth2/introspect", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("IntrospectToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Introspect a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task IntrospectTokenAsync(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await IntrospectTokenWithHttpInfoAsync(introspectRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Introspect a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.introspect</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> IntrospectTokenWithHttpInfoAsync(IntrospectRequest? introspectRequest = default(IntrospectRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = introspectRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.IntrospectToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/oauth2/introspect", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("IntrospectToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Login with name or email and password. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + [Obsolete] + public LoginResponse Login(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = LoginWithHttpInfo(loginRequest); + return localVarResponse.Data; + } + + /// + /// Login with name or email and password. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + [Obsolete] + public Tribufu.Generated.Client.ApiResponse LoginWithHttpInfo(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = loginRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Login"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/login", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Login", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Login with name or email and password. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + [Obsolete] + public async System.Threading.Tasks.Task LoginAsync(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await LoginWithHttpInfoAsync(loginRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Login with name or email and password. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + [Obsolete] + public async System.Threading.Tasks.Task> LoginWithHttpInfoAsync(LoginRequest? loginRequest = default(LoginRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = loginRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Login"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Login", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Invalidate credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + [Obsolete] + public void Logout(int operationIndex = 0) + { + LogoutWithHttpInfo(); + } + + /// + /// Invalidate credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + [Obsolete] + public Tribufu.Generated.Client.ApiResponse LogoutWithHttpInfo(int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Logout"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/logout", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Logout", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Invalidate credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + [Obsolete] + public async System.Threading.Tasks.Task LogoutAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await LogoutWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Invalidate credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.revoke</code> + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + [Obsolete] + public async System.Threading.Tasks.Task> LogoutWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Logout"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Logout", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Refresh credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + [Obsolete] + public LoginResponse Refresh(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = RefreshWithHttpInfo(refreshRequest); + return localVarResponse.Data; + } + + /// + /// Refresh credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + [Obsolete] + public Tribufu.Generated.Client.ApiResponse RefreshWithHttpInfo(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = refreshRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Refresh"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/refresh", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Refresh", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Refresh credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + [Obsolete] + public async System.Threading.Tasks.Task RefreshAsync(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await RefreshWithHttpInfoAsync(refreshRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Refresh credentials. <b>🔒 Required permissions:</b> <code>tribufu.identity.token.refresh</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + [Obsolete] + public async System.Threading.Tasks.Task> RefreshWithHttpInfoAsync(RefreshRequest? refreshRequest = default(RefreshRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = refreshRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Refresh"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/refresh", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Refresh", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// LoginResponse + public LoginResponse Register(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = RegisterWithHttpInfo(registerRequest); + return localVarResponse.Data; + } + + /// + /// Create a new user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of LoginResponse + public Tribufu.Generated.Client.ApiResponse RegisterWithHttpInfo(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = registerRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Register"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/register", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Register", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of LoginResponse + public async System.Threading.Tasks.Task RegisterAsync(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await RegisterWithHttpInfoAsync(registerRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a new user. <b>🔒 Required permissions:</b> <code>tribufu.identity.user.create</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LoginResponse) + public async System.Threading.Tasks.Task> RegisterWithHttpInfoAsync(RegisterRequest? registerRequest = default(RegisterRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = registerRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Register"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/register", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Register", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Revoke a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// + public void RevokeToken(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0) + { + RevokeTokenWithHttpInfo(revokeRequest); + } + + /// + /// Revoke a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse RevokeTokenWithHttpInfo(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = revokeRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.RevokeToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/oauth2/revoke", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RevokeToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Revoke a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task RevokeTokenAsync(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await RevokeTokenWithHttpInfoAsync(revokeRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Revoke a token. <b>🔒 Required permissions:</b> <code>tribufu.identity.oauth2.token.revoke</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> RevokeTokenWithHttpInfoAsync(RevokeRequest? revokeRequest = default(RevokeRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = revokeRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.RevokeToken"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/oauth2/revoke", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RevokeToken", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Advanced search for servers or players. <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// List<Object> + public List Search(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = SearchWithHttpInfo(searchRequest); + return localVarResponse.Data; + } + + /// + /// Advanced search for servers or players. <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<Object> + public Tribufu.Generated.Client.ApiResponse> SearchWithHttpInfo(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0) + { + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = searchRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Search"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post>("/v1/search", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Search", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Advanced search for servers or players. <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> SearchAsync(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse> localVarResponse = await SearchWithHttpInfoAsync(searchRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Advanced search for servers or players. <b>🔒 Required permissions:</b> <code>tribufu.community.search</code> + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> SearchWithHttpInfoAsync(SearchRequest? searchRequest = default(SearchRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = searchRequest; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.Search"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync>("/v1/search", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Search", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void UpdateGameServer(string id, Object? body = default(Object?), int operationIndex = 0) + { + UpdateGameServerWithHttpInfo(id, body); + } + + /// + /// Update a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse UpdateGameServerWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGameServer"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/servers/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateGameServerAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await UpdateGameServerWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a game server. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateGameServerWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGameServer"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGameServer"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/servers/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGameServer", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void UpdateGameServerCluster(string id, Object? body = default(Object?), int operationIndex = 0) + { + UpdateGameServerClusterWithHttpInfo(id, body); + } + + /// + /// Update a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse UpdateGameServerClusterWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGameServerCluster"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/clusters/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateGameServerClusterAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await UpdateGameServerClusterWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a game server cluster. <b>🔒 Required permissions:</b> <code>tribufu.community.game.server.cluster.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateGameServerClusterWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGameServerCluster"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGameServerCluster"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/clusters/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGameServerCluster", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// + public void UpdateGroup(string id, Object? body = default(Object?), int operationIndex = 0) + { + UpdateGroupWithHttpInfo(id, body); + } + + /// + /// Update a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Tribufu.Generated.Client.ApiResponse UpdateGroupWithHttpInfo(string id, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGroup"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/groups/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateGroupAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await UpdateGroupWithHttpInfoAsync(id, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a group. <b>🔒 Required permissions:</b> <code>tribufu.community.group.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateGroupWithHttpInfoAsync(string id, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateGroup"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateGroup"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/groups/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateGroup", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a user profile. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Profile + public Profile UpdateUserProfile(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = UpdateUserProfileWithHttpInfo(id, updateProfile); + return localVarResponse.Data; + } + + /// + /// Update a user profile. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Profile + public Tribufu.Generated.Client.ApiResponse UpdateUserProfileWithHttpInfo(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateUserProfile"); + } + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = updateProfile; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateUserProfile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v1/users/{id}/profile", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUserProfile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update a user profile. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Profile + public async System.Threading.Tasks.Task UpdateUserProfileAsync(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Tribufu.Generated.Client.ApiResponse localVarResponse = await UpdateUserProfileWithHttpInfoAsync(id, updateProfile, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update a user profile. <b>🔒 Required permissions:</b> <code>tribufu.community.profile.update</code> + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Profile) + public async System.Threading.Tasks.Task> UpdateUserProfileWithHttpInfoAsync(string id, UpdateProfile? updateProfile = default(UpdateProfile?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new Tribufu.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling TribufuGeneratedApi->UpdateUserProfile"); + } + + + Tribufu.Generated.Client.RequestOptions localVarRequestOptions = new Tribufu.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Tribufu.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Tribufu.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("id", Tribufu.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = updateProfile; + + localVarRequestOptions.Operation = "TribufuGeneratedApi.UpdateUserProfile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v1/users/{id}/profile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUserProfile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/Tribufu.Generated/Client/ApiClient.cs b/src/Tribufu.Generated/Client/ApiClient.cs new file mode 100644 index 0000000..d24469d --- /dev/null +++ b/src/Tribufu.Generated/Client/ApiClient.cs @@ -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 +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + 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; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + 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(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + 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; + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + 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 + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + 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; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + 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; + } + + /// + /// 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. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + 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()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action 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 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(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + 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> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action 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>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> 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(client, request, policyResult, cancellationToken); + } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/src/Tribufu.Generated/Client/ApiException.cs b/src/Tribufu.Generated/Client/ApiException.cs new file mode 100644 index 0000000..3962857 --- /dev/null +++ b/src/Tribufu.Generated/Client/ApiException.cs @@ -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 +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/src/Tribufu.Generated/Client/ApiResponse.cs b/src/Tribufu.Generated/Client/ApiResponse.cs new file mode 100644 index 0000000..8a8a71a --- /dev/null +++ b/src/Tribufu.Generated/Client/ApiResponse.cs @@ -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 +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/src/Tribufu.Generated/Client/ClientUtils.cs b/src/Tribufu.Generated/Client/ClientUtils.cs new file mode 100644 index 0000000..674a366 --- /dev/null +++ b/src/Tribufu.Generated/Client/ClientUtils.cs @@ -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 +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + 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; + } + + /// + /// 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. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + 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 entries = new List(); + 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); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// 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' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + 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' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + 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); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + 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().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + 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().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/src/Tribufu.Generated/Client/Configuration.cs b/src/Tribufu.Generated/Client/Configuration.cs new file mode 100644 index 0000000..0339d4d --- /dev/null +++ b/src/Tribufu.Generated/Client/Configuration.cs @@ -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 +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + 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 + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [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(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", ""}, + {"description", "No description provided"}, + } + } + }; + OperationServers = new Dictionary>>() + { + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = TimeSpan.FromSeconds(100); + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary 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 + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// 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. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. + /// + public virtual TimeSpan Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + 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; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + 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; + } + } + } + + /// + /// 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 + /// + /// The DateTimeFormat string + 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; + } + } + + /// + /// 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: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary 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(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)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)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + 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; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary 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 + } +} diff --git a/src/Tribufu.Generated/Client/ExceptionFactory.cs b/src/Tribufu.Generated/Client/ExceptionFactory.cs new file mode 100644 index 0000000..1437210 --- /dev/null +++ b/src/Tribufu.Generated/Client/ExceptionFactory.cs @@ -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 +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/src/Tribufu.Generated/Client/GlobalConfiguration.cs b/src/Tribufu.Generated/Client/GlobalConfiguration.cs new file mode 100644 index 0000000..3be8ef2 --- /dev/null +++ b/src/Tribufu.Generated/Client/GlobalConfiguration.cs @@ -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 +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/src/Tribufu.Generated/Client/HttpMethod.cs b/src/Tribufu.Generated/Client/HttpMethod.cs new file mode 100644 index 0000000..bead31f --- /dev/null +++ b/src/Tribufu.Generated/Client/HttpMethod.cs @@ -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 +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/src/Tribufu.Generated/Client/IApiAccessor.cs b/src/Tribufu.Generated/Client/IApiAccessor.cs new file mode 100644 index 0000000..98b6309 --- /dev/null +++ b/src/Tribufu.Generated/Client/IApiAccessor.cs @@ -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 +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/src/Tribufu.Generated/Client/IAsynchronousClient.cs b/src/Tribufu.Generated/Client/IAsynchronousClient.cs new file mode 100644 index 0000000..b8dbb82 --- /dev/null +++ b/src/Tribufu.Generated/Client/IAsynchronousClient.cs @@ -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 +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + } +} diff --git a/src/Tribufu.Generated/Client/IReadableConfiguration.cs b/src/Tribufu.Generated/Client/IReadableConfiguration.cs new file mode 100644 index 0000000..82bfda4 --- /dev/null +++ b/src/Tribufu.Generated/Client/IReadableConfiguration.cs @@ -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 +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout. + /// + /// HTTP connection timeout. + TimeSpan Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// 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. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/src/Tribufu.Generated/Client/ISynchronousClient.cs b/src/Tribufu.Generated/Client/ISynchronousClient.cs new file mode 100644 index 0000000..6a607c2 --- /dev/null +++ b/src/Tribufu.Generated/Client/ISynchronousClient.cs @@ -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 +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/src/Tribufu.Generated/Client/Multimap.cs b/src/Tribufu.Generated/Client/Multimap.cs new file mode 100644 index 0000000..69f31e6 --- /dev/null +++ b/src/Tribufu.Generated/Client/Multimap.cs @@ -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 +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList 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(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// 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. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { 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 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 value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/src/Tribufu.Generated/Client/OpenAPIDateConverter.cs b/src/Tribufu.Generated/Client/OpenAPIDateConverter.cs new file mode 100644 index 0000000..65f2ce5 --- /dev/null +++ b/src/Tribufu.Generated/Client/OpenAPIDateConverter.cs @@ -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 +{ + /// + /// 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 + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/src/Tribufu.Generated/Client/RequestOptions.cs b/src/Tribufu.Generated/Client/RequestOptions.cs new file mode 100644 index 0000000..d23f0fe --- /dev/null +++ b/src/Tribufu.Generated/Client/RequestOptions.cs @@ -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 +{ + /// + /// 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). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Operation associated with the request path. + /// + public string Operation { get; set; } + + /// + /// Index associated with the operation. + /// + public int OperationIndex { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/src/Tribufu.Generated/Client/RetryConfiguration.cs b/src/Tribufu.Generated/Client/RetryConfiguration.cs new file mode 100644 index 0000000..1b53371 --- /dev/null +++ b/src/Tribufu.Generated/Client/RetryConfiguration.cs @@ -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 +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs b/src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs new file mode 100644 index 0000000..730a611 --- /dev/null +++ b/src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs @@ -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 +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + 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 + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + 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 + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/src/Tribufu.Generated/Model/Account.cs b/src/Tribufu.Generated/Model/Account.cs new file mode 100644 index 0000000..21abd08 --- /dev/null +++ b/src/Tribufu.Generated/Model/Account.cs @@ -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 +{ + /// + /// Account + /// + [DataContract(Name = "Account")] + public partial class Account : IValidatableObject + { + + /// + /// Gets or Sets Provider + /// + [DataMember(Name = "provider", EmitDefaultValue = false)] + public LoginProvider? Provider { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// provider. + /// userId. + /// authorized. + /// fields. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets UserId + /// + [DataMember(Name = "user_id", EmitDefaultValue = false)] + public string UserId { get; set; } + + /// + /// Gets or Sets Authorized + /// + [DataMember(Name = "authorized", EmitDefaultValue = true)] + public bool Authorized { get; set; } + + /// + /// Gets or Sets Fields + /// + [DataMember(Name = "fields", EmitDefaultValue = true)] + public Object Fields { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/Application.cs b/src/Tribufu.Generated/Model/Application.cs new file mode 100644 index 0000000..d5e43c4 --- /dev/null +++ b/src/Tribufu.Generated/Model/Application.cs @@ -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 +{ + /// + /// Application + /// + [DataContract(Name = "Application")] + public partial class Application : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public ApplicationType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// description. + /// type. + /// organizationId. + /// iconUrl. + /// bannerUrl. + /// capsuleImageUrl. + /// libraryImageUrl. + /// parentId. + /// slug. + /// visibility. + /// password. + /// primary. + /// userCount. + /// achievementCount. + /// badgeCount. + /// downloadCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets OrganizationId + /// + [DataMember(Name = "organization_id", EmitDefaultValue = true)] + public string OrganizationId { get; set; } + + /// + /// Gets or Sets IconUrl + /// + [DataMember(Name = "icon_url", EmitDefaultValue = true)] + public string IconUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets CapsuleImageUrl + /// + [DataMember(Name = "capsule_image_url", EmitDefaultValue = true)] + public string CapsuleImageUrl { get; set; } + + /// + /// Gets or Sets LibraryImageUrl + /// + [DataMember(Name = "library_image_url", EmitDefaultValue = true)] + public string LibraryImageUrl { get; set; } + + /// + /// Gets or Sets ParentId + /// + [DataMember(Name = "parent_id", EmitDefaultValue = true)] + public string ParentId { get; set; } + + /// + /// Gets or Sets Slug + /// + [DataMember(Name = "slug", EmitDefaultValue = true)] + public string Slug { get; set; } + + /// + /// Gets or Sets Visibility + /// + [DataMember(Name = "visibility", EmitDefaultValue = false)] + public int Visibility { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Gets or Sets Primary + /// + [DataMember(Name = "primary", EmitDefaultValue = false)] + public int Primary { get; set; } + + /// + /// Gets or Sets UserCount + /// + [DataMember(Name = "user_count", EmitDefaultValue = false)] + public int UserCount { get; set; } + + /// + /// Gets or Sets AchievementCount + /// + [DataMember(Name = "achievement_count", EmitDefaultValue = false)] + public int AchievementCount { get; set; } + + /// + /// Gets or Sets BadgeCount + /// + [DataMember(Name = "badge_count", EmitDefaultValue = true)] + public int? BadgeCount { get; set; } + + /// + /// Gets or Sets DownloadCount + /// + [DataMember(Name = "download_count", EmitDefaultValue = false)] + public int DownloadCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/ApplicationType.cs b/src/Tribufu.Generated/Model/ApplicationType.cs new file mode 100644 index 0000000..4b4ee6b --- /dev/null +++ b/src/Tribufu.Generated/Model/ApplicationType.cs @@ -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 +{ + /// + /// Defines ApplicationType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ApplicationType + { + /// + /// Enum Application for value: application + /// + [EnumMember(Value = "application")] + Application, + + /// + /// Enum Game for value: game + /// + [EnumMember(Value = "game")] + Game + } + +} diff --git a/src/Tribufu.Generated/Model/AuthorizeRequest.cs b/src/Tribufu.Generated/Model/AuthorizeRequest.cs new file mode 100644 index 0000000..705b07a --- /dev/null +++ b/src/Tribufu.Generated/Model/AuthorizeRequest.cs @@ -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 +{ + /// + /// AuthorizeRequest + /// + [DataContract(Name = "AuthorizeRequest")] + public partial class AuthorizeRequest : IValidatableObject + { + + /// + /// Gets or Sets ResponseType + /// + [DataMember(Name = "response_type", EmitDefaultValue = false)] + public ResponseType? ResponseType { get; set; } + + /// + /// Gets or Sets CodeChallengeMethod + /// + [DataMember(Name = "code_challenge_method", EmitDefaultValue = false)] + public CodeChallengeMethod? CodeChallengeMethod { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// responseType. + /// clientId. + /// codeChallenge. + /// codeChallengeMethod. + /// redirectUri. + /// scope. + /// state. + 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; + } + + /// + /// Gets or Sets ClientId + /// + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Gets or Sets CodeChallenge + /// + [DataMember(Name = "code_challenge", EmitDefaultValue = true)] + public string CodeChallenge { get; set; } + + /// + /// Gets or Sets RedirectUri + /// + [DataMember(Name = "redirect_uri", EmitDefaultValue = true)] + public string RedirectUri { get; set; } + + /// + /// Gets or Sets Scope + /// + [DataMember(Name = "scope", EmitDefaultValue = true)] + public string Scope { get; set; } + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", EmitDefaultValue = true)] + public string State { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/CodeChallengeMethod.cs b/src/Tribufu.Generated/Model/CodeChallengeMethod.cs new file mode 100644 index 0000000..37c2476 --- /dev/null +++ b/src/Tribufu.Generated/Model/CodeChallengeMethod.cs @@ -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 +{ + /// + /// Defines CodeChallengeMethod + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum CodeChallengeMethod + { + /// + /// Enum Plain for value: plain + /// + [EnumMember(Value = "plain")] + Plain, + + /// + /// Enum S256 for value: S256 + /// + [EnumMember(Value = "S256")] + S256 + } + +} diff --git a/src/Tribufu.Generated/Model/CryptoViewModel.cs b/src/Tribufu.Generated/Model/CryptoViewModel.cs new file mode 100644 index 0000000..dbe6d1d --- /dev/null +++ b/src/Tribufu.Generated/Model/CryptoViewModel.cs @@ -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 +{ + /// + /// CryptoViewModel + /// + [DataContract(Name = "CryptoViewModel")] + public partial class CryptoViewModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// encoded. + /// decoded. + public CryptoViewModel(string encoded = default(string), string decoded = default(string)) + { + this.Encoded = encoded; + this.Decoded = decoded; + } + + /// + /// Gets or Sets Encoded + /// + [DataMember(Name = "encoded", EmitDefaultValue = true)] + public string Encoded { get; set; } + + /// + /// Gets or Sets Decoded + /// + [DataMember(Name = "decoded", EmitDefaultValue = true)] + public string Decoded { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/Game.cs b/src/Tribufu.Generated/Model/Game.cs new file mode 100644 index 0000000..b967c71 --- /dev/null +++ b/src/Tribufu.Generated/Model/Game.cs @@ -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 +{ + /// + /// Game + /// + [DataContract(Name = "Game")] + public partial class Game : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public ApplicationType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// gamePort. + /// queryPort. + /// rconPort. + /// serverCount. + /// steamAppId. + /// steamServerAppId. + /// enableServers. + /// rustGamedigId. + /// nodeGamedigId. + /// serverConnectUrl. + /// serverTags. + /// id. + /// name. + /// description. + /// type. + /// organizationId. + /// iconUrl. + /// bannerUrl. + /// capsuleImageUrl. + /// libraryImageUrl. + /// parentId. + /// slug. + /// visibility. + /// password. + /// primary. + /// userCount. + /// achievementCount. + /// badgeCount. + /// downloadCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets GamePort + /// + [DataMember(Name = "game_port", EmitDefaultValue = true)] + public int? GamePort { get; set; } + + /// + /// Gets or Sets QueryPort + /// + [DataMember(Name = "query_port", EmitDefaultValue = true)] + public int? QueryPort { get; set; } + + /// + /// Gets or Sets RconPort + /// + [DataMember(Name = "rcon_port", EmitDefaultValue = true)] + public int? RconPort { get; set; } + + /// + /// Gets or Sets ServerCount + /// + [DataMember(Name = "server_count", EmitDefaultValue = false)] + public int ServerCount { get; set; } + + /// + /// Gets or Sets SteamAppId + /// + [DataMember(Name = "steam_app_id", EmitDefaultValue = true)] + public int? SteamAppId { get; set; } + + /// + /// Gets or Sets SteamServerAppId + /// + [DataMember(Name = "steam_server_app_id", EmitDefaultValue = true)] + public int? SteamServerAppId { get; set; } + + /// + /// Gets or Sets EnableServers + /// + [DataMember(Name = "enable_servers", EmitDefaultValue = true)] + public bool EnableServers { get; set; } + + /// + /// Gets or Sets RustGamedigId + /// + [DataMember(Name = "rust_gamedig_id", EmitDefaultValue = true)] + public string RustGamedigId { get; set; } + + /// + /// Gets or Sets NodeGamedigId + /// + [DataMember(Name = "node_gamedig_id", EmitDefaultValue = true)] + public string NodeGamedigId { get; set; } + + /// + /// Gets or Sets ServerConnectUrl + /// + [DataMember(Name = "server_connect_url", EmitDefaultValue = true)] + public string ServerConnectUrl { get; set; } + + /// + /// Gets or Sets ServerTags + /// + [DataMember(Name = "server_tags", EmitDefaultValue = true)] + public string ServerTags { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets OrganizationId + /// + [DataMember(Name = "organization_id", EmitDefaultValue = true)] + public string OrganizationId { get; set; } + + /// + /// Gets or Sets IconUrl + /// + [DataMember(Name = "icon_url", EmitDefaultValue = true)] + public string IconUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets CapsuleImageUrl + /// + [DataMember(Name = "capsule_image_url", EmitDefaultValue = true)] + public string CapsuleImageUrl { get; set; } + + /// + /// Gets or Sets LibraryImageUrl + /// + [DataMember(Name = "library_image_url", EmitDefaultValue = true)] + public string LibraryImageUrl { get; set; } + + /// + /// Gets or Sets ParentId + /// + [DataMember(Name = "parent_id", EmitDefaultValue = true)] + public string ParentId { get; set; } + + /// + /// Gets or Sets Slug + /// + [DataMember(Name = "slug", EmitDefaultValue = true)] + public string Slug { get; set; } + + /// + /// Gets or Sets Visibility + /// + [DataMember(Name = "visibility", EmitDefaultValue = false)] + public int Visibility { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Gets or Sets Primary + /// + [DataMember(Name = "primary", EmitDefaultValue = false)] + public int Primary { get; set; } + + /// + /// Gets or Sets UserCount + /// + [DataMember(Name = "user_count", EmitDefaultValue = false)] + public int UserCount { get; set; } + + /// + /// Gets or Sets AchievementCount + /// + [DataMember(Name = "achievement_count", EmitDefaultValue = false)] + public int AchievementCount { get; set; } + + /// + /// Gets or Sets BadgeCount + /// + [DataMember(Name = "badge_count", EmitDefaultValue = true)] + public int? BadgeCount { get; set; } + + /// + /// Gets or Sets DownloadCount + /// + [DataMember(Name = "download_count", EmitDefaultValue = false)] + public int DownloadCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GameServer.cs b/src/Tribufu.Generated/Model/GameServer.cs new file mode 100644 index 0000000..df225a1 --- /dev/null +++ b/src/Tribufu.Generated/Model/GameServer.cs @@ -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 +{ + /// + /// GameServer + /// + [DataContract(Name = "GameServer")] + public partial class GameServer : IValidatableObject + { + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + public ServerStatus? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// description. + /// address. + /// gamePort. + /// queryPort. + /// gameId. + /// gameIconUrl. + /// varVersion. + /// featured. + /// clusterId. + /// websiteUrl. + /// bannerUrl. + /// ownerId. + /// uptime. + /// status. + /// ping. + /// map. + /// usedSlots. + /// maxSlots. + /// motd. + /// players. + /// lastOnline. + /// country. + /// steam. + /// discordServerId. + /// youtubeVideoUrl. + /// tags. + /// commentCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// Gets or Sets GamePort + /// + [DataMember(Name = "game_port", EmitDefaultValue = true)] + public int? GamePort { get; set; } + + /// + /// Gets or Sets QueryPort + /// + [DataMember(Name = "query_port", EmitDefaultValue = false)] + public int QueryPort { get; set; } + + /// + /// Gets or Sets GameId + /// + [DataMember(Name = "game_id", EmitDefaultValue = false)] + public string GameId { get; set; } + + /// + /// Gets or Sets GameIconUrl + /// + [DataMember(Name = "game_icon_url", EmitDefaultValue = true)] + public string GameIconUrl { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", EmitDefaultValue = true)] + public string VarVersion { get; set; } + + /// + /// Gets or Sets Featured + /// + [DataMember(Name = "featured", EmitDefaultValue = true)] + public bool Featured { get; set; } + + /// + /// Gets or Sets ClusterId + /// + [DataMember(Name = "cluster_id", EmitDefaultValue = true)] + public string ClusterId { get; set; } + + /// + /// Gets or Sets WebsiteUrl + /// + [DataMember(Name = "website_url", EmitDefaultValue = true)] + public string WebsiteUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets OwnerId + /// + [DataMember(Name = "owner_id", EmitDefaultValue = true)] + public string OwnerId { get; set; } + + /// + /// Gets or Sets Uptime + /// + [DataMember(Name = "uptime", EmitDefaultValue = false)] + public double Uptime { get; set; } + + /// + /// Gets or Sets Ping + /// + [DataMember(Name = "ping", EmitDefaultValue = true)] + public int? Ping { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name = "map", EmitDefaultValue = true)] + public string Map { get; set; } + + /// + /// Gets or Sets UsedSlots + /// + [DataMember(Name = "used_slots", EmitDefaultValue = true)] + public int? UsedSlots { get; set; } + + /// + /// Gets or Sets MaxSlots + /// + [DataMember(Name = "max_slots", EmitDefaultValue = true)] + public int? MaxSlots { get; set; } + + /// + /// Gets or Sets Motd + /// + [DataMember(Name = "motd", EmitDefaultValue = true)] + public string Motd { get; set; } + + /// + /// Gets or Sets Players + /// + [DataMember(Name = "players", EmitDefaultValue = true)] + public string Players { get; set; } + + /// + /// Gets or Sets LastOnline + /// + [DataMember(Name = "last_online", EmitDefaultValue = true)] + public DateTime? LastOnline { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = true)] + public string Country { get; set; } + + /// + /// Gets or Sets Steam + /// + [DataMember(Name = "steam", EmitDefaultValue = true)] + public bool Steam { get; set; } + + /// + /// Gets or Sets DiscordServerId + /// + [DataMember(Name = "discord_server_id", EmitDefaultValue = true)] + public string DiscordServerId { get; set; } + + /// + /// Gets or Sets YoutubeVideoUrl + /// + [DataMember(Name = "youtube_video_url", EmitDefaultValue = true)] + public string YoutubeVideoUrl { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = true)] + public string Tags { get; set; } + + /// + /// Gets or Sets CommentCount + /// + [DataMember(Name = "comment_count", EmitDefaultValue = false)] + public int CommentCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GameServerCluster.cs b/src/Tribufu.Generated/Model/GameServerCluster.cs new file mode 100644 index 0000000..efc9c40 --- /dev/null +++ b/src/Tribufu.Generated/Model/GameServerCluster.cs @@ -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 +{ + /// + /// GameServerCluster + /// + [DataContract(Name = "GameServerCluster")] + public partial class GameServerCluster : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// description. + /// gameId. + /// websiteUrl. + /// bannerUrl. + /// ownerId. + /// discordServerId. + /// youtubeVideoUrl. + /// tags. + /// commentCount. + /// serverCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets GameId + /// + [DataMember(Name = "game_id", EmitDefaultValue = false)] + public string GameId { get; set; } + + /// + /// Gets or Sets WebsiteUrl + /// + [DataMember(Name = "website_url", EmitDefaultValue = true)] + public string WebsiteUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets OwnerId + /// + [DataMember(Name = "owner_id", EmitDefaultValue = false)] + public string OwnerId { get; set; } + + /// + /// Gets or Sets DiscordServerId + /// + [DataMember(Name = "discord_server_id", EmitDefaultValue = true)] + public string DiscordServerId { get; set; } + + /// + /// Gets or Sets YoutubeVideoUrl + /// + [DataMember(Name = "youtube_video_url", EmitDefaultValue = true)] + public string YoutubeVideoUrl { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = true)] + public string Tags { get; set; } + + /// + /// Gets or Sets CommentCount + /// + [DataMember(Name = "comment_count", EmitDefaultValue = false)] + public int CommentCount { get; set; } + + /// + /// Gets or Sets ServerCount + /// + [DataMember(Name = "server_count", EmitDefaultValue = false)] + public int ServerCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GrantType.cs b/src/Tribufu.Generated/Model/GrantType.cs new file mode 100644 index 0000000..74ecc72 --- /dev/null +++ b/src/Tribufu.Generated/Model/GrantType.cs @@ -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 +{ + /// + /// Defines GrantType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum GrantType + { + /// + /// Enum AuthorizationCode for value: authorization_code + /// + [EnumMember(Value = "authorization_code")] + AuthorizationCode, + + /// + /// Enum ClientCredentials for value: client_credentials + /// + [EnumMember(Value = "client_credentials")] + ClientCredentials, + + /// + /// Enum Password for value: password + /// + [EnumMember(Value = "password")] + Password, + + /// + /// Enum RefreshToken for value: refresh_token + /// + [EnumMember(Value = "refresh_token")] + RefreshToken + } + +} diff --git a/src/Tribufu.Generated/Model/Group.cs b/src/Tribufu.Generated/Model/Group.cs new file mode 100644 index 0000000..45d4b63 --- /dev/null +++ b/src/Tribufu.Generated/Model/Group.cs @@ -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 +{ + /// + /// Group + /// + [DataContract(Name = "Group")] + public partial class Group : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// uuid. + /// name. + /// tag. + /// description. + /// type. + /// privacy. + /// ownerId. + /// verified. + /// photoUrl. + /// bannerUrl. + /// memberCount. + /// followerCount. + /// viewCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Tag + /// + [DataMember(Name = "tag", EmitDefaultValue = true)] + public string Tag { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public int Type { get; set; } + + /// + /// Gets or Sets Privacy + /// + [DataMember(Name = "privacy", EmitDefaultValue = false)] + public int Privacy { get; set; } + + /// + /// Gets or Sets OwnerId + /// + [DataMember(Name = "owner_id", EmitDefaultValue = false)] + public string OwnerId { get; set; } + + /// + /// Gets or Sets Verified + /// + [DataMember(Name = "verified", EmitDefaultValue = true)] + public bool Verified { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets MemberCount + /// + [DataMember(Name = "member_count", EmitDefaultValue = false)] + public int MemberCount { get; set; } + + /// + /// Gets or Sets FollowerCount + /// + [DataMember(Name = "follower_count", EmitDefaultValue = false)] + public int FollowerCount { get; set; } + + /// + /// Gets or Sets ViewCount + /// + [DataMember(Name = "view_count", EmitDefaultValue = false)] + public int ViewCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GroupGame.cs b/src/Tribufu.Generated/Model/GroupGame.cs new file mode 100644 index 0000000..49a4fe7 --- /dev/null +++ b/src/Tribufu.Generated/Model/GroupGame.cs @@ -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 +{ + /// + /// GroupGame + /// + [DataContract(Name = "GroupGame")] + public partial class GroupGame : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// groupId. + /// group. + /// applicationId. + /// application. + /// stats. + /// acquired. + /// lastUsed. + 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; + } + + /// + /// Gets or Sets GroupId + /// + [DataMember(Name = "group_id", EmitDefaultValue = false)] + public string GroupId { get; set; } + + /// + /// Gets or Sets Group + /// + [DataMember(Name = "group", EmitDefaultValue = false)] + public Group Group { get; set; } + + /// + /// Gets or Sets ApplicationId + /// + [DataMember(Name = "application_id", EmitDefaultValue = false)] + public string ApplicationId { get; set; } + + /// + /// Gets or Sets Application + /// + [DataMember(Name = "application", EmitDefaultValue = false)] + public Application Application { get; set; } + + /// + /// Gets or Sets Stats + /// + [DataMember(Name = "stats", EmitDefaultValue = true)] + public Object Stats { get; set; } + + /// + /// Gets or Sets Acquired + /// + [DataMember(Name = "acquired", EmitDefaultValue = false)] + public DateTime Acquired { get; set; } + + /// + /// Gets or Sets LastUsed + /// + [DataMember(Name = "last_used", EmitDefaultValue = true)] + public DateTime? LastUsed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GroupMember.cs b/src/Tribufu.Generated/Model/GroupMember.cs new file mode 100644 index 0000000..77d3e6e --- /dev/null +++ b/src/Tribufu.Generated/Model/GroupMember.cs @@ -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 +{ + /// + /// GroupMember + /// + [DataContract(Name = "GroupMember")] + public partial class GroupMember : IValidatableObject + { + + /// + /// Gets or Sets Rank + /// + [DataMember(Name = "rank", EmitDefaultValue = false)] + public GroupRank? Rank { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// uuid. + /// name. + /// displayName. + /// verified. + /// photoUrl. + /// lastOnline. + /// rank. + /// since. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets DisplayName + /// + [DataMember(Name = "display_name", EmitDefaultValue = true)] + public string DisplayName { get; set; } + + /// + /// Gets or Sets Verified + /// + [DataMember(Name = "verified", EmitDefaultValue = true)] + public bool Verified { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets LastOnline + /// + [DataMember(Name = "last_online", EmitDefaultValue = true)] + public DateTime? LastOnline { get; set; } + + /// + /// Gets or Sets Since + /// + [DataMember(Name = "since", EmitDefaultValue = false)] + public DateTime Since { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/GroupRank.cs b/src/Tribufu.Generated/Model/GroupRank.cs new file mode 100644 index 0000000..4d640b7 --- /dev/null +++ b/src/Tribufu.Generated/Model/GroupRank.cs @@ -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 +{ + /// + /// Defines GroupRank + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum GroupRank + { + /// + /// Enum Member for value: member + /// + [EnumMember(Value = "member")] + Member, + + /// + /// Enum Leader for value: leader + /// + [EnumMember(Value = "leader")] + Leader, + + /// + /// Enum Owner for value: owner + /// + [EnumMember(Value = "owner")] + Owner + } + +} diff --git a/src/Tribufu.Generated/Model/HashViewModel.cs b/src/Tribufu.Generated/Model/HashViewModel.cs new file mode 100644 index 0000000..0043a2e --- /dev/null +++ b/src/Tribufu.Generated/Model/HashViewModel.cs @@ -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 +{ + /// + /// HashViewModel + /// + [DataContract(Name = "HashViewModel")] + public partial class HashViewModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public HashViewModel(string value = default(string)) + { + this.Value = value; + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = true)] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/IntrospectRequest.cs b/src/Tribufu.Generated/Model/IntrospectRequest.cs new file mode 100644 index 0000000..f36ab8f --- /dev/null +++ b/src/Tribufu.Generated/Model/IntrospectRequest.cs @@ -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 +{ + /// + /// IntrospectRequest + /// + [DataContract(Name = "IntrospectRequest")] + public partial class IntrospectRequest : IValidatableObject + { + + /// + /// Gets or Sets TokenTypeHint + /// + [DataMember(Name = "token_type_hint", EmitDefaultValue = false)] + public TokenHintType? TokenTypeHint { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// token. + /// tokenTypeHint. + public IntrospectRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?)) + { + this.Token = token; + this.TokenTypeHint = tokenTypeHint; + } + + /// + /// Gets or Sets Token + /// + [DataMember(Name = "token", EmitDefaultValue = true)] + public string Token { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/IpAddress.cs b/src/Tribufu.Generated/Model/IpAddress.cs new file mode 100644 index 0000000..dfc86bd --- /dev/null +++ b/src/Tribufu.Generated/Model/IpAddress.cs @@ -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 +{ + /// + /// IpAddress + /// + [DataContract(Name = "IpAddress")] + public partial class IpAddress : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// address. + /// varVersion. + /// network. + /// reserved. + /// asn. + /// isp. + /// continent. + /// country. + /// region. + /// city. + /// postalCode. + /// callingCode. + /// tld. + /// language. + /// timezone. + /// currency. + /// latitude. + /// longitude. + 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; + } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", EmitDefaultValue = false)] + public int VarVersion { get; set; } + + /// + /// Gets or Sets Network + /// + [DataMember(Name = "network", EmitDefaultValue = true)] + public string Network { get; set; } + + /// + /// Gets or Sets Reserved + /// + [DataMember(Name = "reserved", EmitDefaultValue = true)] + public bool Reserved { get; set; } + + /// + /// Gets or Sets Asn + /// + [DataMember(Name = "asn", EmitDefaultValue = true)] + public string Asn { get; set; } + + /// + /// Gets or Sets Isp + /// + [DataMember(Name = "isp", EmitDefaultValue = true)] + public string Isp { get; set; } + + /// + /// Gets or Sets Continent + /// + [DataMember(Name = "continent", EmitDefaultValue = true)] + public string Continent { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = true)] + public string Country { get; set; } + + /// + /// Gets or Sets Region + /// + [DataMember(Name = "region", EmitDefaultValue = true)] + public string Region { get; set; } + + /// + /// Gets or Sets City + /// + [DataMember(Name = "city", EmitDefaultValue = true)] + public string City { get; set; } + + /// + /// Gets or Sets PostalCode + /// + [DataMember(Name = "postal_code", EmitDefaultValue = true)] + public string PostalCode { get; set; } + + /// + /// Gets or Sets CallingCode + /// + [DataMember(Name = "calling_code", EmitDefaultValue = true)] + public string CallingCode { get; set; } + + /// + /// Gets or Sets Tld + /// + [DataMember(Name = "tld", EmitDefaultValue = true)] + public string Tld { get; set; } + + /// + /// Gets or Sets Language + /// + [DataMember(Name = "language", EmitDefaultValue = true)] + public string Language { get; set; } + + /// + /// Gets or Sets Timezone + /// + [DataMember(Name = "timezone", EmitDefaultValue = true)] + public string Timezone { get; set; } + + /// + /// Gets or Sets Currency + /// + [DataMember(Name = "currency", EmitDefaultValue = true)] + public string Currency { get; set; } + + /// + /// Gets or Sets Latitude + /// + [DataMember(Name = "latitude", EmitDefaultValue = true)] + public float? Latitude { get; set; } + + /// + /// Gets or Sets Longitude + /// + [DataMember(Name = "longitude", EmitDefaultValue = true)] + public float? Longitude { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/LeaderboardItem.cs b/src/Tribufu.Generated/Model/LeaderboardItem.cs new file mode 100644 index 0000000..4967692 --- /dev/null +++ b/src/Tribufu.Generated/Model/LeaderboardItem.cs @@ -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 +{ + /// + /// LeaderboardItem + /// + [DataContract(Name = "LeaderboardItem")] + public partial class LeaderboardItem : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// displayName. + /// photoUrl. + /// level. + /// experience. + /// points. + 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; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets DisplayName + /// + [DataMember(Name = "display_name", EmitDefaultValue = true)] + public string DisplayName { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets Level + /// + [DataMember(Name = "level", EmitDefaultValue = false)] + public int Level { get; set; } + + /// + /// Gets or Sets Experience + /// + [DataMember(Name = "experience", EmitDefaultValue = false)] + public double Experience { get; set; } + + /// + /// Gets or Sets Points + /// + [DataMember(Name = "points", EmitDefaultValue = false)] + public double Points { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/LeaderboardOrder.cs b/src/Tribufu.Generated/Model/LeaderboardOrder.cs new file mode 100644 index 0000000..1f103f7 --- /dev/null +++ b/src/Tribufu.Generated/Model/LeaderboardOrder.cs @@ -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 +{ + /// + /// Defines LeaderboardOrder + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum LeaderboardOrder + { + /// + /// Enum Level for value: level + /// + [EnumMember(Value = "level")] + Level, + + /// + /// Enum Points for value: points + /// + [EnumMember(Value = "points")] + Points + } + +} diff --git a/src/Tribufu.Generated/Model/LoginProvider.cs b/src/Tribufu.Generated/Model/LoginProvider.cs new file mode 100644 index 0000000..92dfbee --- /dev/null +++ b/src/Tribufu.Generated/Model/LoginProvider.cs @@ -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 +{ + /// + /// Defines LoginProvider + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum LoginProvider + { + /// + /// Enum Steam for value: steam + /// + [EnumMember(Value = "steam")] + Steam, + + /// + /// Enum Epic for value: epic + /// + [EnumMember(Value = "epic")] + Epic, + + /// + /// Enum Discord for value: discord + /// + [EnumMember(Value = "discord")] + Discord, + + /// + /// Enum Microsoft for value: microsoft + /// + [EnumMember(Value = "microsoft")] + Microsoft, + + /// + /// Enum Playstation for value: playstation + /// + [EnumMember(Value = "playstation")] + Playstation, + + /// + /// Enum Google for value: google + /// + [EnumMember(Value = "google")] + Google, + + /// + /// Enum Apple for value: apple + /// + [EnumMember(Value = "apple")] + Apple + } + +} diff --git a/src/Tribufu.Generated/Model/LoginRequest.cs b/src/Tribufu.Generated/Model/LoginRequest.cs new file mode 100644 index 0000000..a464ac3 --- /dev/null +++ b/src/Tribufu.Generated/Model/LoginRequest.cs @@ -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 +{ + /// + /// LoginRequest + /// + [DataContract(Name = "LoginRequest")] + public partial class LoginRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// login. + /// password. + public LoginRequest(string login = default(string), string password = default(string)) + { + this.Login = login; + this.Password = password; + } + + /// + /// Gets or Sets Login + /// + [DataMember(Name = "login", EmitDefaultValue = true)] + public string Login { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/LoginResponse.cs b/src/Tribufu.Generated/Model/LoginResponse.cs new file mode 100644 index 0000000..ae854ce --- /dev/null +++ b/src/Tribufu.Generated/Model/LoginResponse.cs @@ -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 +{ + /// + /// LoginResponse + /// + [DataContract(Name = "LoginResponse")] + public partial class LoginResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// user. + /// accessToken. + /// refreshToken. + /// expiresIn. + 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; + } + + /// + /// Gets or Sets User + /// + [DataMember(Name = "user", EmitDefaultValue = false)] + public UserInfo User { get; set; } + + /// + /// Gets or Sets AccessToken + /// + [DataMember(Name = "access_token", EmitDefaultValue = true)] + public string AccessToken { get; set; } + + /// + /// Gets or Sets RefreshToken + /// + [DataMember(Name = "refresh_token", EmitDefaultValue = true)] + public string RefreshToken { get; set; } + + /// + /// Gets or Sets ExpiresIn + /// + [DataMember(Name = "expires_in", EmitDefaultValue = false)] + public long ExpiresIn { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/Package.cs b/src/Tribufu.Generated/Model/Package.cs new file mode 100644 index 0000000..8c36319 --- /dev/null +++ b/src/Tribufu.Generated/Model/Package.cs @@ -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 +{ + /// + /// Package + /// + [DataContract(Name = "Package")] + public partial class Package : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// description. + /// imageUrl. + /// authorId. + /// varVersion. + /// fileUrl. + /// rawSize. + /// downloadCount. + /// lastDownload. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets ImageUrl + /// + [DataMember(Name = "image_url", EmitDefaultValue = true)] + public string ImageUrl { get; set; } + + /// + /// Gets or Sets AuthorId + /// + [DataMember(Name = "author_id", EmitDefaultValue = false)] + public string AuthorId { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", EmitDefaultValue = true)] + public string VarVersion { get; set; } + + /// + /// Gets or Sets FileUrl + /// + [DataMember(Name = "file_url", EmitDefaultValue = true)] + public string FileUrl { get; set; } + + /// + /// Gets or Sets RawSize + /// + [DataMember(Name = "raw_size", EmitDefaultValue = false)] + public double RawSize { get; set; } + + /// + /// Gets or Sets DownloadCount + /// + [DataMember(Name = "download_count", EmitDefaultValue = false)] + public int DownloadCount { get; set; } + + /// + /// Gets or Sets LastDownload + /// + [DataMember(Name = "last_download", EmitDefaultValue = true)] + public DateTime? LastDownload { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/Profile.cs b/src/Tribufu.Generated/Model/Profile.cs new file mode 100644 index 0000000..adc7828 --- /dev/null +++ b/src/Tribufu.Generated/Model/Profile.cs @@ -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 +{ + /// + /// Profile + /// + [DataContract(Name = "Profile")] + public partial class Profile : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// uuid. + /// name. + /// displayName. + /// verified. + /// level. + /// experience. + /// publicBirthday. + /// birthday. + /// points. + /// location. + /// photoUrl. + /// bannerUrl. + /// lastOnline. + /// biography. + /// viewCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets DisplayName + /// + [DataMember(Name = "display_name", EmitDefaultValue = true)] + public string DisplayName { get; set; } + + /// + /// Gets or Sets Verified + /// + [DataMember(Name = "verified", EmitDefaultValue = true)] + public bool Verified { get; set; } + + /// + /// Gets or Sets Level + /// + [DataMember(Name = "level", EmitDefaultValue = false)] + public int Level { get; set; } + + /// + /// Gets or Sets Experience + /// + [DataMember(Name = "experience", EmitDefaultValue = false)] + public double Experience { get; set; } + + /// + /// Gets or Sets PublicBirthday + /// + [DataMember(Name = "public_birthday", EmitDefaultValue = true)] + public bool PublicBirthday { get; set; } + + /// + /// Gets or Sets Birthday + /// + [DataMember(Name = "birthday", EmitDefaultValue = true)] + public DateOnly? Birthday { get; set; } + + /// + /// Gets or Sets Points + /// + [DataMember(Name = "points", EmitDefaultValue = false)] + public double Points { get; set; } + + /// + /// Gets or Sets Location + /// + [DataMember(Name = "location", EmitDefaultValue = true)] + public string Location { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets LastOnline + /// + [DataMember(Name = "last_online", EmitDefaultValue = true)] + public DateTime? LastOnline { get; set; } + + /// + /// Gets or Sets Biography + /// + [DataMember(Name = "biography", EmitDefaultValue = true)] + public string Biography { get; set; } + + /// + /// Gets or Sets ViewCount + /// + [DataMember(Name = "view_count", EmitDefaultValue = false)] + public int ViewCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/ProfileGame.cs b/src/Tribufu.Generated/Model/ProfileGame.cs new file mode 100644 index 0000000..fd9519d --- /dev/null +++ b/src/Tribufu.Generated/Model/ProfileGame.cs @@ -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 +{ + /// + /// ProfileGame + /// + [DataContract(Name = "ProfileGame")] + public partial class ProfileGame : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// capsuleImageUrl. + /// libraryImageUrl. + /// slug. + /// timeUsed. + /// unlockedAchievements. + /// totalAchievements. + /// stats. + /// acquired. + /// lastUsed. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets CapsuleImageUrl + /// + [DataMember(Name = "capsule_image_url", EmitDefaultValue = true)] + public string CapsuleImageUrl { get; set; } + + /// + /// Gets or Sets LibraryImageUrl + /// + [DataMember(Name = "library_image_url", EmitDefaultValue = true)] + public string LibraryImageUrl { get; set; } + + /// + /// Gets or Sets Slug + /// + [DataMember(Name = "slug", EmitDefaultValue = true)] + public string Slug { get; set; } + + /// + /// Gets or Sets TimeUsed + /// + [DataMember(Name = "time_used", EmitDefaultValue = false)] + public double TimeUsed { get; set; } + + /// + /// Gets or Sets UnlockedAchievements + /// + [DataMember(Name = "unlocked_achievements", EmitDefaultValue = false)] + public int UnlockedAchievements { get; set; } + + /// + /// Gets or Sets TotalAchievements + /// + [DataMember(Name = "total_achievements", EmitDefaultValue = false)] + public int TotalAchievements { get; set; } + + /// + /// Gets or Sets Stats + /// + [DataMember(Name = "stats", EmitDefaultValue = true)] + public Object Stats { get; set; } + + /// + /// Gets or Sets Acquired + /// + [DataMember(Name = "acquired", EmitDefaultValue = false)] + public DateTime Acquired { get; set; } + + /// + /// Gets or Sets LastUsed + /// + [DataMember(Name = "last_used", EmitDefaultValue = true)] + public DateTime? LastUsed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/ProfileGroup.cs b/src/Tribufu.Generated/Model/ProfileGroup.cs new file mode 100644 index 0000000..6574720 --- /dev/null +++ b/src/Tribufu.Generated/Model/ProfileGroup.cs @@ -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 +{ + /// + /// ProfileGroup + /// + [DataContract(Name = "ProfileGroup")] + public partial class ProfileGroup : IValidatableObject + { + + /// + /// Gets or Sets Rank + /// + [DataMember(Name = "rank", EmitDefaultValue = false)] + public GroupRank? Rank { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// uuid. + /// name. + /// tag. + /// privacy. + /// verified. + /// photoUrl. + /// memberCount. + /// rank. + /// since. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Tag + /// + [DataMember(Name = "tag", EmitDefaultValue = true)] + public string Tag { get; set; } + + /// + /// Gets or Sets Privacy + /// + [DataMember(Name = "privacy", EmitDefaultValue = false)] + public int Privacy { get; set; } + + /// + /// Gets or Sets Verified + /// + [DataMember(Name = "verified", EmitDefaultValue = true)] + public bool Verified { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets MemberCount + /// + [DataMember(Name = "member_count", EmitDefaultValue = false)] + public int MemberCount { get; set; } + + /// + /// Gets or Sets Since + /// + [DataMember(Name = "since", EmitDefaultValue = false)] + public DateTime Since { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/RefreshRequest.cs b/src/Tribufu.Generated/Model/RefreshRequest.cs new file mode 100644 index 0000000..231dbbc --- /dev/null +++ b/src/Tribufu.Generated/Model/RefreshRequest.cs @@ -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 +{ + /// + /// RefreshRequest + /// + [DataContract(Name = "RefreshRequest")] + public partial class RefreshRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// refreshToken. + public RefreshRequest(string refreshToken = default(string)) + { + this.RefreshToken = refreshToken; + } + + /// + /// Gets or Sets RefreshToken + /// + [DataMember(Name = "refresh_token", EmitDefaultValue = true)] + public string RefreshToken { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/RegisterRequest.cs b/src/Tribufu.Generated/Model/RegisterRequest.cs new file mode 100644 index 0000000..14d095d --- /dev/null +++ b/src/Tribufu.Generated/Model/RegisterRequest.cs @@ -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 +{ + /// + /// RegisterRequest + /// + [DataContract(Name = "RegisterRequest")] + public partial class RegisterRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected RegisterRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// name (required). + /// email. + /// password (required). + 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; + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = true)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = true)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/ResponseType.cs b/src/Tribufu.Generated/Model/ResponseType.cs new file mode 100644 index 0000000..0d3ccff --- /dev/null +++ b/src/Tribufu.Generated/Model/ResponseType.cs @@ -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 +{ + /// + /// Defines ResponseType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResponseType + { + /// + /// Enum Code for value: code + /// + [EnumMember(Value = "code")] + Code, + + /// + /// Enum Token for value: token + /// + [EnumMember(Value = "token")] + Token + } + +} diff --git a/src/Tribufu.Generated/Model/RevokeRequest.cs b/src/Tribufu.Generated/Model/RevokeRequest.cs new file mode 100644 index 0000000..75cf6ea --- /dev/null +++ b/src/Tribufu.Generated/Model/RevokeRequest.cs @@ -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 +{ + /// + /// RevokeRequest + /// + [DataContract(Name = "RevokeRequest")] + public partial class RevokeRequest : IValidatableObject + { + + /// + /// Gets or Sets TokenTypeHint + /// + [DataMember(Name = "token_type_hint", EmitDefaultValue = false)] + public TokenHintType? TokenTypeHint { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// token. + /// tokenTypeHint. + public RevokeRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?)) + { + this.Token = token; + this.TokenTypeHint = tokenTypeHint; + } + + /// + /// Gets or Sets Token + /// + [DataMember(Name = "token", EmitDefaultValue = true)] + public string Token { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/SearchRequest.cs b/src/Tribufu.Generated/Model/SearchRequest.cs new file mode 100644 index 0000000..a97dbae --- /dev/null +++ b/src/Tribufu.Generated/Model/SearchRequest.cs @@ -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 +{ + /// + /// SearchRequest + /// + [DataContract(Name = "SearchRequest")] + public partial class SearchRequest : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public SearchType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// query. + /// page. + /// gameId. + 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; + } + + /// + /// Gets or Sets Query + /// + [DataMember(Name = "query", EmitDefaultValue = true)] + public string Query { get; set; } + + /// + /// Gets or Sets Page + /// + [DataMember(Name = "page", EmitDefaultValue = true)] + public int? Page { get; set; } + + /// + /// Gets or Sets GameId + /// + [DataMember(Name = "game_id", EmitDefaultValue = true)] + public string GameId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/SearchType.cs b/src/Tribufu.Generated/Model/SearchType.cs new file mode 100644 index 0000000..c72bb3e --- /dev/null +++ b/src/Tribufu.Generated/Model/SearchType.cs @@ -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 +{ + /// + /// Defines SearchType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SearchType + { + /// + /// Enum User for value: user + /// + [EnumMember(Value = "user")] + User, + + /// + /// Enum Group for value: group + /// + [EnumMember(Value = "group")] + Group, + + /// + /// Enum Server for value: server + /// + [EnumMember(Value = "server")] + Server, + + /// + /// Enum Cluster for value: cluster + /// + [EnumMember(Value = "cluster")] + Cluster + } + +} diff --git a/src/Tribufu.Generated/Model/ServerMetrics.cs b/src/Tribufu.Generated/Model/ServerMetrics.cs new file mode 100644 index 0000000..6d63a58 --- /dev/null +++ b/src/Tribufu.Generated/Model/ServerMetrics.cs @@ -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 +{ + /// + /// ServerMetrics + /// + [DataContract(Name = "ServerMetrics")] + public partial class ServerMetrics : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// serverCount. + /// packageCount. + /// countryCount. + public ServerMetrics(int serverCount = default(int), int packageCount = default(int), int countryCount = default(int)) + { + this.ServerCount = serverCount; + this.PackageCount = packageCount; + this.CountryCount = countryCount; + } + + /// + /// Gets or Sets ServerCount + /// + [DataMember(Name = "server_count", EmitDefaultValue = false)] + public int ServerCount { get; set; } + + /// + /// Gets or Sets PackageCount + /// + [DataMember(Name = "package_count", EmitDefaultValue = false)] + public int PackageCount { get; set; } + + /// + /// Gets or Sets CountryCount + /// + [DataMember(Name = "country_count", EmitDefaultValue = false)] + public int CountryCount { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/ServerStatus.cs b/src/Tribufu.Generated/Model/ServerStatus.cs new file mode 100644 index 0000000..aa7b037 --- /dev/null +++ b/src/Tribufu.Generated/Model/ServerStatus.cs @@ -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 +{ + /// + /// Defines ServerStatus + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ServerStatus + { + /// + /// Enum Unknown for value: unknown + /// + [EnumMember(Value = "unknown")] + Unknown, + + /// + /// Enum Offline for value: offline + /// + [EnumMember(Value = "offline")] + Offline, + + /// + /// Enum Online for value: online + /// + [EnumMember(Value = "online")] + Online + } + +} diff --git a/src/Tribufu.Generated/Model/Subscription.cs b/src/Tribufu.Generated/Model/Subscription.cs new file mode 100644 index 0000000..2bafbfe --- /dev/null +++ b/src/Tribufu.Generated/Model/Subscription.cs @@ -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 +{ + /// + /// Subscription + /// + [DataContract(Name = "Subscription")] + public partial class Subscription : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + /// description. + /// imageUrl. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets ImageUrl + /// + [DataMember(Name = "image_url", EmitDefaultValue = true)] + public string ImageUrl { get; set; } + + /// + /// Gets or Sets Prices + /// + [DataMember(Name = "prices", EmitDefaultValue = true)] + public Dictionary Prices { get; private set; } + + /// + /// Returns false as Prices should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializePrices() + { + return false; + } + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable 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; + } + } + +} diff --git a/src/Tribufu.Generated/Model/TokenHintType.cs b/src/Tribufu.Generated/Model/TokenHintType.cs new file mode 100644 index 0000000..ff19eec --- /dev/null +++ b/src/Tribufu.Generated/Model/TokenHintType.cs @@ -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 +{ + /// + /// Defines TokenHintType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TokenHintType + { + /// + /// Enum AccessToken for value: access_token + /// + [EnumMember(Value = "access_token")] + AccessToken, + + /// + /// Enum RefreshToken for value: refresh_token + /// + [EnumMember(Value = "refresh_token")] + RefreshToken + } + +} diff --git a/src/Tribufu.Generated/Model/TokenRequest.cs b/src/Tribufu.Generated/Model/TokenRequest.cs new file mode 100644 index 0000000..4b686c8 --- /dev/null +++ b/src/Tribufu.Generated/Model/TokenRequest.cs @@ -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 +{ + /// + /// TokenRequest + /// + [DataContract(Name = "TokenRequest")] + public partial class TokenRequest : IValidatableObject + { + + /// + /// Gets or Sets GrantType + /// + [DataMember(Name = "grant_type", EmitDefaultValue = false)] + public GrantType? GrantType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// grantType. + /// code. + /// username. + /// password. + /// refreshToken. + /// clientId. + /// redirectUri. + /// codeVerifier. + 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; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = true)] + public string Code { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = true)] + public string Username { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Gets or Sets RefreshToken + /// + [DataMember(Name = "refresh_token", EmitDefaultValue = true)] + public string RefreshToken { get; set; } + + /// + /// Gets or Sets ClientId + /// + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Gets or Sets RedirectUri + /// + [DataMember(Name = "redirect_uri", EmitDefaultValue = true)] + public string RedirectUri { get; set; } + + /// + /// Gets or Sets CodeVerifier + /// + [DataMember(Name = "code_verifier", EmitDefaultValue = true)] + public string CodeVerifier { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/TokenResponse.cs b/src/Tribufu.Generated/Model/TokenResponse.cs new file mode 100644 index 0000000..c9f475f --- /dev/null +++ b/src/Tribufu.Generated/Model/TokenResponse.cs @@ -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 +{ + /// + /// TokenResponse + /// + [DataContract(Name = "TokenResponse")] + public partial class TokenResponse : IValidatableObject + { + + /// + /// Gets or Sets TokenType + /// + [DataMember(Name = "token_type", EmitDefaultValue = false)] + public TokenType? TokenType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// tokenType. + /// accessToken. + /// refreshToken. + /// scope. + /// state. + /// expiresIn. + 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; + } + + /// + /// Gets or Sets AccessToken + /// + [DataMember(Name = "access_token", EmitDefaultValue = true)] + public string AccessToken { get; set; } + + /// + /// Gets or Sets RefreshToken + /// + [DataMember(Name = "refresh_token", EmitDefaultValue = true)] + public string RefreshToken { get; set; } + + /// + /// Gets or Sets Scope + /// + [DataMember(Name = "scope", EmitDefaultValue = true)] + public string Scope { get; set; } + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", EmitDefaultValue = true)] + public string State { get; set; } + + /// + /// Gets or Sets ExpiresIn + /// + [DataMember(Name = "expires_in", EmitDefaultValue = false)] + public long ExpiresIn { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/TokenType.cs b/src/Tribufu.Generated/Model/TokenType.cs new file mode 100644 index 0000000..b89cd3c --- /dev/null +++ b/src/Tribufu.Generated/Model/TokenType.cs @@ -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 +{ + /// + /// Defines TokenType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TokenType + { + /// + /// Enum Bearer for value: bearer + /// + [EnumMember(Value = "bearer")] + Bearer + } + +} diff --git a/src/Tribufu.Generated/Model/UpdateProfile.cs b/src/Tribufu.Generated/Model/UpdateProfile.cs new file mode 100644 index 0000000..4fbe86a --- /dev/null +++ b/src/Tribufu.Generated/Model/UpdateProfile.cs @@ -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 +{ + /// + /// UpdateProfile + /// + [DataContract(Name = "UpdateProfile")] + public partial class UpdateProfile : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// displayName. + /// biography. + public UpdateProfile(string displayName = default(string), string biography = default(string)) + { + this.DisplayName = displayName; + this.Biography = biography; + } + + /// + /// Gets or Sets DisplayName + /// + [DataMember(Name = "display_name", EmitDefaultValue = true)] + public string DisplayName { get; set; } + + /// + /// Gets or Sets Biography + /// + [DataMember(Name = "biography", EmitDefaultValue = true)] + public string Biography { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/UserInfo.cs b/src/Tribufu.Generated/Model/UserInfo.cs new file mode 100644 index 0000000..66fb2f8 --- /dev/null +++ b/src/Tribufu.Generated/Model/UserInfo.cs @@ -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 +{ + /// + /// UserInfo + /// + [DataContract(Name = "UserInfo")] + public partial class UserInfo : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public UserType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// uuid. + /// name. + /// displayName. + /// email. + /// type. + /// flags. + /// permissions. + /// verified. + /// level. + /// experience. + /// publicBirthday. + /// birthday. + /// points. + /// location. + /// language. + /// timezone. + /// currency. + /// photoUrl. + /// bannerUrl. + /// lastOnline. + /// biography. + /// viewCount. + /// created. + /// updated. + 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; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets DisplayName + /// + [DataMember(Name = "display_name", EmitDefaultValue = true)] + public string DisplayName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = true)] + public string Email { get; set; } + + /// + /// Gets or Sets Flags + /// + [DataMember(Name = "flags", EmitDefaultValue = false)] + public string Flags { get; set; } + + /// + /// Gets or Sets Permissions + /// + [DataMember(Name = "permissions", EmitDefaultValue = false)] + public string Permissions { get; set; } + + /// + /// Gets or Sets Verified + /// + [DataMember(Name = "verified", EmitDefaultValue = true)] + public bool Verified { get; set; } + + /// + /// Gets or Sets Level + /// + [DataMember(Name = "level", EmitDefaultValue = false)] + public int Level { get; set; } + + /// + /// Gets or Sets Experience + /// + [DataMember(Name = "experience", EmitDefaultValue = false)] + public double Experience { get; set; } + + /// + /// Gets or Sets PublicBirthday + /// + [DataMember(Name = "public_birthday", EmitDefaultValue = true)] + public bool PublicBirthday { get; set; } + + /// + /// Gets or Sets Birthday + /// + [DataMember(Name = "birthday", EmitDefaultValue = true)] + public DateOnly? Birthday { get; set; } + + /// + /// Gets or Sets Points + /// + [DataMember(Name = "points", EmitDefaultValue = false)] + public double Points { get; set; } + + /// + /// Gets or Sets Location + /// + [DataMember(Name = "location", EmitDefaultValue = true)] + public string Location { get; set; } + + /// + /// Gets or Sets Language + /// + [DataMember(Name = "language", EmitDefaultValue = true)] + public string Language { get; set; } + + /// + /// Gets or Sets Timezone + /// + [DataMember(Name = "timezone", EmitDefaultValue = true)] + public string Timezone { get; set; } + + /// + /// Gets or Sets Currency + /// + [DataMember(Name = "currency", EmitDefaultValue = true)] + public string Currency { get; set; } + + /// + /// Gets or Sets PhotoUrl + /// + [DataMember(Name = "photo_url", EmitDefaultValue = true)] + public string PhotoUrl { get; set; } + + /// + /// Gets or Sets BannerUrl + /// + [DataMember(Name = "banner_url", EmitDefaultValue = true)] + public string BannerUrl { get; set; } + + /// + /// Gets or Sets LastOnline + /// + [DataMember(Name = "last_online", EmitDefaultValue = true)] + public DateTime? LastOnline { get; set; } + + /// + /// Gets or Sets Biography + /// + [DataMember(Name = "biography", EmitDefaultValue = true)] + public string Biography { get; set; } + + /// + /// Gets or Sets ViewCount + /// + [DataMember(Name = "view_count", EmitDefaultValue = false)] + public int ViewCount { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = true)] + public DateTime? Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Tribufu.Generated/Model/UserType.cs b/src/Tribufu.Generated/Model/UserType.cs new file mode 100644 index 0000000..7c74db6 --- /dev/null +++ b/src/Tribufu.Generated/Model/UserType.cs @@ -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 +{ + /// + /// Defines UserType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum UserType + { + /// + /// Enum User for value: user + /// + [EnumMember(Value = "user")] + User, + + /// + /// Enum Bot for value: bot + /// + [EnumMember(Value = "bot")] + Bot + } + +} diff --git a/src/Tribufu.Native/README.md b/src/Tribufu.Generated/README.md similarity index 100% rename from src/Tribufu.Native/README.md rename to src/Tribufu.Generated/README.md diff --git a/src/Tribufu.Generated/Tribufu.Generated.csproj b/src/Tribufu.Generated/Tribufu.Generated.csproj new file mode 100644 index 0000000..2defe9f --- /dev/null +++ b/src/Tribufu.Generated/Tribufu.Generated.csproj @@ -0,0 +1,27 @@ + + + Tribufu.Generated + Tribufu .NET SDK + README.md + + + Properties + true + true + enable + annotations + Library + net6.0 + + + + + + + + + + + + + diff --git a/src/Tribufu.Native/Tribufu.Native.csproj b/src/Tribufu.Native/Tribufu.Native.csproj deleted file mode 100644 index 948bb44..0000000 --- a/src/Tribufu.Native/Tribufu.Native.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - Tribufu.Native - Tribufu Native Interop - README.md - - - Library - Properties - netstandard2.0;net45;net5.0 - true - - - - - - - - - - diff --git a/src/Tribufu.Native/TribufuNative.cs b/src/Tribufu.Native/TribufuNative.cs deleted file mode 100644 index d17a9ff..0000000 --- a/src/Tribufu.Native/TribufuNative.cs +++ /dev/null @@ -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(); - } -} diff --git a/src/Tribufu/Tribufu.csproj b/src/Tribufu/Tribufu.csproj index 386d19f..39dc5af 100644 --- a/src/Tribufu/Tribufu.csproj +++ b/src/Tribufu/Tribufu.csproj @@ -1,24 +1,22 @@ - + Tribufu Tribufu .NET SDK README.md - Library Properties - netstandard2.0;net45;net5.0 + true true + enable + annotations + Library + net6.0 - - - - - - + diff --git a/src/Tribufu/TribufuApi.cs b/src/Tribufu/TribufuApi.cs index d0be776..d0a97eb 100644 --- a/src/Tribufu/TribufuApi.cs +++ b/src/Tribufu/TribufuApi.cs @@ -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 + /// + /// Tribufu API + /// + /// + /// Use this class to interact with the Tribufu API. + /// + public class TribufuApi : TribufuGeneratedApi { - public TribufuApi(TribufuApiOptions options) : base(options.BaseUrl, new HttpClient()) + /// + /// The default base URL for the Tribufu API. + /// + public const string DefaultBaseUrl = "https://api.tribufu.com"; + + /// + /// Create a with the default options. + /// + /// instance with default configuration + public TribufuApi() : this(string.Empty) { } + + /// + /// Create a with the given API key. + /// + /// + /// A API key gives you public read only access to the Tribufu API. + /// + /// The API key for authentication + /// instance configured with the API key + public TribufuApi(string apiKey) : base(CreateConfiguration(apiKey)) + { + } + + /// + /// Create a TribufuApi with the default options. + /// + /// TribufuApi instance with default configuration + public static TribufuApi Default() + { + return new TribufuApi(); + } + + /// + /// Create a with the given API key. + /// + /// + /// A API key gives you public read only access to the Tribufu API. + /// + /// The API key for authentication + /// instance configured with the API key + public static TribufuApi WithApiKey(string apiKey) + { + return new TribufuApi(apiKey); + } + + /// + /// Try to create a from environment variables. + /// + /// + /// This will only work if the environment variables are set. + /// + /// A prefix for the environment variables. Default is "TRIBUFU". + /// instance or null if environment variables not set + /// + /// // Environment variable TRIBUFU_API_KEY must be set + /// var api = TribufuApi.FromEnv(); + /// + 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; + } + + /// + /// Create a from environment variables or the default API. + /// + /// + /// This will fallback to the default API if the environment variables are not set. + /// + /// A prefix for the environment variables. Default is "TRIBUFU". + /// instance + /// + /// // Environment variable TRIBUFU_API_KEY might be unset + /// var api = TribufuApi.FromEnvOrDefault(); + /// + public static TribufuApi FromEnvOrDefault(string prefix = "TRIBUFU") + { + return FromEnv(prefix) ?? Default(); + } + + /// + /// Gets the version of the Tribufu API client. + /// + public static string GetVersion() + { + var version = typeof(TribufuApi).Assembly.GetName().Version; + return $"{version?.Major}.{version?.Minor}.{version?.Build}"; + } + + /// + /// Gets the user agent string for the Tribufu API client. + /// + private static string GetUserAgent() + { + var version = GetVersion(); + var frameworkDescription = RuntimeInformation.FrameworkDescription.Trim(); + var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier.Trim(); + return $"Tribufu/{version} ({frameworkDescription}; {runtimeIdentifier})"; + } + + /// + /// Get the base URL for the Tribufu API. + /// + /// + /// 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. + /// + /// Base URL string + private static string GetBaseUrl() + { + var baseUrl = Environment.GetEnvironmentVariable("TRIBUFU_API_URL"); + + if (DebugEnabled() && !string.IsNullOrEmpty(baseUrl)) + { + return baseUrl; + } + + return DefaultBaseUrl; + } + + /// + /// Checks if debug mode is enabled. + /// + /// True if debug mode is enabled, otherwise false + private static bool DebugEnabled() + { +#if DEBUG + return true; +#else + return false; +#endif + } + + /// + /// Creates a configuration for the Tribufu API client. + /// + 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; + } } } diff --git a/src/Tribufu/TribufuApi.generated.cs b/src/Tribufu/TribufuApi.generated.cs deleted file mode 100644 index b0e4686..0000000 --- a/src/Tribufu/TribufuApi.generated.cs +++ /dev/null @@ -1,5889 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" -#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" -#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" -#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" -#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" -#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." - -namespace Tribufu -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TribufuApiGenerated - { -#pragma warning disable 8618 - private string _baseUrl; -#pragma warning restore 8618 - - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - public TribufuApiGenerated(string baseUrl, System.Net.Http.HttpClient httpClient) -#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - { - BaseUrl = baseUrl; - _httpClient = httpClient; - Initialize(); - } - - private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set - { - _baseUrl = value; - if (!string.IsNullOrEmpty(_baseUrl) && !_baseUrl.EndsWith("/")) - _baseUrl += '/'; - } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - partial void Initialize(); - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get current user information. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/me" - urlBuilder_.Append("v1/me"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Login with name or email and password. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task LoginAsync(LoginRequest body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/login" - urlBuilder_.Append("v1/login"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new user. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RegisterAsync(RegisterRequest body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/register" - urlBuilder_.Append("v1/register"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Refresh credentials. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RefreshAsync(RefreshRequest body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/refresh" - urlBuilder_.Append("v1/refresh"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Invalidate credentials. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task LogoutAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/logout" - urlBuilder_.Append("v1/logout"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of game server clusters. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetClustersAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/clusters" - urlBuilder_.Append("v1/clusters"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new game server cluster. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateClusterAsync(object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/clusters" - urlBuilder_.Append("v1/clusters"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a game server cluster by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetClusterGetByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/clusters/{id}" - urlBuilder_.Append("v1/clusters/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update a game server cluster. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateClusterAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/clusters/{id}" - urlBuilder_.Append("v1/clusters/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete a game server cluster. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteClusterAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/clusters/{id}" - urlBuilder_.Append("v1/clusters/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of files. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetFilesAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/files" - urlBuilder_.Append("v1/files"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a file by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetFileByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/files/{id}" - urlBuilder_.Append("v1/files/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of games. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGamesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/games" - urlBuilder_.Append("v1/games"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a game by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGameByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/games/{id}" - urlBuilder_.Append("v1/games/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of game servers of a game. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGameServersAsync(string id, int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/games/{id}/servers" - urlBuilder_.Append("v1/games/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/servers"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of game server clusters of a game. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGameClustersAsync(string id, int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/games/{id}/clusters" - urlBuilder_.Append("v1/games/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/clusters"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of groups. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGroupsAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups" - urlBuilder_.Append("v1/groups"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new group. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateGroupAsync(object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups" - urlBuilder_.Append("v1/groups"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a group by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGroupByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/{id}" - urlBuilder_.Append("v1/groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update a group. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateGroupAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/{id}" - urlBuilder_.Append("v1/groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete a group. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteGroupAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/{id}" - urlBuilder_.Append("v1/groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a group by uuid. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGroupByUuidAsync(System.Guid uuid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (uuid == null) - throw new System.ArgumentNullException("uuid"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/uuid/{uuid}" - urlBuilder_.Append("v1/groups/uuid/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(uuid, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a group by tag. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGroupByTagAsync(string tag, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (tag == null) - throw new System.ArgumentNullException("tag"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/tag/{tag}" - urlBuilder_.Append("v1/groups/tag/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of members in a group. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGroupMembersAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/{id}/members" - urlBuilder_.Append("v1/groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/members"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of games of a group. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGroupGamesAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/groups/{id}/games" - urlBuilder_.Append("v1/groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/games"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get the top 20 leaderboard users. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetLeaderboardAsync(LeaderboardOrder? order = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/leaderboard" - urlBuilder_.Append("v1/leaderboard"); - urlBuilder_.Append('?'); - if (order != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("Order")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(order, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Advanced search for servers or players. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> SearchAsync(SearchRequest body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/search" - urlBuilder_.Append("v1/search"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of game servers. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetServersAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers" - urlBuilder_.Append("v1/servers"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new game server. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateServerAsync(object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers" - urlBuilder_.Append("v1/servers"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a game server by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetServerByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/{id}" - urlBuilder_.Append("v1/servers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update a game server. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateServerAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/{id}" - urlBuilder_.Append("v1/servers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete a game server. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteServerAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/{id}" - urlBuilder_.Append("v1/servers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a game server by address and query port. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetServerByAddressAndQueryPortAsync(string address, int port, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (address == null) - throw new System.ArgumentNullException("address"); - - if (port == null) - throw new System.ArgumentNullException("port"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/address/{address}:{port}" - urlBuilder_.Append("v1/servers/address/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append(':'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(port, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of game servers from a country. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetServersByCountryAsync(string country, int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (country == null) - throw new System.ArgumentNullException("country"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/country/{country}" - urlBuilder_.Append("v1/servers/country/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(country, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Claim a game server. - /// - /// - /// This endpoint is not available with an api key, only with a bearer token. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ClaimServerAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/{id}/claim" - urlBuilder_.Append("v1/servers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/claim"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get metrics about the tracked game servers. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetServersMetricsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/metrics" - urlBuilder_.Append("v1/servers/metrics"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of countries with the number of game servers. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetServersCountriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/servers/countries" - urlBuilder_.Append("v1/servers/countries"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of subscriptions. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetSubscriptionsAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/subscriptions" - urlBuilder_.Append("v1/subscriptions"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a subscription by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSubscriptionByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/subscriptions/{id}" - urlBuilder_.Append("v1/subscriptions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of user profiles. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUsersAsync(int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users" - urlBuilder_.Append("v1/users"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a user profile by id. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserByIdAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a user profile by uuid. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserByUuidAsync(System.Guid uuid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (uuid == null) - throw new System.ArgumentNullException("uuid"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/uuid/{uuid}" - urlBuilder_.Append("v1/users/uuid/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(uuid, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a user profile by name. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserByNameAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/name/{name}" - urlBuilder_.Append("v1/users/name/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of groups the user is a member of. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserGroupsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/groups" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/groups"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of games the user has played. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserGamesAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/games" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/games"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of friends of the user. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserFriendsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/friends" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/friends"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of servers the user is owner of. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserServersAsync(string id, int? page = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/servers" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/servers"); - urlBuilder_.Append('?'); - if (page != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("page")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(page, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of connected accounts of the user. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserAccountsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/accounts" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/accounts"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get a list of punishments the user has received. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUserPunishmentsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/punishments" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/punishments"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update a user profile. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserProfileAsync(string id, UpdateProfile body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/profile" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/profile"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Change the email of a user. - /// - /// - /// This endpoint is not available with an api key, only with a bearer token. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChangeEmailAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/email" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/email"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Change the password of a user. - /// - /// - /// This endpoint is not available with an api key, only with a bearer token. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChangePasswordAsync(string id, object body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/users/{id}/password" - urlBuilder_.Append("v1/users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/password"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Generate a random password. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GeneratePasswordAsync(int? length = null, bool? symbols = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/password" - urlBuilder_.Append("v1/utils/password"); - urlBuilder_.Append('?'); - if (length != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("length")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(length, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (symbols != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("symbols")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(symbols, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Generate one or more flake ids. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GenerateFlakeIdAsync(int? amount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/flake" - urlBuilder_.Append("v1/utils/flake"); - urlBuilder_.Append('?'); - if (amount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("amount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Generate one or more uuids with a specific version. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GenerateUuidAsync(int? version = null, int? amount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/uuid" - urlBuilder_.Append("v1/utils/uuid"); - urlBuilder_.Append('?'); - if (version != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("version")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (amount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("amount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Convert a string to base64 or vice versa. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ConvertBase64Async(CryptoViewModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/base64" - urlBuilder_.Append("v1/utils/base64"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Hash a string using md5. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HashMd5Async(HashViewModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/md5" - urlBuilder_.Append("v1/utils/md5"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Hash a string using sha256. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HashSha256Async(HashViewModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/sha256" - urlBuilder_.Append("v1/utils/sha256"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Hash a string using bcrypt. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HashBcryptAsync(HashViewModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/bcrypt" - urlBuilder_.Append("v1/utils/bcrypt"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Hash a string using argon2. - /// - /// OK - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HashArgon2Async(HashViewModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); - var content_ = new System.Net.Http.StringContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json-patch+json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); - // Operation Path: "v1/utils/argon2" - urlBuilder_.Append("v1/utils/argon2"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TribufuApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TribufuApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new TribufuApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new TribufuApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[])value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Account - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("provider", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public LoginProvider Provider { get; set; } - - [Newtonsoft.Json.JsonProperty("user_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string User_id { get; set; } - - [Newtonsoft.Json.JsonProperty("authorized", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Authorized { get; set; } - - [Newtonsoft.Json.JsonProperty("fields", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Fields { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CryptoViewModel - { - [Newtonsoft.Json.JsonProperty("encoded", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Encoded { get; set; } - - [Newtonsoft.Json.JsonProperty("decoded", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Decoded { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class File - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("author_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Author_id { get; set; } - - [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Version { get; set; } - - [Newtonsoft.Json.JsonProperty("file_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string File_url { get; set; } - - [Newtonsoft.Json.JsonProperty("raw_size", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Raw_size { get; set; } - - [Newtonsoft.Json.JsonProperty("download_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Download_count { get; set; } - - [Newtonsoft.Json.JsonProperty("last_download", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_download { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Game - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Type { get; set; } - - [Newtonsoft.Json.JsonProperty("organization_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Organization_id { get; set; } - - [Newtonsoft.Json.JsonProperty("icon_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Icon_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("capsule_image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Capsule_image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("library_image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Library_image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("parent_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Parent_id { get; set; } - - [Newtonsoft.Json.JsonProperty("slug", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Slug { get; set; } - - [Newtonsoft.Json.JsonProperty("visibility", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Visibility { get; set; } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Password { get; set; } - - [Newtonsoft.Json.JsonProperty("primary", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Primary { get; set; } - - [Newtonsoft.Json.JsonProperty("game_port", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Game_port { get; set; } - - [Newtonsoft.Json.JsonProperty("query_port", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Query_port { get; set; } - - [Newtonsoft.Json.JsonProperty("rcon_port", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Rcon_port { get; set; } - - [Newtonsoft.Json.JsonProperty("user_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int User_count { get; set; } - - [Newtonsoft.Json.JsonProperty("server_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Server_count { get; set; } - - [Newtonsoft.Json.JsonProperty("achievement_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Achievement_count { get; set; } - - [Newtonsoft.Json.JsonProperty("badge_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Badge_count { get; set; } - - [Newtonsoft.Json.JsonProperty("download_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Download_count { get; set; } - - [Newtonsoft.Json.JsonProperty("steam_app_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Steam_app_id { get; set; } - - [Newtonsoft.Json.JsonProperty("steam_server_app_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Steam_server_app_id { get; set; } - - [Newtonsoft.Json.JsonProperty("enable_servers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Enable_servers { get; set; } - - [Newtonsoft.Json.JsonProperty("rust_gamedig_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Rust_gamedig_id { get; set; } - - [Newtonsoft.Json.JsonProperty("node_gamedig_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Node_gamedig_id { get; set; } - - [Newtonsoft.Json.JsonProperty("server_connect_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Server_connect_url { get; set; } - - [Newtonsoft.Json.JsonProperty("server_tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Server_tags { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GameServer - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("address", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Address { get; set; } - - [Newtonsoft.Json.JsonProperty("game_port", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Game_port { get; set; } - - [Newtonsoft.Json.JsonProperty("query_port", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Query_port { get; set; } - - [Newtonsoft.Json.JsonProperty("game_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Game_id { get; set; } - - [Newtonsoft.Json.JsonProperty("game_icon_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Game_icon_url { get; set; } - - [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Version { get; set; } - - [Newtonsoft.Json.JsonProperty("featured", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Featured { get; set; } - - [Newtonsoft.Json.JsonProperty("cluster_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Cluster_id { get; set; } - - [Newtonsoft.Json.JsonProperty("website_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Website_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("owner_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Owner_id { get; set; } - - [Newtonsoft.Json.JsonProperty("uptime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Uptime { get; set; } - - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ServerStatus Status { get; set; } - - [Newtonsoft.Json.JsonProperty("ping", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Ping { get; set; } - - [Newtonsoft.Json.JsonProperty("map", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Map { get; set; } - - [Newtonsoft.Json.JsonProperty("used_slots", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Used_slots { get; set; } - - [Newtonsoft.Json.JsonProperty("max_slots", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Max_slots { get; set; } - - [Newtonsoft.Json.JsonProperty("motd", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Motd { get; set; } - - [Newtonsoft.Json.JsonProperty("players", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Players { get; set; } - - [Newtonsoft.Json.JsonProperty("last_online", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_online { get; set; } - - [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Country { get; set; } - - [Newtonsoft.Json.JsonProperty("steam", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Steam { get; set; } - - [Newtonsoft.Json.JsonProperty("discord_server_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Discord_server_id { get; set; } - - [Newtonsoft.Json.JsonProperty("youtube_video_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Youtube_video_url { get; set; } - - [Newtonsoft.Json.JsonProperty("tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Tags { get; set; } - - [Newtonsoft.Json.JsonProperty("comment_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Comment_count { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GameServerCluster - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("package_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Package_id { get; set; } - - [Newtonsoft.Json.JsonProperty("website_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Website_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("owner_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Owner_id { get; set; } - - [Newtonsoft.Json.JsonProperty("discord_server_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Discord_server_id { get; set; } - - [Newtonsoft.Json.JsonProperty("youtube_video_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Youtube_video_url { get; set; } - - [Newtonsoft.Json.JsonProperty("tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Tags { get; set; } - - [Newtonsoft.Json.JsonProperty("comment_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Comment_count { get; set; } - - [Newtonsoft.Json.JsonProperty("server_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Server_count { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Group - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("tag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Tag { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Type { get; set; } - - [Newtonsoft.Json.JsonProperty("privacy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Privacy { get; set; } - - [Newtonsoft.Json.JsonProperty("owner_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Owner_id { get; set; } - - [Newtonsoft.Json.JsonProperty("verified", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Verified { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("member_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Member_count { get; set; } - - [Newtonsoft.Json.JsonProperty("follower_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Follower_count { get; set; } - - [Newtonsoft.Json.JsonProperty("view_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int View_count { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GroupGame - { - [Newtonsoft.Json.JsonProperty("group_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Group_id { get; set; } - - [Newtonsoft.Json.JsonProperty("game_id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Game_id { get; set; } - - [Newtonsoft.Json.JsonProperty("stats", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Stats { get; set; } - - [Newtonsoft.Json.JsonProperty("acquired", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Acquired { get; set; } - - [Newtonsoft.Json.JsonProperty("last_used", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_used { get; set; } - - [Newtonsoft.Json.JsonProperty("group", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Group Group { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GroupMember - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name { get; set; } - - [Newtonsoft.Json.JsonProperty("verified", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Verified { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("last_online", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_online { get; set; } - - [Newtonsoft.Json.JsonProperty("rank", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public GroupRank Rank { get; set; } - - [Newtonsoft.Json.JsonProperty("since", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Since { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupRank - { - - [System.Runtime.Serialization.EnumMember(Value = @"member")] - Member = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"leader")] - Leader = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"owner")] - Owner = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class HashViewModel - { - [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Value { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LeaderboardItem - { - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("level", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Level { get; set; } - - [Newtonsoft.Json.JsonProperty("experience", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Experience { get; set; } - - [Newtonsoft.Json.JsonProperty("points", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Points { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum LeaderboardOrder - { - - [System.Runtime.Serialization.EnumMember(Value = @"level")] - Level = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"points")] - Points = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum LoginProvider - { - - [System.Runtime.Serialization.EnumMember(Value = @"steam")] - Steam = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"epic")] - Epic = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"discord")] - Discord = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"microsoft")] - Microsoft = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"playstation")] - Playstation = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"google")] - Google = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"apple")] - Apple = 6, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LoginRequest - { - [Newtonsoft.Json.JsonProperty("login", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Login { get; set; } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Password { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LoginResponse - { - [Newtonsoft.Json.JsonProperty("user", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public UserInfo User { get; set; } - - [Newtonsoft.Json.JsonProperty("access_token", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Access_token { get; set; } - - [Newtonsoft.Json.JsonProperty("refresh_token", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Refresh_token { get; set; } - - [Newtonsoft.Json.JsonProperty("expires_in", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long Expires_in { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Profile - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name { get; set; } - - [Newtonsoft.Json.JsonProperty("flags", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Flags { get; set; } - - [Newtonsoft.Json.JsonProperty("verified", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Verified { get; set; } - - [Newtonsoft.Json.JsonProperty("level", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Level { get; set; } - - [Newtonsoft.Json.JsonProperty("experience", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Experience { get; set; } - - [Newtonsoft.Json.JsonProperty("public_birthday", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Public_birthday { get; set; } - - [Newtonsoft.Json.JsonProperty("birthday", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset? Birthday { get; set; } - - [Newtonsoft.Json.JsonProperty("points", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Points { get; set; } - - [Newtonsoft.Json.JsonProperty("location", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Location { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("last_online", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_online { get; set; } - - [Newtonsoft.Json.JsonProperty("biography", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Biography { get; set; } - - [Newtonsoft.Json.JsonProperty("view_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int View_count { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ProfileGame - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("capsule_image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Capsule_image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("library_image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Library_image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("slug", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Slug { get; set; } - - [Newtonsoft.Json.JsonProperty("time_used", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Time_used { get; set; } - - [Newtonsoft.Json.JsonProperty("unlocked_achievements", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Unlocked_achievements { get; set; } - - [Newtonsoft.Json.JsonProperty("total_achievements", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Total_achievements { get; set; } - - [Newtonsoft.Json.JsonProperty("stats", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Stats { get; set; } - - [Newtonsoft.Json.JsonProperty("acquired", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Acquired { get; set; } - - [Newtonsoft.Json.JsonProperty("last_used", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_used { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ProfileGroup - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("tag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Tag { get; set; } - - [Newtonsoft.Json.JsonProperty("privacy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Privacy { get; set; } - - [Newtonsoft.Json.JsonProperty("verified", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Verified { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("member_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Member_count { get; set; } - - [Newtonsoft.Json.JsonProperty("rank", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public GroupRank Rank { get; set; } - - [Newtonsoft.Json.JsonProperty("since", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Since { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RefreshRequest - { - [Newtonsoft.Json.JsonProperty("refresh_token", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Refresh_token { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RegisterRequest - { - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid? Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(45, MinimumLength = 3)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[a-zA-Z0-9-_]*$")] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(255)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")] - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public string Password { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchRequest - { - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public SearchType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("query", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Query { get; set; } - - [Newtonsoft.Json.JsonProperty("page", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Page { get; set; } - - [Newtonsoft.Json.JsonProperty("game_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Game_id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SearchType - { - - [System.Runtime.Serialization.EnumMember(Value = @"user")] - User = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"group")] - Group = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"server")] - Server = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"cluster")] - Cluster = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ServerMetrics - { - [Newtonsoft.Json.JsonProperty("server_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Server_count { get; set; } - - [Newtonsoft.Json.JsonProperty("package_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Package_count { get; set; } - - [Newtonsoft.Json.JsonProperty("country_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Country_count { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ServerStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"unknown")] - Unknown = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"offline")] - Offline = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"online")] - Online = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Subscription - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("image_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Image_url { get; set; } - - [Newtonsoft.Json.JsonProperty("prices", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary Prices { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UpdateProfile - { - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name { get; set; } - - [Newtonsoft.Json.JsonProperty("biography", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Biography { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserInfo - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Guid Uuid { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name { get; set; } - - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public UserType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("flags", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Flags { get; set; } - - [Newtonsoft.Json.JsonProperty("permissions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Permissions { get; set; } - - [Newtonsoft.Json.JsonProperty("verified", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Verified { get; set; } - - [Newtonsoft.Json.JsonProperty("level", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int Level { get; set; } - - [Newtonsoft.Json.JsonProperty("experience", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Experience { get; set; } - - [Newtonsoft.Json.JsonProperty("public_birthday", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool Public_birthday { get; set; } - - [Newtonsoft.Json.JsonProperty("birthday", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset? Birthday { get; set; } - - [Newtonsoft.Json.JsonProperty("points", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double Points { get; set; } - - [Newtonsoft.Json.JsonProperty("location", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Location { get; set; } - - [Newtonsoft.Json.JsonProperty("language", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Language { get; set; } - - [Newtonsoft.Json.JsonProperty("timezone", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Timezone { get; set; } - - [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Currency { get; set; } - - [Newtonsoft.Json.JsonProperty("photo_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Photo_url { get; set; } - - [Newtonsoft.Json.JsonProperty("banner_url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Banner_url { get; set; } - - [Newtonsoft.Json.JsonProperty("last_online", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Last_online { get; set; } - - [Newtonsoft.Json.JsonProperty("biography", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Biography { get; set; } - - [Newtonsoft.Json.JsonProperty("view_count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int View_count { get; set; } - - [Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset Created { get; set; } - - [Newtonsoft.Json.JsonProperty("updated", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Updated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public enum UserType - { - - [System.Runtime.Serialization.EnumMember(Value = @"user")] - User = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"bot")] - Bot = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"organization")] - Organization = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - internal class DateFormatConverter : Newtonsoft.Json.Converters.IsoDateTimeConverter - { - public DateFormatConverter() - { - DateTimeFormat = "yyyy-MM-dd"; - } - } - - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TribufuApiException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public TribufuApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TribufuApiException : TribufuApiException - { - public TResult Result { get; private set; } - - public TribufuApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 108 -#pragma warning restore 114 -#pragma warning restore 472 -#pragma warning restore 612 -#pragma warning restore 1573 -#pragma warning restore 1591 -#pragma warning restore 8073 -#pragma warning restore 3016 -#pragma warning restore 8603 -#pragma warning restore 8604 -#pragma warning restore 8625 diff --git a/src/Tribufu/TribufuApiOptions.cs b/src/Tribufu/TribufuApiOptions.cs deleted file mode 100644 index 0641f1f..0000000 --- a/src/Tribufu/TribufuApiOptions.cs +++ /dev/null @@ -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; - } - } -} diff --git a/src/Tribufu/TribufuApiSingleton.cs b/src/Tribufu/TribufuApiSingleton.cs new file mode 100644 index 0000000..1a01583 --- /dev/null +++ b/src/Tribufu/TribufuApiSingleton.cs @@ -0,0 +1,33 @@ +// Copyright (c) Tribufu. All Rights Reserved. +// SPDX-License-Identifier: MIT + +namespace Tribufu +{ + /// + /// Tribufu API + /// + /// + /// Helper class to get a singleton instance of the . + /// + public static class TribufuApiSingleton + { + private static TribufuApi? _instance = null; + + /// + /// Get the singleton instance of . + /// + public static TribufuApi GetInstance() + { + _instance ??= TribufuApi.FromEnvOrDefault(); + return _instance; + } + + /// + /// Reset the singleton instance of . + /// + public static void ResetInstance() + { + _instance = null; + } + } +} diff --git a/src/Tribufu/api.nswag b/src/Tribufu/api.nswag deleted file mode 100644 index f5b4292..0000000 --- a/src/Tribufu/api.nswag +++ /dev/null @@ -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" - } - } -} diff --git a/vendor/openapi-generator/LICENSE b/vendor/openapi-generator/LICENSE new file mode 100644 index 0000000..310853b --- /dev/null +++ b/vendor/openapi-generator/LICENSE @@ -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. diff --git a/vendor/openapi-generator/openapi-generator-cli.jar b/vendor/openapi-generator/openapi-generator-cli.jar new file mode 100644 index 0000000..f373b7a Binary files /dev/null and b/vendor/openapi-generator/openapi-generator-cli.jar differ